We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

how to send CC,BCC in email notifications

Gangadhar540-
Tera Contributor

how to send CC,BCC in email notifications

1 ACCEPTED SOLUTION

Dr Atul G- LNG
Tera Patron

Hi @Gangadhar540- 

 

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

 

https://www.servicenow.com/community/developer-forum/trying-to-add-cc-to-a-email-notification-throug...

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

View solution in original post

1 REPLY 1

Dr Atul G- LNG
Tera Patron

Hi @Gangadhar540- 

 

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

 

https://www.servicenow.com/community/developer-forum/trying-to-add-cc-to-a-email-notification-throug...

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************