Question on Request closed Notification

Mani60
Tera Contributor

Hi,

 

In Request closed notification, I have created one template and in that template  i need to add two variable "New Email" and "New UPN". So could you help me on this to get the proper solution.

 

Thanks,

2 REPLIES 2

Nayan  Dhamane
Kilo Sage
Kilo Sage

Hello @Mani60 ,

 

You can create a mail script by navigating to System Notification->Email->Notification Email Scripts. You have to call that from your email notification using "${mail_script:<email_script_name>}

 

To display particular Variables, you can use below code in email Notification script:

 

template.print('My variable name is '+current.variables.<variable_name>). // Replace <variable_name> with your variable name

 

If my answer solved your issue, please mark my answer as Correct & Helpful based on the Impact

Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.

Ayushi12
Mega Sage

Hi @Mani60 

You can display Variables in the email Notification script with below code:

template.print(current.variables.<variable_name>.getDisplayValue()); //Replace <variable_name> with your variable name

Then call the email script in the email template: ${mail_script:<email_script_name>} //Replace <email_script_name> with your email script name

Hope this helps 

Mark the answer correct and helpful if this helps you 

Thanks