We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Use mail script in plain text only mail template

Felix20
Giga Guru

Hi everybody,

is there a possibility to use a mail script in a plain text only mail template?

We need to send an email without html content but only text, but this mail is not static so I need to use a mail script to get different content for every mail. That mail is triggered by an event from a workflow and the content is in the parm2 variable of the event.

 

Best regards,

1 ACCEPTED SOLUTION

i tested it my personal instance. 

 

Screenshot for reference. 

 

find_real_file.png

 

find_real_file.png

 

result.

 

find_real_file.png

 

 

View solution in original post

9 REPLIES 9

Omkar Joshi
Giga Guru

Hi,

Get content in one variable and add this below script.Add the below script in mail script

var text='</div>'+ add your variable here+'</div>';

template.print(text);

Felix20
Giga Guru

I may have not been precisely enough.

I want to send a plain text mail without html tags.

I already tried using a mail script in plain text mail message text. Result -> I just get the ${mail_script:XXX} text in my mail instead of the content, so ${mail_script... doenst seem to be recognized as a mail script but as a text.

i tested it my personal instance. 

 

Screenshot for reference. 

 

find_real_file.png

 

find_real_file.png

 

result.

 

find_real_file.png

 

 

Ok let me double check it. Thanks

Retested it and it worked, I may had a typo or preview notification doenst work correctly if using a mail_script in a plain text mail template.

Thanks Harshvardhan