How to set CC with email content

Mi4
Tera Expert

Hi,

Is it possible to set sender in CC with email content?

find_real_file.png

I am trying to set notification as a task in a lifecycle event.

Regards,

1 ACCEPTED SOLUTION

Alok Das
Tera Guru

Hi,

You need to create a email script and define the user you want to set as cc in email and then call the email script from the notification.

Steps to create Email Script and how to use:

  1. Navigate to the "Notification email Script" in the "System Notification" in filter navigator.
  2. Set the name of email notification "add_newusers_to_cc".
  3. add below code in the script:
 email.addAddress("cc","email_address_of_the_user","Name_of_ther_user");
//if you want to push the user dynamically then you can use the scripting to validate and push the user.

4. Now navigate to the notification where you want to add cc.

5. add "${mail_script:add_newusers_to_cc}" in "Message HTML" field in "What it will contain" form section of notification.

Kindly mark my answer as Correct and helpful based on the Impact.

Regards,

Alok

 

 

View solution in original post

19 REPLIES 19

Harsh Vardhan
Giga Patron

you can use email script here and then call email script in notification body. 

 

sample code:

 

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

 

https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/script/server-scripting/concept/...

Hi,

Sorry for the rudimentary.

Where can I put the text?

Does that mean include it in the script?

Regards,

you will first create email script 

email.addAddress() here you will define the person address which you wanna set in cc. 

 

then you will use below line in email script and save that. 

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

 

 

 now go to your notification use email script in notification body 

${mail_script:mail_script_name}

 

 

for setting the dynamic user in cc sample code below. 

 

find_real_file.png

 

in notification you will pass 

 

${mail_script:custom_cc}