Styling Email Body inside mailto in a notification script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 01:50 AM
Hi All,
We have received a requirement to redesign the Approve/Reject Mailto Notification Body So it will look like following sample:
So, as part of development we have created a email script that runs the following code:
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
// Add your code here
var image = "/Approve.png";
var response = "approve";
var emailbod = "Please enter any approval comments here and press Send to submit your response. Comments are mandatory if you are rejecting the request.";
// template.print(renderMailtoButton(img, response, emailbod));
var instance = gs.getProperty("instance_name");
var link = "https://" + instance + ".service-now.com";
var mark = email.watermark;
var number = current.number;
var emailAddress = instance + "@service-now.com";
if (current.getTableName().indexOf("sysapproval") != -1) {
number = current.sysapproval.number;
}
template.print('<a href="mailto:' + emailAddress + '?subject=Re:' + number + ' ' + response + '&body=' + emailbod +"%0D%0A" + "%0D%0A" + "Comments: " + "%0D%0A" + "%0D%0A" + mark + '"><img src="/Approve_en.png" alt="Approve" width="106"></a>');
})(current, template, email, email_action, event);
Therefore, the Inbound email body looking like this:
So, we are missing the outer box for the Comment Field.
Can anyone guide us how to include a create something like a single cell table for this comment field in the email script that can appear on the Email Body.
Thanks & Regards,
Sayantan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 01:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 05:47 AM
Hi Omkar,
I tried implementing this but instead of creating the table, this whole string of myhtml including the html tags itself, are getting printed on the inbound email body.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 01:15 AM
Were you able to do this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 11:50 PM
I have the same requirement can you please guide me how you have done it.