Can we pass parameters to email scripts from email template

Susmitha14
Tera Contributor

Hi,

I want to create a mail script and it should be called from email template. How can I achieve getting different outputs from same mail script dynamically. Can we achieve this by passing through any parameters in the email scripts. Is there any mechanism to pass parameters to mail script from email template. At present for every variable I am creating a unique mail script to get the value Is there any way to get the variables dynamically from a single mail script i.e called from email template.

1 ACCEPTED SOLUTION

Hi,

You cannot pass any parameter etc to email script unless you are triggering the notification via eventQueue

3rd or 4th parameter you can use to send some data

gs.eventQueue('event_name', obj, 'my-data','');

Then access the data in email script using event.parm1

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

11 REPLIES 11

@Susmitha 

Hope you are doing good.

Did my reply answer your question?

If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

Thanks!
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Susmitha 

Hope you are doing good.

Did my reply answer your question?

If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

Thanks!
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader