Trying to CC email address in notification

JJG
Kilo Guru

Hello,

I have an email notification that has the purpose of introducing a manager and a candidate. When the email sends, I would like both of them to receive the same email, with their email addresses CC'd so they can start to communicate together. Is this possible? What would that code look like? Thank you for any help.

1 ACCEPTED SOLUTION

Jim Coyne
Kilo Patron

Do the email addresses really need to be cc'ed?  Why not the "To" in the email?  As Michael Jones mentioned yesterday, if they are reference fields on the target record, you can just select the proper fields in the "Users/Groups in fields" field on the "Who will receive" tab.

The less scripting in the platform the better (although not always possible to avoid).

View solution in original post

17 REPLIES 17

I don't know if your gliderecord query is oke. You could ad gs.info there to validate.

Also, see my example about:
email.addAddress("cc",gr.requested_for.email,gr.requested_for.name);

So you need to pass "cc" + email + display value.
You now only are passing "cc" + manager_mail. So the third param is missing (or at least I successfully tested with using 3 params, cc + mail + display value).

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

+ just test, when having the "glide.email.test.user" system property set, the CC / BCC does not show.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Kunal Varkhede
Tera Guru

Hi JJG,

 

Yes, this is possible using Notification Email script.

you can add "CC" in email script and In Notification, who will receive section you can add Manager

1)In Email script you just write 

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

you can refer this doc

https://docs.servicenow.com/bundle/newyork-servicenow-platform/page/script/server-scripting/referenc...

 

2)In notification, What it will contain section you can call this mail script using following script

${mail_script:name of email script} 

so that when notification is triggered Manager and Candidate also get same notification.

 

Please Mark Correct/Helpful answer .

Thanks and Regards,

Kunal.

 

 

 

 

 

 

The manager is chosen from a select list on a record, is there a way to send his/her email as the cc based on who is selected?

Also, I implemented your code (see pics below) but it does not seem to work, am I missing something?

find_real_file.png

find_real_file.png

It does not show the other email that is supposed to be cc'd. I am using a personal dev instance, would that affect this?