Adding Email Recipients in CC or BCC

Community Alums
Not applicable

Hi Team,

Can you please help me the below requirement, we are sending an email notifications to customer through event queue, event is fired through business rule, now we want want the some of the users in CC or BCC, how can we add the users in CC when we are sending email to event queue??

Regards,

Prudhvi

3 REPLIES 3

Slava Savitsky
Giga Sage

You could pass the IDs of the extra recipients as a parameter in your gs.EventQueue() call and then use the methods of the Mail Script API to retrieve that information in a mail script and add recipients to Cc or Bcc as needed using addAddress() method.

Kajal Goti
Mega Guru

Hi,

 

You can write notification email script like this

 

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {

// Add your code here

var user = new GlideRecord("Query your table");
user.addQuery("Apply filter");
user.query();
while(user.next()){
email.addAddress("bcc",user.getValue('email_address'),user.getValue('name'));

email.addAddress("cc",user.getValue('email_address'),user.getValue('name'))
}


})(current, template, email, email_action, event);

add this mail script into your notification

 

 

Please mark as correct/helpful, If you find any help

Hello @A prudhvi raj

Thanks for marking as helpful

Can you please mark as correct my reply, If you find a solution
So that in future same thread will utilize to other use may have same query