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-29-2021 01:34 PM
Hello,
You didn't really tell us where you're using this script, but to throw it out there...you'd use this in a mail script.
Documentation for reference: https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/script/server-scripting/reference...
And so within the mail script you'd want to ensure that "current.opened_by.email" and "current.opened_by.getDisplayValue()" are appropriate to use. Please add any log statements to your mail script if you're unsure to see what you're getting back for these two pieces of information.
Once you've verified everything, you'd use:
${mail_script:name_of_mail_script} in the body of your notification, somewhere, and it'll run this script each time the notification is set to trigger and add to your CC recipients.
Please mark reply as Helpful/Correct, if applicable. 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:41 PM
Hi Allen,
Thank you for your reply.
Apologies for not providing complete information
Yes, i am using this in email script and calling it in email template. Email template is used in notification
I tried putting log and it is giving correct value in log but it is not added that value as cc

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2021 11:54 PM
Hi,
Can you please check and confirm 'send to event creator' checkbox is checked on your email notification?
Thanks,
Anil Lande
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2021 05:05 AM
Hi,
Did you checked this configuration which I suggested in previous reply?
Also try adding hardcoded email for testing.
Thanks,
Anil Lande
Thanks
Anil Lande