20,919,685Total Points24,106Total Sites23,382Cell Towers69,500Racks Monitored56,753HVAC Units Monitored31,322UPS Units Monitored24,788Generators Monitored20,919,685Total Points24,106Total Sites23,382Cell Towers69,500Racks Monitored56,753HVAC Units Monitored31,322UPS Units Monitored24,788Generators Monitored20,919,685Total Points24,106Total Sites23,382Cell Towers69,500Racks Monitored56,753HVAC Units Monitored31,322UPS Units Monitored24,788Generators Monitored

Chapter 5: Events & AlarmsLesson 28 of 65

Configuring Event Handlers and Email Alerts

How to set up event detectors on data points and configure email notifications so you get alerted when values go out of range.

  • 8 min read
  • Beginner
  • Mango 4.x / 5.x

Overview

Mango by Radix IoT’s event system monitors points for conditions such as high temperature or lost communication and can respond by sending email alerts. This guide covers the complete path from SMTP configuration through event detectors, email handlers, escalation, testing, and custom FreeMarker templates.

Prerequisites

  • A running Mango 4.x or 5.x instance
  • Administrator access to system email settings
  • A working SMTP account
  • A data point to monitor
  • Email addresses for alarm recipients

Step 1: Configure the Email Sender

Go to Administration > System settings > Email settings and enter the SMTP details.

Field Gmail Example Microsoft 365 Example
SMTP host smtp.gmail.com smtp.office365.com
SMTP port 587 587
“From” address alerts@yourcompany.com alerts@yourcompany.com
Username your-email@gmail.com your-email@company.com
Password App Password Account password
TLS Enabled Enabled

Click Send test email to verify the configuration. It goes to the address on your own user profile, not to a recipient you choose.

Warning

Gmail requires an App Password rather than your regular password. Enable two-factor authentication, then create an App Password under Google Account > Security > App Passwords.

Step 2: Create an Event Detector

  1. Open the data point to monitor.
  2. Select Event detectors.
  3. Click +.
  4. Choose a detector type and configure its condition.
Detector Type Use Case
High limit Alert when a value exceeds a threshold
Low limit Alert when a value drops below a threshold
State Alert when a Binary or Multistate point sits in a chosen state (When state is / When state is not)
Change Alert on any change of value
State change count Alert when a point changes more than N times in a window
No update Alert when a point stops receiving data
No change Alert when a value remains unchanged too long

For example, a high-temperature detector could use:

  • Type: High limit
  • Limit: 85
  • Duration: 30 seconds
  • Alarm level: Urgent

The duration prevents a brief spike from immediately raising an alarm.

Tip

The table above is the common subset. Mango also ships Analog range, Binary state, Multistate state, Multistate bit, Alphanumeric state, Alphanumeric regex state, Analog change, Positive CUSUM, Negative CUSUM, Smoothness and Point value update — see Guide to Event Detector Types in Mango.

Step 3: Create an Email Event Handler

  1. Go to Event Management > Event handlers.
  2. Click +.
  3. Select the Email handler type.
  4. Link the handler to the event detector.

Recipients

Add the addresses that should receive active-alarm notifications. You can also add escalation recipients who are notified if the event is not acknowledged within the configured delay.

Escalation adds recipients and notifications over time. It does not limit notification frequency.

Email Content

  • Subject: Choose whether the normal subject uses the handler name or event message. A custom template can override it.
  • Body: Use the built-in content or supply a custom FreeMarker template.
  • Include previous point values for point events: include recent readings for immediate context.

Tip

Including the last 5–10 values is useful for intermittent problems because recipients can see the trend leading up to an alarm without opening Mango.

Step 4: Test the Setup

  1. Set the point to a value that triggers the detector, if it is safe to do so.
  2. Otherwise, wait for a real event.
  3. Confirm the event appears on the Events page, filtered to the right event type.
  4. Confirm the email reaches the intended recipients.

Customizing Email Content

Custom email templates use FreeMarker syntax. Variables use ${...}, directives use <#...>, and Mango macros use <@...>. Double-curly-brace syntax such as {{evt.message}} is not valid for these templates.

Custom Subject

Inside a custom template, <@subject> overrides the handler’s normal Subject setting. It can accept message=, key=, or value=, or contain body content between opening and closing tags.

This example customizes both subject and body:

