How to add approve or rejcet button in mail.

shubhamgoch
Tera Contributor

I am facing one issue that while adding button in the email template.

Problem statement : - 

 

I want to change the RITM state via email once end user will click on approve or reject from the mail it should update the state on the RITM table. 

How can i achieve this.

Below is the process which is currently i am following :-

Created email template and add buttons in that email and for the action I have created UI action for approve or reject.

4 REPLIES 4

Dr Atul G- LNG
Tera Patron

Hi @shubhamgoch 

 

https://www.servicenow.com/community/itsm-blog/approve-reject-button-in-approval-notification/ba-p/2...

 

@Jaspal Singh  solution 100% work here.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Singh3
Tera Expert

Ankur Bawiskar
Tera Patron

@shubhamgoch 

you didn't share what you configured and what debugging did you do

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

yashkamde
Tera Expert

Hello @shubhamgoch ,

Add an email script as follows: ${mail_script:email.approval.btn}, based on the this configure the notification..

Upload the image for the approve button in System UI > Images, and my email script looks like this:

(function runMailScript(/* GlideRecord / current, / TemplatePrinter / template,/ Optional EmailOutbound / email, / Optional GlideRecord / email_action,/ Optional GlideRecord */ event) {

var img = "btn_aprove.png";

var response = "approve";

template.print(renderMailtoButton(img, response));

})(current, template, email, email_action, event);

If you find this helpul mark as helpul...