111 views

Details

1. Email Notifications - "weight"

We normally use Email Notifications to send selected users email about specific activities in the system, such as updates to incidents or change requests.

One of the options is the 'weight'. The email notification with the highest weight is sent but only if the generated emails that are being compared have the same recipients and target table.

Email notification weight is defined as a required numerical value for this notification's priority relative to other notifications:

  • With the same target table and recipients
  • The system only sends the notification with the highest weight

All other notifications with lowest weight are moved from the Outbox mailbox to the Skipped mailbox. So far so good.

There is a 'Order' setting on the Email notification.   On my testing, 'Order' does not affect the behaviour.

The default value weight 0 causes the system to always send the notification (assuming the conditions are met).

image

Email notifications have great features that allow you to add priority to certain notifications over others. However, weight can be misunderstood.

Weight will not avoid duplicate notification ON MANY CASES as weight is considered based on the recipient list and target table.

2.How email notification "weight" option works

When the system is sending a notification:

  1. If an event is triggered (e.g. Issue is commented), the email notification matching the conditions will execute.
  2. Disregarding weight, if the notification condition passes and it generates valid recipients (emails), it generates an outbound email.
  3. If the outbound emails HAVE EXACTLY SAME 'Recipient' and 'Target', only the one with highest weight is sent plus any one with weight=0.
    The rest of the emails are marked as 'State'="Ignored"


image

image

On the email, the target and the recipients need to match so the weight is compared.

3.Testing how email notification "weight" option works

Let me run some examples:


Assuming the following notifications:


Name

Weight

Notification

T10

10

Notification

T20

20


EXAMPLE #1: Result outbound emails have same target and recipients but different weights

If after email notification execution:

Notification T10


it generates mail1 outbound email target:INC1 + recipients:t1@c.com + weight:10

Notification T20


it generates mail2 outbound email target:INC1 + recipients:t1@c.com + weight:20


RESULTS: It causes the following results:

Notification T10


mail1 'State'= "Ignored"

Notification T20


mail2 'State'= "Processed"

It is because 'Recipient' and 'Target' are the same, it takes the highest weight

Results: it will only sent ONE email. The one with highest weight,


EXAMPLE #2: Result outbound emails have same target but different recipients and weights

If after email notification execution:

Notification T10


it generates mail1 outbound email target:INC1 + recipients:t1@c.com,t2@c.com + weight:10

Notification T20


it generates mail2 outbound email target:INC1 + recipients:t1@c.com + weight:20

RESULTS: It causes the following results:

Notification T10


mail1 'State'= "Processed"

Notification T20


mail2 'State'= "Processed"

It is because 'Recipient' are different, it sent both.   NOTE it will create TWO EMAILS for 't1@c.com'

Results: it will sent both. The recipients did not matched.


EXAMPLE #3: One notification is not able to generate the outbound email

If after email notification execution:

Notification T10


it generates mail1 outbound email target:INC1 + recipients:t1@c.com + weight:10

Notification T20


it can't generate recipients so it can't create mail2


RESULTS: It causes the following results:

Notification T10


mail1 'State'= "Processed"

Notification T20


mail2 DOES NOT EXIST.

It is because it's the only one, it sent mail1 (even when in theory it should be Notification T20)

Results: It will sent the only email generated.

In conclusion, all email notifications with recipients will generate an email outbound (ready to be sent or not) and the weight is copied from the notification.

If there is not recipients for the email notification, no email is generated (and it is not because of the weight that emails are not generated).

Finally, if the email outbound is NOT sent because of the WEIGHT, it will be on the 'skipped' mailbox wit 'State' of "Ignored"


Additional Information

More information can be found here:

Email Resources Page (KB0540674)

Article Information

Last Updated:2020-06-22 08:17:21
Published:2020-06-22