Email script not showing anything in notification

jthomsen
Tera Contributor

jthomsen_0-1712149278413.png

I created this script to greet the user at the start of every notification, but when I add it to any notification nothing shows up in the preview of the noti

11 REPLIES 11

Community Alums
Not applicable

You need to use template.print("Your message here " + person) to push it to the target object. 

Community Alums
Not applicable

JoroKlifov1_0-1712157533048.png

 

Hi @Community Alums ,

Changed the script to this 

jthomsen_0-1712325552212.png

still nothing visible on the notification preview unfortunately

@jthomsen Update the script as follows and see if it works.

 

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

    // Add your code here
    var person = current.caller_id.last_name + '';
    var msg = 'Sehr geehrte(r) Frau/Herr';
    template.print(msg + person);

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