Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

approve button link to reply-to email window

Servicenow10
Kilo Guru

hi 

i have designed a notification which looks like this:

 

find_real_file.png

 

now what i need to do is once i click on approve button it  open a reply-to email window. Just Click 'Send' to forward the email back to ServiceNow and approve the request. The reply email is linked directly to the approval request in ServiceNow and it will look like below image

 

 

find_real_file.png

how can i achieve this through email script or any other way......please explain me in detail as am new to now and scripting

 

thanks in advance!!

1 ACCEPTED SOLUTION

Omkar Joshi
Giga Guru

Hi,

Use the below code in email script

 

 

 

(function runMailScript(current, template, email, email_action, event) {

var apButStr = '<div><a href="mailto:dev11111@service-now.com?subject=re:' + current.number + ' - approve&body='+ current.number + ' - approve' +'"><br /><img style="align: baseline;" title="Click this button to mark approved" src="/approveButton.pngx" alt="Approved" width="142" height="41" align="baseline" /></a>';

var rejButStr = '<a href="mailto:dev11111@service-now.com?subject=re:' + current.number + ' - reject&body='+ current.number + ' - Reject' +'"><img style="align: baseline;" title="Click this button to mark rejected" src="/rejectButton.pngx" alt="Rejected" width="142" height="41" align="baseline" /></a></div>';

var full = apButStr + rejButStr;

template.print(full);

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

 

 

Note:Use your instance URL.

View solution in original post

16 REPLIES 16

Deepika Mishra
Mega Guru

Hi All,

My requirement is somewhat similar but instead of opening an app (such as outlook) my requirement is to open gmail box. Please let me know if it can achieved in some way.