How to set dynamic email template on a single email notification

Prinsu1
Tera Contributor

Hi All,

I have 100s of email templates which needs to be set on an email notification dynamically based on a condition. Is this possible? Can I set email template from email script? If so, can someone please help me with the command please.

I'm not looking to create 100s of notification.

2 REPLIES 2

mattystern
Kilo Sage

Hi Prinsu,

 

For multiple conditions, I usually do create individual notifications. However, using Insert and Stay makes this process easy to create multiple different notifications. 

Reference: 

 

mattystern_3-1671055028821.png

 

You can create one mail script and call it with ${mail_script:[name of mail script]}

mattystern_4-1671055083659.png

 

mattystern_5-1671055092199.png

Mail scripts are written in System Notifications > Email > Notification Email Scripts. Documentation here: https://docs.servicenow.com/en-US/bundle/tokyo-servicenow-platform/page/script/server-scripting/conc...

 

 

SanjivMeher
Kilo Patron
Kilo Patron

Do you have 100s of email templates? How different are those from each other?

There is no script which apply a template to the notification.

You can definitely use email script to put content in it. But if the templates are in hundred, not sure if you can script all the html in those.


Please mark this response as correct or helpful if it assisted you with your question.