e-mail script to use Parm 2 in cc - Need some help

Karthick PS
Tera Contributor

I am using the below e-mail script to use the Parm 2 values in  "CC" for e-mail notification.

 

email.addAddress("cc",event.parm2);

But, its not sending to "CC" in the e-mail.. Please help..

find_real_file.png

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

did you try sending the 3rd parameter as well i.e. display name?

If event.parm2 is sys_id of user then query it and include display name

if that is email then query user table with email and include display name

var gr = new GlideRecord("sys_user");
gr.addQuery("sys_id", event.parm2);
gr.query();
if (gr.next()) {
	email.addAddress("cc", gr.getValue("email"), gr.getValue('name'));
}

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

7 REPLIES 7

I wrote your query in the e-mail script and tried..

but..no

its still sending all the names in "TO"

no copied in CC.

 

Hi,

can you share complete screenshots etc of notification, email script etc

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hey. You are correct.

Sorry. It works now. Thanks