Add DL in CC in Email Notifications

Harish Kota
Kilo Sage

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);

 

PFA Screenshot for the same, if required.

 

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

 

 

3 REPLIES 3

Kalyani Jangam1
Mega Sage
Mega Sage

Hi @Harish Kota 

email.addAddress("cc","email_address_of_the_user","Name_of_ther_user");

add cc using email script.

 

Please mark correct if it will help you. 

Harish Kota
Kilo Sage

Hi Kalyani,

I have created this post as it is working fine by using my script for better understanding to users, This is not an issue.

 

Thanks,

Harish Kota

Vijay Talupula
Tera Guru
Tera Guru

It works for me, thanks!