Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Adding email addresses from email script to bcc in a notification isn't working

Rupam_1
Tera Contributor

I am trying to add a recipient of an email notification using email script, CC is working fine but Bcc is not working. I am adding a screen short of a sample email notification where a notification get trigger when a user updates an incident form.

 

                                               ************ Email Script***********

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

// Add your code here

var user = new GlideRecord("incident");
user.addQuery('sys_id', current.sys_id);
user.query();
while (user.next()) {
email.addAddress("cc", "alejandra.prenatt@example.com", "Alejandra Prenatt");

email.addAddress('cc', user.caller_id.email.toString(), user.caller_id.getDisplayValue());
email.addAddress('bcc', user.assigned_to.email.toString(), user.assigned_to.getDisplayValue());
}

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