How to email email to all Group member in CC. in email Notification template .Please tell email script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2021 01:37 AM
How to send email to all Group member in CC. in email Notification .Please tell the Email script for that .
Please suggest .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2021 01:57 AM
Use this in your email script and include in your notification.
//email.addAddress(type, address, displayname);
email.addAddress("cc","group@example.com","group name");
check below link
Check below link on how to include email Script in notification
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2021 02:12 AM
you need to use email script and include that email script in the email body
${mail_script:addCCUsers}
Mail Script
Name: addCCUsers
Script:
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
// Add your code here
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group.name", "Group ABC"); // give here the group name
gr.addEncodedQuery("user.emailISNOTEMPTY");
gr.query();
while(gr.next()) {
email.addAddress("cc", gr.user.email, gr.user.getDisplayValue());
}
})(current, template, email, email_action, event);
If your notification is on the table which holds group then update the query as this
gr.addQuery("group", current.assignment_group);
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
06-10-2021 03:21 AM
Thank you for marking my response as helpful.
If my response helped you please mark it correct to close the question so that it benefits future readers as well.
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
08-09-2021 02:07 AM
Thank you for marking my response as helpful.
If my response helped you please mark it correct to close the question so that it benefits future readers as well.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader