- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 03:04 AM
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..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 03:17 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 03:17 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 03:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 03:37 AM
then write query as I mentioned
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 03:51 AM
Ok.
You mean in the E-mail script??