Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Updating Customer Visible Comments Font in Email Notifications

Sofija
Giga Expert

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

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

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>");


View solution in original post

5 REPLIES 5

I have tried this as well, but sadly, it does not work.