Dynamic Recipients in Email Notifications

SMS1
Tera Contributor

Hi Guys, 

 

Need a quick help. 

 

How to add users in email notifications recipient list from Watchlist? Can we add them in the CC list? 

1 REPLY 1

Muhammad Khan
Mega Sage
Mega Sage

Hi SMS,

 

You can add users from watch field as shown in the image below;

find_real_file.png

If you want to add them in cc then you can use following;

//email.addAddress(type, address, displayname);
email.addAddress("cc","john.copy@example.com","John Roberts");


You just need to create an email script and there you can loop through your watch list field and
add cc as per the above statement.
Then call this email script in the notification's email body.


For reference:
https://docs.servicenow.com/bundle/rome-servicenow-platform/page/script/server-scripting/reference/r...

Hopefully this will resolve your query.