Skip to content

Notification Templates

ExoSense uses templates for each type of notification sent by way of Email and SMS. This functionality allows customizing these templates used by the full solution.

Notification Templates are currently in an Early Access BETA state. Please contact Exosite's support for more information about getting early access to this new feature set.

  • Customize Solution Notifications


    Allows administrators to customize Email and SMS notification messages for the solution.

  • Language

    Support for customizing templates for each available language.

  • Source File


    Download the template source file to use as an archive and tracking edits in your own source control.

Notification Template Settings Notification Template Settings

Email Templates

Emails include both a subject and a body, both of which may be customized as separate templates.

Subject Template

[{{{Config.name}}} Notification] - {{{asset.name}}} - {{{rule.name}}}. 
[Example Application Notification] - Pump 1997 - Temperature Threshold

This subject template includes the name of the application, the name of the asset, and the rule name. This allows keeping a thread in most modern email clients specific to the asset and rule.

Body Template

An email body can use simple strings only or can include some HTML elements, as the default does.

<p>You are receiving a notification ✉️ message for {{asset.name}} in {{Config.name}}</p>

<p>Information:<br />
<ul>
<li>Asset: {{asset.name}}</li>
<li>Signal: {{signal.name}}</li>
<li>Rule: {{rule.name}}</li>
<li>State Change: {{getHash alarm.level 0='Normal' 1='Info' 2='Warning' 3='Critical' 4='error'}}</li>
<li>Last Signal Value: {{numberFormat alarm.value user.locale user.i18n.number_format signal}} {{unitAbbr signal.data_type signal.data_units}}</li>
<li>Time: {{moment date_time user.locale user.i18n.date_format user.i18n.format_12_hour_clock user.timezone}}</li>
<li>Link: <a href="{{asset.URL}}">{{asset.name}}</a></li>
</ul>
</p>
{{#if alarm.message}}
<p>
Message:<br />
<ul><li>{{alarm.message}}</li></ul>
</p>
{{/if}}

You are receiving a notification message for Pump 1997 in Example Application

Information:

  • Asset: Pump 1997
  • Signal: Temperature
  • Rule: Temperature Threshold
  • State Change: Warning
  • Last Signal Value: 52.590 °C
  • Time: 05/05/2024, 7:52:59 PM CDT
  • Link: Pump 1997

Message:

  • Please review immediately.

Best practices for Email content

This list is not anywhere close to being exhaustive for proper email format and content.

  • The emails need to abide by email specifications and use best practices for emails and email clients.
  • Basic html can be used such as lists. Recommend keeping it simple to lists, bold text, etc.
  • Image html links are generally not recommended and may not be delivered properly depending on the email client.
  • Subjects should be kept as simple and short as possible. Recommendation is it should be 78 characters or less but modern email clients can handler larger up to 998 characters.

SMS Templates

An SMS message is made up of simple strings plus variables.

{{{asset.name}}} - {{{rule.name}}} - {{getHash alarm.level 0='Normal' 1='Info' 2='Warning' 3='Critical' 4='Error'}}
{{#if alarm.message}}Note: {{alarm.message}}.
{{/if}}[{{Config.name}} Notification] - Login for more details.
{{moment date_time user.locale user.i18n.date_format user.i18n.format_12_hour_clock user.timezone}} {{signal.name}} : {{numberFormat alarm.value user.locale user.i18n.number_format signal}} {{unitAbbr signal.data_type signal.data_units}}

Pump 1997 - Temperature Threshold - Warning Please review immediately. [Example Application Notification] - Login for more details. 05/05/2024, 7:52:59 PM CDT Temperature : 52.590 °C

Best practices for SMS content

This list is not anywhere close to being exhaustive for proper sms format and content.

  • An SMS message should use simple strings plus variables.
  • Keep SMS messages short and to the point. Long messages may be sent as multiple SMS messages.

Template Syntax

The ExoSense notifications are a combination of strings, variables, and in some cases HTML (Email) The notification templates use a template language called Handlebars to allow using variables mixed in with the message strings and HTML. A list of available variables can be found below. Variables may be inserted into the templates using the syntax like {{ asset.name }}.

Why the extra brackets (3 sets {{{ }}} instead of 2) around some variables?

Using the extra set of brackets around variables (e.g. {{{ rule.name }}}) will ensure raw characters are included that may otherwise be "html-escaped". The Handlbars templating will by default html-escape characters in the variables such as & < > \" ' =. If an Asset Rule Name used one of these characters, you might see the message look like Temperature Threshold &gt; 50 even though you wanted Temperature Threshold > 50. Using {{{ rule.name }}} will ensure these are not formatted as html.

Variables

A list of available variables to use in your notification templates.

Variable
Description
{{asset.name}} This would insert the Asset's name for the triggering Rule.
{{asset.URL}} A full URL link to the Asset's dashboard.
{{signal}} The signal that triggered the rule.
{{signal.name}} The signal's name connected to the triggered rule.
{{signal.data_type}} The signal's data type connected to the triggered rule.
{{signal.data_units}} The signal's data unit connected to the triggered rule.
{{date_time}} The timestamp on the triggered rule status change.
{{rule.name}} This would insert the Rules's that triggered.
{{alarm.level}} A numeric value ( 0='Normal' 1='Info' 2='Warning' 3='Critical' 4='Error' ) representing the rule status change level. Note that the built-in timeout rule will specify a value of 3 for a timeout and 0 when returning from a timeout.
{{alarm.message}} If this optional string has been added to the Rule configuration, this string can be added based on the triggered rule.
{{alarm.type}} Will provide the function_id for a custom. For off the shelf rules this will be one of: timeout, threshold,boolean, isEqualTo, regexp, ArrayPointThreshold, NumberPointThreshold
{{alarm.value}} The last signal value that triggered the rule.
{{user.locale}} The locale information for the user the notification is being sent to.
{{user.i18n.number_format}} The preferred number format for the user the notification is being sent to.
{{user.i18n.format_12_hour_clock}} The preferred time format for the user the notification is being sent to.
{{user.timezone}} The timezone for the user the notification is being sent to.
{{Config.name}} The name of the solution.

Functions

Function
Description
getHash A hash look-up function to match a numeric value to a string, such as matching the alarm level to a string.
Example: {{getHash alarm.level 0='Normal' 1='Info' 2='Warning' 3='Critical' 4='error'}}
numberFormat Used to format signal value for user's preferences. Takes four parameters being: signal value, locale, numberFormat, and signal object.
Example: {{numberFormat alarm.value user.locale user.i18n.number_format signal}}
unitAbbr Used to get the signal unit string. Takes two parameters, the signal type and signal unit to provide the unit abbreviation string.
Example: {{unitAbbr signal.data_type signal.data_units}} would output ℃ if the signal's datatype was TEMPERATURE and unit was DEGREES_CELSIUS
moment Used to get a formatted timestamp. Takes 5 parameters being: timestamp, locale, dateFormat, format12HourClock, and timezone to provide a date time timestamp string.
Example: {{moment date_time user.locale user.i18n.date_format user.i18n.format_12_hour_clock user.timezone}}

Logic / Conditionals

Available built-in helpers for conditionally rendering a block.

If

Example of including a conditional if statement.

{{#if <variable>}} ...template block to render... {{/if}}