<@subject><@fmt message=evt.alarmLevel.description/> ALARM: <@fmt message=evt.message/></@subject>

<@fmt message=evt.message/>

Triggered: ${evt.activeTimestamp?number_to_datetime?string["yyyy/MM/dd HH:mm:ss"]}
<#if evt.rtnTimestamp??>
Returned to normal: ${evt.rtnTimestamp?number_to_datetime?string["yyyy/MM/dd HH:mm:ss"]}
</#if>

<#if renderedPointValues??>
Recent values:
<#list renderedPointValues as renderedPvt>
${renderedPvt.value} @ ${renderedPvt.time}
</#list>
</#if>

This is an automated message from Mango.

For an urgent high-limit event, the rendered message might resemble:

Subject: Urgent ALARM: RTU-01 Temperature has exceeded 85.0°F for more than 30 seconds

RTU-01 Temperature has exceeded 85.0°F for more than 30 seconds

Triggered: 2026/08/21 14:32:07

Recent values:
81.4°F @ 2026/08/21 14:31:07
83.9°F @ 2026/08/21 14:31:22
86.2°F @ 2026/08/21 14:31:37
89.7°F @ 2026/08/21 14:31:52
92.3°F @ 2026/08/21 14:32:07

This is an automated message from Mango.

The return-to-normal line is absent while the event is active because evt.rtnTimestamp is null. The <#if evt.rtnTimestamp??> guard prevents the template from trying to format a missing timestamp.

Variable Description
evt.message Event message; render with <@fmt message=evt.message/> for localization
evt.activeTimestamp Epoch time when the event became active
evt.rtnTimestamp Epoch time when the event returned to normal; absent while active
evt.alarmLevel.description Translatable alarm-level description; render with <@fmt .../>
renderedPointValues Recent readings in a text template, available when Include previous point values for point events is enabled
renderedHtmlPointValues The same readings in an HTML template. Mango’s own templates use two different names — renderedPointValues in text/include/eventData.ftl and renderedHtmlPointValues in html/include/eventData.ftl

Warning

The recent-values variable is named differently in each part, and getting it wrong fails silently. The example above is a plain-text template, so it uses renderedPointValues. In an HTML template that name resolves to nothing, the <#if ...??> guard is simply false, and the recent-values block renders as nothing at all — no error, no output. Use renderedHtmlPointValues there, or test both parts before you rely on it.

Note

If the handler’s Content type is HTML and text, Mango uses the same template for both parts. Include HTML markup when HTML formatting is required — and note that the variable caveat above applies to that combined template too.

Verification

  • Send test email succeeds.
  • The detector raises an event after its configured duration.
  • Active-alarm recipients receive the message.
  • Escalation recipients are added only after the escalation delay.
  • Custom templates render ${...} expressions and the <@subject> directive correctly.
  • Return-to-normal content appears only after the event returns to normal.

Troubleshooting

Emails Are Not Sending

  • Review Administration > System settings > Email settings.
  • Use Send test email.
  • Check ma.log for SMTP errors.
  • Confirm outbound firewall access to the SMTP port.

Too Many Emails

  • Add a duration to the detector to filter short-lived noise.
  • Review escalation entries. Each escalation can add recipients and messages after a delay, increasing volume.
  • Establish an alarm acknowledgment workflow.

Detector Does Not Trigger

  • Verify the threshold and duration.
  • Confirm the point is receiving values.
  • Check the detector’s Alarm level. There is no “None” option — the lowest ordinary level displays as Minor, and it does raise events. The two that stop an email are Do not log and Ignore, which sit below Minor in the list.

Template Fails to Render

  • Use FreeMarker ${...}, not {{...}}.
  • Use <@fmt message=.../> for translatable messages.
  • Guard evt.rtnTimestamp with <#if evt.rtnTimestamp??>.
  • Use <@subject>...</@subject> inside the custom template to override the subject.
  • How to Configure Event Handlers: Email, Scripts, Set Points, and Process
  • Guide to Event Detector Types in Mango

Get free access to all 65 Mango by Radix IoT training lessons

One short form unlocks every lesson and its video in this browser.

This form is hosted by Zoho. It loads only after you enable support cookies or choose to load it below.

We honored your browser’s Global Privacy Control signal — optional cookies are off and nothing is tracked.