
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 08:42 AM
Hi all,
I would like to send a E-mail to multiple user by using Email notification.
Now, I set up like as below.
-a business rule creates a event by using "gs.eventQueue()"
-the event gets pram 1 correctlly
-the value of parm 1 is "xxx@example.com, yyy@example.com, zzz@example.com"
-a event trigers E-mail notification and a E-mail is sent
-the recipients of the E-mail is only "xxx@example.com"
How should I set some E-mail addresses to Parm 1?
If someone knows, please let me know.
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 08:47 AM
Hi,
You will have to create a loop in business rule.
For example:
var emailID = "xxx@example.com, yyy@example.com, zzz@example.com";
var spl = emailID.split(',');
var len = spl.length;
for(var i=0; i<len;i++){
gs.eventQueue('eventname',current,spl(i));
}
Note: Please check this code properly. Consider this to be sample.
THanks,
Ashutosh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 08:55 AM
Hello Kento,
This would be a normal behavior if you are getting just one value in the parameter you are passing to Param2 or if you are not looping on the users got from the users list.
In order to send this notification to multiple users, you should use a glide record in which you get all the users you want the email to sent. After, you should put a while loop on the list of your users and use the gs.eventQueue() to call the notification and in Param2 you pass the users your iterating on.
Here is the doc for cusing gs.EventQueue() method : https://developer.servicenow.com/app.do#!/lp/new_to_servicenow/app_store_learnv2_automatingapps_king....
Cheers

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2019 04:43 PM
Hello,
Thank you so much.
I understand and it is working as I desire.
Thanks
Kento