- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2020 09:14 AM
Hello all,
I want to add some email addresses to the 'TO' field of an email notification, dynamically using an email notification script. There's a recent post asking the same thing here: https://community.servicenow.com/community?id=community_question&sys_id=947dff3fdb5adc549e691ea66896...
The suggested solution there was to do something like this:
email.addAddress("to","john.copy@example.com","John Roberts");
However that's not working for me, and according to the documentation below, this method can only be used to add recipients to the 'CC' or 'BCC' field. Is there a way to do this for the 'TO' field?
Thanks
Jamie
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2020 09:29 AM
You cannot do "to"
Only allowed are "cc" and "bcc"
email.addAddress("cc","john.copy@example.com","John Roberts");
If your notification is a event based one, use the event parm1 / 2 "to" send the notification.
Vinod Kumar Kachineni
Community Rising Star 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2020 09:29 AM
You cannot do "to"
Only allowed are "cc" and "bcc"
email.addAddress("cc","john.copy@example.com","John Roberts");
If your notification is a event based one, use the event parm1 / 2 "to" send the notification.
Vinod Kumar Kachineni
Community Rising Star 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2020 09:50 AM
Ah yes I see. This could be the way forward. The notification is event driven, actually from a UI Action. So I could set event.parm1 to be the list of recipients and pass that in. It just means the processing gets done as part of the script in the UI Action, rather than in the mail script. Thank you. I will let you know if this works...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2020 10:31 AM
Hi Vkachineni,
Yes that has worked fine. Thank you 🙂