How to get recipient list inside email notification script ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2016 07:00 AM
Hello ,
I want to get the list of recipient inside a notification email script.
Here is the code i used inside the notification email script.
var recipients = email.recipients;
gs.log("recipients : "+recipients,"me");
When i check the system log i found recipient empty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2016 07:14 AM
recipient lists are separated by comma ?
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2016 07:26 AM
Yes in the notification recipient lists are separated by comma, but when i use gs.log("recipients : "+recipients,"me"); in notification email script its empty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2016 07:36 AM
Create a event based notification whose parameter 1 contains receipient.
In the email script write script like
var recipients = email.recipients.split(',');
for (var i=0; i<recipients.length;i++){
eventQueue('eventname', current, recipients[i]); //change the event name
}
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2016 08:49 AM
Thank you Mihir Mohanta for you answer, The notification is sent when an incident is created , should i create an other event as you mentioned?