Adding CC in Workflow notification?

niveditakumari
Mega Sage

How to add CC into the workflow notification?

Can anyone please help me in this?

 

 

Thanks In Advance

Nivedita

1 ACCEPTED SOLUTION

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

use the following mail script in workflow notification activity message to achieve that:

<html>
<body>
<mail_script>
email.addAddress("cc","test@test.com");
</mail_script>

If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

 

View solution in original post

27 REPLIES 27

Service_RNow
Mega Sage

Hi,

try to below code:

<mail_script>

      email.addAddress("cc",current.caller_id.email,current.caller_id.getDisplayValue());

</mail_script>

 

Thanks

mark it as correct/helpful,if you find it helpful.

I have done the same thing.

Below is my code :

find_real_file.png

 

Please correct me I am doing anything wrong?

 

Thanks In Advance

Nivedita

Hi 

Try passing the third paramter to email.addAddress("cc","email","displayValue")

Hello 

How to write third parameter like my mail address in CC should be "xxx@gmail.com" then how to write display value for this in third parameter?

 

Thanks in Advance

Nivedita

Ajaykumar1
Tera Guru

Hi Nivedita,

Create an email script under Notification email script module(For demo I created with name "community") and added below code in it.

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action, 
/* Optional GlideRecord */ event) {

// Add your code here
template.print("Community Email Script Executed....");

email.addAddress("cc", "XXXX@gmail.com");


})(current, template, email, email_action, event);

 

Now I created a new notification under System Notifications > notification which will get triggered when an incident is inserted.

and added my one email address in who will receive and under what it will contain : 

Hello, This is demo.

${mail_script:community}

It's working for me.

 

Please check the spam folder for received cc email address.

Mark If correct/Helpful,
Regards,

Ajay