Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to add email recipients via email script and according to conditions

susunow
Tera Contributor

Hi,

 

I would like to create a schedule email for change task ticket. However, the email template is all using the same one but it is based off of different locations and these locations have different email recipients. 

 

Is there a way for me to do this via email script similar to adding cc email?

 

Thanks 

5 REPLIES 5

Barath P
Tera Guru

Hi @susunow 

You can add "cc" and "bcc" as below script:

email.addAddress("cc","bp.copy@example.com","bp");

If your notification is a event based one, use the event parm1 / 2 "to" send the notification.

"If you found my answer helpful, please give it a like and mark it as the accepted solution. It helps others find the solution more easily and supports the community!"

 

Thanks & Regards,

Barath.P