- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 02:01 AM
Hi All,
I am trying to update the font of customer visible comments that gets displayed in email notification. As system default it prints as Times New Roman, however, I need it to be Arial to match the content of email notifications they are called at. I read quite a few community feeds and SN wiki, and below is the email script that I could come the closest yet it does not work I would like to print all comments and just change the font size and face. Does anyone have any thoughts/suggestions?
printComments();
//this script was created in order to update comments font
function printComments() {
var comments = current.comments.getJournalEntry(-1);
gs.log("Comments before replace: " + comments);
comments = comments.replace(/(\d+-\d+-\d+.*?)(\(\))/gim,"<hr /><strong>$1</strong> <!--<sup>$2<\/sup>-->"); //this regular expression sometimes didn't work in my testing
gs.log("Comments after replace: " + comments);
var commentArray = comments.split("\n\n");
template.print("<font face='arial,helvetica,sans-serif' font size='2'>" + cmtArray[-1] + "\n\n</font>");
}
I would greatly appreciate any ideas!
Kind Regards,
Kamile
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 02:28 AM
Verify if this works
var notes = current.comments.getJournalEntry(-1);
var na = notes.split("\n\n");
for (var i = 0; i < na.length; i++)
template.print("<font face='arial,helvetica,sans-serif' size='15'>" + na[i].toString() + "</font><br>");

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 02:28 AM
Verify if this works
var notes = current.comments.getJournalEntry(-1);
var na = notes.split("\n\n");
for (var i = 0; i < na.length; i++)
template.print("<font face='arial,helvetica,sans-serif' size='15'>" + na[i].toString() + "</font><br>");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 04:35 AM
It worked! Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2022 06:04 AM
I have tried this, and it works, but, I cannot set the font at "trebuchet ms" ans the size of "10".
It stay's the same as pre- editting. What to do? I have the "Rome" instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2018 05:45 PM
I have been experiencing the same issue and I recently discovered that some notifications worked and some did not. This led me down a path where I analyzed the actual message HTML and was able to fix it!
In a nutshell, the font type and size must be set within a <div> tag. When it wasn't working, there were only paragraph tags <p></p>.
HTML Message text using <p> doesn't work:
<p><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt;">Additional comments: </span><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt;">${comments}</span></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> </span></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> </span></p>
HTML Message text converted to <div> works:
<div><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt;">Additional comments: ${comments}</span></div>
<div><span style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> </span></div>
This was tricky and elusive to figure out, however, I hope it saves someone else some time in the future!