email.addAddress("cc") is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2021 12:38 PM
We are trying to use email.addAddress() method for adding value to CC of email notification.
But it is not working.cc address is neither shown on copied field nor on headers field
When printing the value it is shown correct value
Please find the code below
email.addAddress("cc",current.opened_by.email.toString(), current.opened_by.getDisplayValue());
Thanks In advance
Vidyashree
- Labels:
-
Request Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2021 05:17 AM
Hello,
Yes, as you've now told us you're trying to do this in an email template...which helps everyone else see more information to assist you...
I hope my reply was Helpful in a few ways.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2021 11:54 PM
Hi,
I doubt setting cc, bcc works from email script when called from email template.
Did you check setting the subject using email.setSubject() and check if it works fine?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2021 12:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2021 01:47 AM
Hi Ankur,
Thank you for your reply.
email.setSubject is working fine and is displayed in the email sent.
email.addAddress() is working perfectly fine in my developer instance when given in email template but the same is not working in company instance.
Thanks,
Vidyashree
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2021 02:18 AM
Hi,
but as per documentation email object in client template is null so not sure how it worked in your PDI.
I would suggest to check once again
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader