Additional comments in a notification email

ceraulo
Mega Guru

Hello!

How do I include the additional comments to a notification email containing only the contents and excluding the date/time stamp and submitter?

Thank you.

1 ACCEPTED SOLUTION

Raju Koyagura
Tera Guru

You need to depend on mail script to get this done...

 

Mail Script:

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {


var work_notes = current.work_notes.getJournalEntry(1); //replace with element name 
var regex= new RegExp('\n'); // searching for the first line break
var work_notes2=work_notes;
var i = work_notes.search(regex);
if (i>0)
{
work_notes2 = work_notes.substring(i+1, work_notes.length);
template.print(work_notes2);
}

})(current, template, email, email_action, event);

 

Calling mail script in notification:

${mail_script:script_name}

View solution in original post

5 REPLIES 5

KRANTHI MAHESH
Tera Contributor

if u are getting error in the above code in this line, just add, double slash

var regex= new RegExp('\\n'); 

it is working

thq so much....