- 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
12-01-2015 08:18 PM
Hey Mike,
Thanks for your reply.
The thing is, I start a new discussion here(Email notification are not sending when an event is trigger ) and found that I have a problem in my dev instance. My logic and code is correct so I already contact to ServiceNow and they reset my instance. Now its working fine.
Thanks-
Macarius Anna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2015 09:51 PM
Hi Mike,
I have the same requirement of sending the email to few users at run time. By your thought i understand it is possible through events. But is there any way to do the same in mail script to set "To" Notification email addresses??
Thanks In advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2017 08:29 AM
The ServiceNow Wiki content is no longer supported. Updated information about this topic is located here: Create an Email Notification
Visit http://docs.servicenow.com for the latest product documentation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2017 06:37 AM
Hi,
I understand this solution if it is triggered by an event, but what if the notification is triggered by a simple condition (as it is my case)?
There is not an e-mail script that allows me to set dinamically the "To" recipients?
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2014 08:04 AM
Hello,
Thanks for your answer. Do you know if it's possible with the Dublin release ? I've tried to find the "Event parm" under the Advanced view without success. I'm wondering if I'm doing wrong or if it's available only in Dublin/Eureka but not on Calgary
Regards
Thibault