How to call email script to notification?

ak4
Tera Contributor

How to call email script to notification?

7 REPLIES 7

sriram35
Kilo Guru

Hi,

 

First, you need to an email script

system notifications > Notification Email Script

click new and fill the form.

 

Go to your notification.

system notifications > Notifications 

open your notification.

What it will contain section in Message HTML you need to pass email script

${mail_script:mp_add_user_cc}  // replace your email script name in mp_add_user_cc

 

 

Hope this helps!

If I have answered your question, please mark my response as correct and/or helpful.

Thanks,

Sriram

Prateek kumar
Mega Sage

Here is the official doc:

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/script/server-scripting/concept/...


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

DirkRedeker
Mega Sage

Hi

First, you need to create a new Mail-Script. To do so, open your Notification and scroll down to the Related Links and click the one marked in the screenshot below:

find_real_file.png

In the screen that opens, click on NEW to create a new mail script. Give it a unique name.

You can use "template.print()" inside the mail script to directly output "TEXT/HTML" to the Notification body (directly to that position where you placed the Mail Script call!

Employ your mail script like shown in the screenshot below:

find_real_file.png

the Syntax needs to use "${}" to replace content, like for variable in the first line, but you fill it in with

"${mail_script:}" to call a mail script, which you will mention directly after the colon, just like:

"${mail_script:name_of_your_mail_script}.

Your name of the Mail Script even may have blanks in the name.

Let me know, if that answers your question and mark my answer as correct and helpful.

BR

Dirk