- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2020 09:17 AM
Hi All,
I'm seeking assistance on how to best pre-populate the email message window when a user clicks on a notification that they get when a case moves to 'Awaiting Acceptance'. To give more context, if the user is not satisfied with the case resolution, they can click the hyperlink 'here' embedded in the notification email to trigger an inbound action that will move the case from Awaiting Acceptance to Work in Progress.
Upon clicking the hyperlink, I'm able to prepopulate the subject of the email pop-up that the user will get, however, I also want to prepopulate the email body as well with some instructions. Please see the screenshots below to have a better understanding.
I'm not sure if i'm using the 'mailto' script correctly for my use-case.
Thanks,
MU
Below is how the notification for the state Awaiting Acceptance is configured:
Actual Email Pop-up window that opens up with clicked on the hyperlink: here
The expected email message that should open with the pre-populated message:
Email Template used in the notification
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2020 10:13 AM
You can create a mail script to generate the 'click here' button. You can of course change the text. Then wherever you want to include that button use "${mail_script:reply_button}":
The mail script:
You can update the subjectTxt and bodyTxt to your liking.
Replace YOURINSTANCEEMAIL@service-now.com with your reply url
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var subjectTxt = encodeURI('Re:' + current.number + ' - Please Reopen');
var bodyTxt = encodeURI('You are requesting to reopen your ticket. Can you please.....');
template.print('<a title="click here" href="mailto:YOURINSTANCEEMAIL@service-now.com?SUBJECT=' + subjectTxt + '&body='+ bodyTxt + '">Click here</a>');
})(current, template, email, email_action, event);
The email:
The result:
And in Outlook:
I created an article for it:
Hope this helps! If so, Please mark Correct and Helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2020 10:13 AM
You can create a mail script to generate the 'click here' button. You can of course change the text. Then wherever you want to include that button use "${mail_script:reply_button}":
The mail script:
You can update the subjectTxt and bodyTxt to your liking.
Replace YOURINSTANCEEMAIL@service-now.com with your reply url
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var subjectTxt = encodeURI('Re:' + current.number + ' - Please Reopen');
var bodyTxt = encodeURI('You are requesting to reopen your ticket. Can you please.....');
template.print('<a title="click here" href="mailto:YOURINSTANCEEMAIL@service-now.com?SUBJECT=' + subjectTxt + '&body='+ bodyTxt + '">Click here</a>');
})(current, template, email, email_action, event);
The email:
The result:
And in Outlook:
I created an article for it:
Hope this helps! If so, Please mark Correct and Helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2020 05:44 PM
This is super helpful, thank you very much!