Prevent duplicate emails for users in multiple groups

Ace009
Tera Contributor

We have a requirement where we send emails to a lot of users. This also includes groups. Because we're sending to a lot of users/groups at a time, the emails are sent in chunks of 100. The problem is, the groups are mixed in with these batches. So if a user is in say, 2 groups and each group is in a different batch, they're getting the email multiple times (the groups have a group email so SN sends it to the group alias instead of the individual members).

 

Currently, we're using the OOTB email client to send these emails and not via workflow so all of the logic is OOTB. This is because it gives the email senders flexibility in changing the body of the email before sending it. I can move the logic to a workflow (ie where I have full control of the batches of emails) but in return theyll lose the ability to modify the body of the email. The rougher approach is creating my own email client or basically some sort of UI page that will mimic the functionality of the current email client.

 

Anyone else have a better or more OOTB approach?

2 REPLIES 2

Robbie
Kilo Patron
Kilo Patron

Hi @Ace009,

 

A couple of clarification points... Is it exactly the same email (notification record) that is being sent (based off of the same event for example), or is it based on different events (for example of a comment being added, and then the record being updated which is triggering the notification) ?

 

Something to consider if it's a 'different' notifications is the by leveraging something that's not well advertised when it comes to notifications - the 'Weight' column. This is defaulted to 0 which essentially means the notification is always sent, however, when a weight is assigned, the notification with the highest weight is sent but only if the generated emails that are being compared have the same recipients and target table.

 

Check the below link for further details on weighting.

 

The other thing that jumps out at me is the fact you mentioned using the group alias. ServiceNow cannot control this as it would be controlled by the emails service such as exchange

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.


Thanks, Robbie

 

Email weighting:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0829694

Ace009
Tera Contributor

Hi Robbie!

We're using the Email Client (https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0647561) . The email is not triggered by any sort of automated logic (ie comments or ticket submission). It's sent via manual trigger where a user clicks a UI action to display the Compose Email page.

 

Let's say we have 500 unique users in the To line. When the email is sent, it's sent in 5 different emails (same email contents). This is based off of glide.email.smtp.max_recipients property which is default 100. 

 

Just some clarification (and making sure Im using the same terminology as you are!). The groups have an email alias associated with them. So instead of sending the emails to the individual group members, SN just sends to the email alias instead (ie GroupB@gmail.com  ).


The issue comes when we include groups. Say the user is in GroupA and in GroupB and we have 5 email batches because 500 entries of both users and email aliases. GroupA could be in Batch1 and GroupB could be in Batch2. The user would then get 2 emails (3 if the user is also listed as a user to receive the email and that email is in a different batch).

 

Im not familiar with the weighting feature so Im going to take a look.