- 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
05-10-2014 09:58 AM
This is possible in the Calgary release as well as Dublin.
You may not see these fields depending on the setup of your notification. These are usually only available when a notifications "Send when" is "Event is fired".
https://wiki.servicenow.com/index.php?title=Email_Notifications#Advanced_View_Fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2014 04:05 AM
Indeed ! Thanks for your help !

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2015 06:21 AM
Hi Sanjeev,
Even though your question is answered, I'm still having a hard time understanding how to use event.parm1 to add to a 'To:' message.
What I'm having a hard time understanding is where to put the line
gs.eventQueue("change.inserted", current, gs.getUserID(), gs.getUserName());
Is it in a business rule? Is it in an email script?
Can you outline how how got event.parm1 working?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2015 07:26 AM
Hi Matthew,
That code would be used in a business rule or anywhere else where it would be ran on the server (i.e. Business rule, Scheduled job/script).
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2019 02:16 PM
Did you have your problem solved? If not, you can modify the Cc, Bcc, or To address lines in the email script. Take a look in the following link:
https://community.servicenow.com/community?id=community_question&sys_id=61fb4325db9cdbc01dcaf3231f96...