Can we add text color in email mail scripts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2020 03:41 PM
I am trying to add color red to the text on the email script and not able to do it successfully.
The below mail script is for the 'Resolved notification- I have a Reject Solution button and then when clicked on the 'Reject Solution' button the text comes from the 'href' in the body (highlighted in yellow).
I am not sure how to change the text color like this text Reject Reason: [type the reason you are rejecting the resolution]
Any help is appreciated. please let me if there is an easy method.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2020 06:58 AM
try this
&body=<font color='red' size='100px'>Your message here</font>
also refer this link
Include html in mailto email template?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2020 10:56 PM
Hope you are doing good.
Let me know if I have answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2020 10:11 AM
Can you share your complete code instead of screenshot?
I will correct your code to make it work.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2020 07:22 PM
Hi
Sorry for the delay, here is the code below-
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
// Add your code here
(function(smtpAddress, watermark) {
var href = 'href="mailto:'+ 'dev98980@service-now.com' +'?subject=Re: ${number}%3A%20 reopen&'+ 'body=Rejected. Please reopen the incident. %0A%0A*Reject Reason: [type the reason you are rejecting the resolution] %0A%0A%0A%0A%0A%0ADO NOT DELETE TEXT BELOW %0A%0A' + watermark + '"';
var anchor = '<a '+ href +'><img src="/rejectsolution.png" style="width:204;height:44" alt="RejectSolution" /></a>';
//var emailbod = "I approve this request.";
template.print(anchor);
// template.print('<p style="font-size:12px; color:#000000; font-family:arial"><strong>');
// template.print('body');
// template.print('</strong></p>');
//template.print('${number}');
})(gs.getProperty('glide.email.user'), email.watermark);
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2020 08:29 PM
Hi,
can you try this
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
// Add your code here
(function(smtpAddress, watermark) {
var href = 'href="mailto:'+ 'atxdev@service-now.com' +'?subject=Re: ${number}%3A%20 reopen&'+ 'body=<font color='red' size='100px'>Rejected. Please reopen the incident. %0A%0A*Reject Reason: [type the reason you are rejecting the resolution] </font>%0A%0A%0A%0A%0A%0ADO NOT DELETE TEXT BELOW %0A%0A' + watermark + '"';
var anchor = '<a '+ href +'><img src="/rejectsolution.png" style="width:204;height:44" alt="RejectSolution" /></a>';
//var emailbod = "I approve this request.";
template.print(anchor);
// template.print('<p style="font-size:12px; color:#000000; font-family:arial"><strong>');
// template.print('body');
// template.print('</strong></p>');
//template.print('${number}');
})(gs.getProperty('glide.email.user'), email.watermark);
})(current, template, email, email_action, event);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader