Template.Print font setting for comments_work_notes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2019 07:11 AM
I am attempting to create an email script that will set the font for comments and work notes from change requests in an email notification. The script below will add the comments but it will not set the font. Would really appreciate any assistance with getting the font set so it matches the rest of the notification.
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
template.print('<p><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt;">${comments_and_work_notes}</span></p>');
})(current, template, email, email_action, event);
- Labels:
-
Request Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2019 09:03 AM
Hello Bridget,
Try it like this instead
template.print('<p><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt;">' + comments_and_work_notes + '</span></p>');
Or
template.print('<p><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt;">' + ${comments_and_work_notes} + '</span></p>');
But in a mail script you should have your variables and styles/tags separated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2019 09:25 AM
Thanks for responding. Adding the single quotes gives an error and removing them but leaving the + signs just adds a plus sign before and after the work notes.
I'm very new to scripting so unsure how to call the field from the change request separately and then apply the style to it as you've suggested. I've just been trying to modify already existing mail scripts in our instance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2019 09:32 AM
Could you post a screenshot of what all the code looks like? That might help me a little more.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2019 09:45 AM