Array of users in Business rule for Event of email notification

anubhavr
Giga Expert

I want to add some particular user like 'Abel tutor' and also some users in a particular user field in an array and send email notifications to those users. How can I implement it?

For example: If the 'u_user1' reference field contains 'Beth Auther', and 'u_user2' reference field contains 'Arun Sharma', I want to send email notification to all 3 users (Abel tutor, Beth Auther, Arun sharma) through event based on the conditions of other fields.

7 REPLIES 7

Alikutty A
Tera Sage

Hi,



You can push all entries to your array and send it as the 3rd parameter in event call.



var user = [];


user.push(current.u_user1);


user.push(current.u_user2);


user.push(current.u_user3);


gs.evenQueue('event_name', current, user, '');



Make sure you have marked event parm 1 as recipient in your notification



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


Hi,



Thanks. And how to add 'Abel Tutor' which is fixed. How to get its Id?


Hi,



I tried it but still not able to get email notification. What should I mention in event registry??



My BR:



  var usrs = [];


  var usrobj = gs.getUser();


  usrobj = usrobj.getUserByID('john.adams');


  if (current.notifications=='true')


  {


  usrs.push(current.delegate);


  }


  if (current.u_cc_jsnead == 'true')


  {


  usrs.push(usrobj);


  }


  gs.eventQueue('manage.proxy.notify', current, usrs, "" );


var user = [];


var gr= new GlideRecord('sys_user');


if(gr.get('name', 'Abel Tuter')){


user.push(gr.sys_id.toString());


}





Thanks


Please Hit like, Helpful or Correct depending on the impact of the response