- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 09-03-2020 10:13 AM
Reply mail with set values
In order to let users reply to an email with set values in the Subject and email body you can do the following:
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:
Hope this helps! leave a comment or feedback to help improve the article.
- 1,542 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
This is a great solution, Willem!
Because ServiceNow used an Email Template record for the out-of-box "mailto.approval" setup, I've also looked into that option. Apparently, the tricks to know when using the Email Template approach are:
- The Subject of your template will become the subject of the reply.
- The first line of text in your Message HTML will become the clickable text in any notification that displays ${mailto:[your template Name]}.
- Every line after the first line of text in your Message HTML will become the body of the reply*.
*Since the mailto.approval setup doesn't make use of #3, I consider that the "secret ServiceNow code" that hopefully remains in place forever.
(Thanks for providing a slightly more intuitive option over the secret ServiceNow approach, Willem!)