jonnyseymour
ServiceNow Employee
ServiceNow Employee

In my past blog posts I have talked about notifications. I will discuss now how the notification option "weight" (and not the one you have to be on a diet) affects the outgoing notifications. Feel free to comment.


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.

winner1.png

Email notifications weight

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 behavior.

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

2015-09-02_1411.png

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.

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"

2015-09-02_1442.png

email weight.jpeg

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

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"

More information can be found here:

Question: What happen if both emails have the SAME WEIGHT, same target and same recipients?

Answer. It sends both.

8 Comments