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

asifnoor
Kilo Patron

Hi,

If the email did not go to a specific user, then you need to check for following

  • Check in logs and see if the user is inactive or locked out
  • Check if the user notification preferences is disabled. you can find it in logs
  • Check in logs, if the message that notification is sent is shown in the logs. if not there should be some error.

Mark the comment as a correct answer and helpful if it helps.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Is the cc user receiving the email properly?

The email logs table has copied column; there you can check the cc user is present or not

screenshot below

find_real_file.png

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

Hi,

Yes, It is there in copied . Whether it will send the mail to the following user when it is in copied ??

Another question that how to send the copied mail in the receiptant ??