- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2014 02:34 AM
Hi All,
I am using email methode ' addAddress(String type, String address, String displayname) - type can be "cc" or "bcc" '
in my email script with the help of this methode I am able to send "CC" OR "BCC" but
I want to set "TO" address dynamically with the help of e-mail script.
Please let me know it's posible in ServiceNow.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2014 11:42 PM
If this notification is being triggered by an event, it sounds like you will have to use another form of script to set a list of additional users of who you want to add to the "To:" list and pass them into the notification under Event Parm 1 and/or Event Parm 2.
Wiki URL Link:
Email Notifications - ServiceNow Wiki
Event parm 1 contains recipient | (Visibile from the Advanced view) Select this check box (true) if the event parameter 1 contains the email recipient. This field is only visible when the Send when field has the value Event is fired. |
Event parm 2 contains recipient | (Visibile from the Advanced view) Select this check box (true) if the event parameter 2 contains the email recipient. This field is only visible when the Send when field has the value Event is fired. |
Example:
gs.eventQueue("change.inserted", current, gs.getUserID(), gs.getUserName());
In the above example, the sys_id returned from "gs.getUserID()" is being passed as Parm1 and the "user_name" is passed as Parm2.
You could use the "eventQueue" function to pass another sys_id or email address.
Let me know if this helps and if this answers your question, please make sure to mark your question answered if so.
Kind Regards,
Mike

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2019 11:07 AM
Not sure if you pasted the wrong link or not, but the link you pasted has no reference at all to modifying the "To" address in an email script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2020 11:49 AM
just write
email.addAddress("cc","user.email","user name");
email.addAddress("bcc","user.email","user name");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 10:45 AM
Hi Sanjeev,
We can only use the types "cc" or "bcc" with "email.addAddress()" method. Only the "Who will receive" tab of the corresponding email notification can be used for setting the "To" Address.
Please refer the below article for more information.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0832066
Thanks,
Suchitra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2025 12:04 PM
Thank you... Weird choice not to allow the "to" here, but this explains why it didn't work the last hour ;-).