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
- Open the data point to monitor.
- Select Event detectors.
- Click +.
- 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
- Go to Event Management > Event handlers.
- Click +.
- Select the Email handler type.
- 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
- Set the point to a value that triggers the detector, if it is safe to do so.
- Otherwise, wait for a real event.
- Confirm the event appears on the Events page, filtered to the right event type.
- 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.logfor 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.rtnTimestampwith<#if evt.rtnTimestamp??>. - Use
<@subject>...</@subject>inside the custom template to override the subject.
Related Guides
- How to Configure Event Handlers: Email, Scripts, Set Points, and Process
- Guide to Event Detector Types in Mango