How should I set Parm 1 to send a E-mail to multiple users at same time?

Kento Takahashi
Giga Contributor

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.

 

1 ACCEPTED SOLUTION

Ashutosh Munot1
Kilo Patron
Kilo Patron

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

View solution in original post

6 REPLIES 6

Ashutosh Munot1
Kilo Patron
Kilo Patron

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

Hi Ashutosh,

 

Thank you for very quick response.

You mean, I should create some events and call E-mail notification some times correct?

I think it will work very well.

Thank you so much^^!

 

Kent

Hi,


You can use same event, that event should be in for loop. So that it will trigger for all email id which you have. For example: if you have 3 emails in var emailID then event will trigger for 3 times i.e. for loop will run for 3 times as we have seperated emails by spliting them and we have length of split in len variable.


Thanks,
Ashutosh

Hi Ashutosh,

 

I understood and it is working well.

Thank you so much!

 

Kent