approve and reject in mail script

Sanchit Pandey
Tera Contributor

Hi Experts,

I got a requirement for create approve and reject using mail script can anyone guide me how to accomplish it.

 

TIA

Sanchit Pandey

3 REPLIES 3

Steven Young
Tera Guru

Can you provide more details?
There are a few ways you can do this.

1. You can create a link in the email that when clicked will send a reply email to the instance and the instance will recieve the email and do the approval.

2. you can create an API endpoint that when clicked it will make them verify who they are and then approve/reject the record.
3. you can insert a link that will take them to the approval record and from there you can force rejection notes/approval notes and they approve from within the instance.


i have done all 3 before and the one that works the best from the company i was at, is the reply email.
The reply email must come back from the email it was sent to, and from there, they click a link, send the reply email and it's done.

Ratnakar7
Mega Sage
Mega Sage

Hi @Sanchit Pandey ,

 

Here's a basic guide on how to create an approve and reject functionality using mail scripts in ServiceNow:

1. Create a new email script:

Navigate to System Notification -> Email -> Notification Scripts -> New. Give your script a name, and in the script body, add your desired content for the email body and subject.

2. Create a new notification:

Navigate to System Notification -> Email -> Notification -> New. Give your notification a name, select the appropriate table, and set the notification type to "Approval". In the script field, reference the email script you created in step 1.

3. Configure the approval process:

Navigate to the record you want to approve, and open the Flow/Workflow. Add a new approval activity, and fill in the necessary information such as the approver, approval group, and approval state. Set the "Notification" field to the notification you created in step 2.

4. Respond to the approval email:

When an approver receives the approval email, they can simply reply to the email with "approve" or "reject" in the email body. ServiceNow will automatically process the email and update the approval record accordingly.

That's it!

 

you can also refer below article:

A Better, One-Click Approval 

Example scripting for email notifications 

 

If my response was helpful in resolving the issue, please consider accepting it as a solution by clicking on the Accept solution button and giving it a thumbs up 👍. This will benefit others who may have a similar question in the future.

 

Thank you!

Ratnakar

Jaspal Singh
Mega Patron
Mega Patron

Hi Sanchit,

 

Did you check article? It should help.