The CreatorCon Call for Content is officially open! Get started here.

CC in the email notification not working

Shanthi10
Kilo Contributor

I have written  an email script to show a specific email address in CC of emails.

1. I have tried writing gliderecord in the mail script and make the CC in the emails calling the ${mail_script:Add_CC} in notifications

var user = new GlideRecord('sys_user');
user.addQuery("sys_id",'SYS_ID of the user record');
user.query();
while (user.next()) {
email.addAddress('cc', user.email, user.getDisplayValue());

2. I have hard coded the email address and tried adding email address in CC of emails using

email.addAddress("cc", "Email address", "Name");.

Both the results are working for me when I verified in the email logs but when I verified the notifications in outlook, they have received with out setting CC and it is blank.

Need help on how to resolve this issue.

1 ACCEPTED SOLUTION

If you can see the CC to the required email, then SNOW is copying the user in the email.

Check with Microsoft team and see if there is some issue to the users email in receiving emails from ServiceNow


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

View solution in original post

5 REPLIES 5

Mike Patel
Tera Sage

try below

email.addAddress('cc', user.email.toString(), user.getDisplayValue());

Ajay_Chavan
Kilo Sage
 

You just set the type, address you want to send and the address display name. You need to write this in the email scripts.

 

 

 

//email.addAddress(type, address, displayname);


email
.addAddress("cc","john.copy@example.com","John Roberts");

 

in your case as your querying the table and getting values put something like below:

email.addAddress('cc', user.email, user.getDisplayValue());

 

 

Mark this answer as correct if this resolves your issue

Glad I could help! If this solved your issue, please mark it as Helpful and Accept as Solution so others can benefit too.*****Chavan A.P. | Technical Architect | Certified Professional*****

Hi Ajay,

Thank you for the feedback. I have tried the same but I am unable to set the CC in outlook. When I verified email logs, I am able to see the CC to the required email 

If you can see the CC to the required email, then SNOW is copying the user in the email.

Check with Microsoft team and see if there is some issue to the users email in receiving emails from ServiceNow


Please mark my response as correct and helpful if it helped solved your question.
-Thanks