Send a notification to CC users

nikhitha24
Tera Guru

Can someone please help me on the below query

I want send a SLA breach notifications to CC and To users, for this i have written a email script and passed through a notification an for To users i have given directly to user from whom will receive.

nikhitha24_0-1691416852147.png

nikhitha24_1-1691416899893.png

It is taking only To users in the Email. Please help me on this query

 

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@nikhitha24 

for sending CC you need to use email script and use email.addAddress(cc)

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

nikhitha24
Tera Guru

@Ankur Bawiskar

I have written email script, but still not working.

nikhitha24_0-1691428726173.png

Please help me on this query.

 

Hey @nikhitha24 ,

Try this

.1 Create email script - sys_script_email_list.do in this table

2. Provide the Name of the email script

3. For example DL is required for Incident Table Notifications, In the Script write the code like below:

 

(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var gr = new GlideRecord("incident");
gr.addQuery("sys_id", current.sys_id);
gr.query();

if (gr.next()) {
email.addAddress("cc", "provide your DL name here");
}
})(current, template, email, email_action, event);

Add this email script to your email notifications Body(Message HTML) - ${mail_script:DL_CC}