Inductive Automation
News Room

News / November 09, 2010

Create a Custom Alert E-mail

How-To Guide

Learn how to create custom automated e-mail alerts to be sent for specified alarms. Messages can then be retrieved via computer or phone, decreasing the response time to system events.

1) Open your project in the Ignition Designer.

2) For this example we need a single tag: alarm. In the SQLTags Browser panel expand the Tags folder. Let’s add the new DB SQLTag that will just be a memory value. In production you would use an OPC SQLTag. Right click on the Tags folder and select New Tag > DB Tag

3) Name the tag Alarm with a Boolean datatype and false as the default value.

4) Once created right click on the Alarm tag and select Edit Tag(s)

5) Set up this tag as an alert. Select the Alerting tab on the left hand side.

6) Change the Alert Mode to Digital as this is a digital alarm.

7) Change the Digital Properties to the following:

  Alert Name:   Bad State
  Severity:   High
  Time Deadband:   0 sec
  Alert if the value is:   Equal to - 1 / True

Those settings are saying the value is in alarm if it is equal to 1.

8) Below you will see the alert’s General Settings and Notification Settings. In the Notification Settings you can select the Message Mode: Auto-Generated or Custom. If you choose custom you can set the Subject and Body of the email to your own style using a combination of static text, tag values and alert properties. Change the Message Mode to Custom.

9) For the Subject and Body you can embed any of the alert properties or another tag’s value. To embed another tag’s value use the following syntax:

  {Path/To/Tag}

To embed alert properties use the following syntax:

  {[ALERT_PROPERTY_NAME]}

Here is a list of all of the alert properties you can use:

  {[TIME]}   The active timestamp of the alert
  {[VALUE]}   The active value of the alert
  {[STATE_NAME]}   The current alert state name
  {[ALARM_TYPE]}   User friendly alert state message, either “active”,
“clear”, or “acknowledge”
  {[ITEM_PATH]}   The path to the tag in SQLTags
  {[SEVERITY]}   The current alert severity, from 0 - 4
representing Low - High
  {[DISPLAY_PATH]}   The display path (will be item path if not configured)
  {[NOTES]}   The alert notes
  {[SYSTEM]}   The system the tag is executed in
(typically Ignition SQLTags)

For example make the Subject the following:

  {[DISPLAY_PATH]}   {[ALARM_TYPE]}   {[VALUE]}

Make the Body the following:

  Time: {[TIME]}
State Name: {[STATE_NAME]}
Notes: {[NOTES]}
SP1 Value: {SP1}

10) That’s it! You can customize the subject and body however you like for each individual tag. Now just set the value of the Alarm tag to true to see your custom email.

Note *: You must have an Alert Notification Profile configured to receive email alerts. These profiles are configured in the Ignition Gateway Configuration website.