Group Email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 12:21 AM
Hi All,
I have requirement to send email notification to servicenow group members. That group does not have group email.
I need to keep that group in CC. how this can be achieved. Please share the solution if someone has implemented same kind of scenario.
Thanks,
Tara Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 12:46 AM
If there is no group email, the email will be send to all members separately, so you don't need to do anything for that. If it would have a group email and you also wanted to email the separate group members, you would need to tick the 'include members' checkbox.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 01:23 AM
Thanks for you reply. But how can I put group in CC if it does not have group email id? Ideally the syntax is
email.addAddress("cc", "Group Email ID", "GroupName") but in my case there is no Group Email ID.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 02:06 AM - edited 07-23-2024 02:08 AM
Hello @Tarasingh26 ,
You can write below script in the email notification script to get the user's email ID -
var member = new GlideRecord("sys_user_grmember");
member.addQuery("group","c38f00f4530360100999ddeeff7b1298"); //Replce group sys_id
member.query();
var list = [];
while (member.next()) {
list.push(member.user.email);
}
gs.info("Email " + list.toString());
// List contains comma seperated email address of group member.
email.addAddress('cc', list);
If my answer solves your issue, please mark it as Accepted ✔️and Helpful👍!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 03:43 AM
Hi, Thanks for your reply.
Code is working fine to print email addresses. Email address value is coming but seems like this line is not working to set email addresses dynamically, as copied field is blank in email logs.
email.addAddress('cc', list);