Email script

sparkles
Tera Contributor

Hi,

I am looking for help with my script below. I need the script to display/print the question on if the answer is "unknow".

(function runMailScript(current, template, email, email_action, event) {
    var daText = '';

    if (current.variables.discussing_succession == 'unknow') {

        daText += "discussing succession? " + current.variables.discussing_succession + "<br>";
    }
    template.print(daText);


})(current, template, email, email_action, event);
 
 
 
 
I am not getting any thing.
 
Thanks!
S
3 REPLIES 3

JenniferRah
Mega Sage
Mega Sage

You will need to add a line to actually print your variable. It will look like this: 

template.print(daText);

Thanks @JenniferRah for your reply,  I have it but I didn't add it to the post

So in your notification, you are calling this email script? Are you sure that part is right? It should look like this in the body of your notification:

${mail_script:NameOfYourScript}

 

Because if that's right and there is really a variable with that exact name, your code should work.