CC email is not setting properly through email scripting

Shanmuga Raj
Tera Expert

Hi All,

I have requirement that whenever approval is rejected the notification is send to the requested for and approver.

So i have used email script and called in the body of the email, the mail is sending to the approver and requested for 

email Script :

var gr = new GlideRecord(current.sysapproval.sys_class_name);
gr.get(current.sysapproval);
if(current.sysapproval.sys_class_name == 'sc_request')
{
email.addAddress("cc",gr.requested_for.email,gr.requested_for.name);
}
else if(current.sysapproval.sys_class_name == 'sc_req_item')
{
email.addAddress("cc",gr.request.requested_for.email,gr.request.requested_for.name);
}
}

Issues I'm facing is cc mail is captured in record (see the screenshot- cc Allen) but when i looking into email is not sending to requested for (screenshot attached- only Tim )

 

Could anyone help me on this? 

 

Thanks in advance

1 ACCEPTED SOLUTION

Hi,

yes it would send email to the cc user as well. No need to show the cc user email in the recipient till the point it is working

that is out of the box behavior i.e. the recipient column stores users who are the direct recipient and cc stores the cc user etc 

Mark āœ… Correct if this solves your issue and also mark šŸ‘ Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

View solution in original post

5 REPLIES 5

Hi,

yes it would send email to the cc user as well. No need to show the cc user email in the recipient till the point it is working

that is out of the box behavior i.e. the recipient column stores users who are the direct recipient and cc stores the cc user etc 

Mark āœ… Correct if this solves your issue and also mark šŸ‘ Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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