You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 53 Next »

Notification rules


Notification rules are used when you need to set up notification sending rules, depending on various conditions, or in the case of the event happened.

You can create new notification rules, or modify existing ones. To create a notification rule, please complete the steps below:

  1. Navigate to the System Notification - Notification Rules.
  2. Click New and fill in the form.
  3. Click Save or Save and Exit to apply changes.

Role required: notification_admin.

Notification rules form fields

FieldMandatoryDescription
NameYDisplayed notification name.
TableYChoose the target table for notifications. For example, if you are creating a notification for some Incident, then select the Incident table.
ActiveNSelect this checkbox if you need to activate this notification rule.
InheritedNSelect this checkbox if this notification rule should be applied to child tables of the selected table. For example, if you select the Task table, then this rule applies to the Incident, Problem, Change Request and other child tables of this table.
When to Send tab
ConditionNIn this field, you can specify a condition to meet before sending the notification. Use the Condition Builder to build a filter that will fit your needs the best.
Send whenY

The option-driven field providing the choice when the notification should be sent. Available choice options:

Record inserted or updated - when choosing this option, notification will be sent after record inserting or updating in the table specified. Relevant checkboxes must be marked.

Event is fired - when choosing this option, notification will be sent after an event is fired (see below),

InsertedNSelect this checkbox to send the notification when a record is inserted into the table specified in the Table field.
UpdatedNSelect this checkbox to send the notification when a record is updated in the table specified in the Table field.
EventYEvent is a special record used by the system to log when specified conditions met and to take some kind of action in response to the conditions. This field appears when the Event is fired option is selected in the Send when field.
Who Will Receive tab
UsersNIn this field, you can list the users who will receive the notification within this rule.
OtherNIn this field, you can add contacts to subscribe to the incident activities. It can be email-addresses separated by semicolon or comma (for example, user@domain.com; example@example.com, test@example.com), or it can be defined by notification variables.
Send selfN

Select this checkbox to send the notification to the person who initiate notification sending if the person in recipient list.

There are some nuances about this functionality:

  1. Emails with no recipient address populated (the To field is empty) are created with the Ignored state.
  2. A notification rule meeting the following criteria will create an email with the Ignored state:
    1. Send self attribute= False.
    2. The letter has one recipient, and he is a caller for this notification as well.
What Will Contain tab
SubjectNThe displayed notification subject. Notification variables and placeholders are supported there.
MessageNThe notification body in plain text. Notification variables and placeholders are supported there.
Message HTMLN

The notification template in rich-text format. This field supports HTML tags, placeholders, notification variables.

You can also use notification variables ${URI} and ${URI_REF} there. Their usage is described below.

Notification templateNSelect relevant notification template from the list.

Notification template


Notification templates are beneficial to pattern the notification process, being a very flexible tool; they provide a possibility to develop templates for different tasks and cases.

To create a notification template, please complete the steps below:

  1. Navigate to the System Notification → Notification Templates.
  2. Click New and fill in the form.
  3. Click Save or Save and Exit to apply changes.

Notification template form fields

FieldMandatoryDescription
NameYDisplayed notification template name.
SubjectY

Notification template subject. Notification variables and placeholders are supported there.

TableYIf the table is specified, then the template will be applicable only for this table; otherwise, it will be applicable for all tables.
Message HTMLN

The notification template in rich-text format. This field supports HTML tags, placeholders, notification variables.

You can also use notification variables ${URI} and ${URI_REF} there. Their usage is described below.

Message textNThe notification template in plain text format. Notification variables and placeholders are supported there.

Notification variables

Specify a notification variable using this syntax:

${variable-name.variable-parameters}


Notification variables form fields

VariableDescriptionExample
${current}This variable refers to the current record in the table specified.${current.caller} - for example, if this variable was used in the Notification Rule in the Other field in the Who will receive tab, then the notification will be sent to the caller (the originator of the issue).
${script}This variable runs the specified mail script developed by using the Notification Scripts functionality.${script:add_an_attachment}
${template}

This variable is used to link the notification template table (sys_notification_template) and the notification rule table (sys_notification_rule). When using it, you can stuff the template fields to the relevant notification rule fields.

${template.template_name} - for example, if this variable was used in the Subject field, then the subject line stored in the template will be applied to the relevant field.

${URI}

${URI_REF}

Display a link to the record.
URI: The link text is the unclickable link to the record.
URI_REF: The link text is the display value of the record.

${URI} Source: Click here to view the issue: ${URI}

${URI} Output: Click here to view the issue: https://api.simpleone.ru

${URI_REF} Source: Click here to view the inquiry ${URI_REF}

${URI_REF} Output: Click here to view the inquiry: INQ0005555

Scripting for notifications


Email scripts allow for business rule-like scripting within an outbound email message.

With them, you can change the email output of your system based on various criteria, Mail scripts allow performing simple tasks, such as displaying issue data, and the complex ones, like making advanced DB queries,

Add a ${script:script_name} embedded script tag to the notification rule or to related template record body. The fields below are available for the script embedding:

  • Subject
  • Message
  • Message (HTML)
  • Other

Adding embedded script tag allows using the same scripts in multiple email notifications or templates.

To create a notification script, please complete the steps below:

  1. Navigate to System Notification → Notification Scripts.
  2. Click New and fill in the form.
  3. Click Save or Save and Exit to apply changes.

Notification Scripts form fields

FieldMandatoryDescription
NameYDesirable script name for later usage in notifications and templates.
ScriptYEnter the mail script using SimpleOne server-side API, particularly, the SimpleEmailOutbound and SimpleTemplatePrinter classes.

To locate where notification scripts are used, perform search against the version list. For this, please complete the steps below:

  1. Navigate to Configuration Pack → Records.
  2. Click on the funnel icon on the top to open the Condition Builder.
  3. Create a filter containing the conditions listed below:
    1. JSON Copy CONTAINS script:script_name
    2. Table Name IS NOT sys_notification_script
    3. Is Current IS Yes.

In step 3a, specify your script name after the "script:" declaration. For example, "script:stop_notifications".

The selection example is given on the screenshot below.

  • No labels