Alarm email
The alarm email connector sends an email when an alarm changes state. It is added to a runtime like any other connection, and one runtime can hold several of them — for example one for the shift supervisors and one for maintenance, each with its own recipients and filters.
The device sends the emails
Section titled “The device sends the emails”The device sends the emails itself, directly to the SMTP server you configure. Two consequences follow, and both decide whether a configuration can work at all:
- The device must reach the SMTP server on its own network. The cloud does not relay the emails, so a server that is only reachable from the cloud, or only from your workstation, will not do.
- Emails are still sent while the device has no connection to the cloud. Alarm notification does not depend on the cloud link.
Add a connection
Section titled “Add a connection”- Open the runtime in the project tree.
- Choose Add email connector.
The connection is created immediately and appears under the runtime. It is disabled to begin with, because an SMTP server and at least one recipient are only required once a connection is enabled, and a new connection has neither. Configure it, then enable it.
Use Edit on the connection to change its name and to switch it on or off. Delete removes it.
The pages have no Save button of their own. They are saved like every other node of the project: with the project’s Save button, or Ctrl+S. A page with unsaved changes is listed as modified until then.
Connection page
Section titled “Connection page”Opening the connection shows how it sends:
- SMTP server — host, port, encryption, user name and password, sender address and an optional reply-to address. The user name and the password belong together: set both or neither. The host is the address the device resolves and connects to, not one reachable only from the cloud or from your workstation — the device sends the emails itself and the cloud does not relay them.
- HMI base URL (optional) — the address the links in an email point at, and the value the
{{hmiLink}}placeholder is replaced with. Without an HMI base URL the emails contain no links at all, including no Acknowledge and no Disable/Close link. - Maximum emails per minute — an upper bound on how many emails this connection sends, so an alarm storm cannot flood the recipients.
- Test email — sends one email through the stored configuration, so you can confirm the SMTP settings before relying on them. It uses what is saved, not what is currently on screen, so save first.
Password
Section titled “Password”The stored password is never shown. The field offers three choices:
- Keep the stored password — the save leaves it untouched.
- Change it — the password you type replaces the stored one.
- Remove it — the stored password is deleted when you save.
Targets
Section titled “Targets”A connection has two children: Targets and Templates.
Targets holds who is written to and which alarms qualify: the recipient addresses, an optional list of alarm uid patterns, the minimum priority, and the transitions (raised, acknowledged, returned to normal, closed) that produce an email.
Recipients and uid patterns are tables — use the + beside the column title to add a row, and the delete button on a row to remove it.
Templates
Section titled “Templates”Templates is the sibling of Targets and holds how an email is worded.
A template belongs to one transition and either one priority or any priority, so a critical alarm can be worded differently from a low one.
The list on the left shows every combination — the five transitions, each with Any priority and the four priorities. A transition is a group you can collapse; the groups you notify on, and any that already hold a template, start open, the rest start closed. A closed group shows how many templates it holds.
Every transition you notify on starts with its Any priority template ticked, so no transition is ever left without one. You can tick a different row instead — one or more specific priorities — but each notified transition must keep at least one template ticked; the page refuses to save otherwise and marks the group that is missing one.
Tick a row to put that combination’s template in use; it starts as a copy of the built-in one, already coloured for that priority. Click any row to open its template in the editor, with the preview beside it — drag the bar between them to give one more room. Opening a row that has no template seeds one for it and leaves it unticked, so looking never changes what the device sends; a seed that is neither edited nor ticked is discarded when you save.
Untick a row to switch its template off. The template is kept rather than deleted — tick the row again and your subject and body come back exactly as you left them — and while it is off the combination behaves as if it had no template, falling back the usual way. Unticking never asks, because nothing is thrown away.
Two buttons sit on every row that has a template: reset puts the built-in body back, and the bin deletes the template for good. Both discard what you wrote, so both ask first when you have edited the subject or the body — the form has no undo before the project is saved.
A row that the device cannot use shows what it sends instead: any priority when the transition has an enabled Any-priority template, otherwise built-in. A row whose template is switched off reads off, built-in or off, any priority.
Which template the device uses. It takes the template for the alarm’s priority and transition; failing that, the template for any priority; failing that, its own built-in English template. A template that is switched off is skipped at every step, exactly as if it were not there.
Transitions you did not select in Targets are listed last and marked not notified. A template there is kept but never used.
You write the HTML body; the plain-text part of the email is generated from it, so there is no separate text body to maintain.
Placeholders
Section titled “Placeholders”Write {{name}} to insert a value. {{#name}}...{{/name}} shows its content only when the value is not
empty, for example:
{{#ackLink}}<a href="{{ackLink}}">Acknowledge</a>{{/ackLink}}Unknown names are replaced by nothing. In the HTML body the device escapes every value, so an alarm text cannot inject HTML.
| Placeholder | Value |
|---|---|
{{uid}} | Unique identifier of the alarm |
{{text}} | Alarm text |
{{priority}} | Priority name: Critical, High, Medium or Low |
{{category}} | Category: Safety, Process, Equipment, Quality or Maintenance |
{{area}} | Plant area of the alarm |
{{state}} | Alarm state, for example “Active, unacknowledged” |
{{transition}} | RAISE, RTN, ACK, SHELVE or CLOSE |
{{value}} | Process value when the event occurred |
{{limit}} | Configured limit |
{{unit}} | Engineering unit |
{{raisedAt}} | Time the alarm was raised (RFC 3339, UTC) |
{{ackAt}} | Time the alarm was acknowledged (RFC 3339, UTC), empty if not acknowledged |
{{closedAt}} | Time the alarm was closed (RFC 3339, UTC), empty if not closed |
{{deviceName}} | Name of the device |
{{projectName}} | Name of the project |
{{hmiLink}} | Link to the alarm page of the HMI (needs the HMI base URL) |
{{ackLink}} | Link that opens the HMI and asks to acknowledge the alarm (only when available) |
{{closeLink}} | Link that opens the HMI and asks to disable/close the alarm until its condition clears (only when available) |
Styling and a logo
Section titled “Styling and a logo”The body is ordinary HTML, so a template can carry your own styling. Two constraints come from email clients rather than from logiccloud, and both are worth knowing before you spend time on a design:
- Stack the content in one column. Outlook on Windows renders with Word’s engine, which supports
neither flexbox nor grid and treats
floatandmarginunreliably. A column ofdivs renders the same everywhere; only side-by-side columns still need a table. Keep the body at about 600px wide, which is what an Outlook reading pane shows. - Put every rule in an inline
styleattribute, not in a class. The body you write is the whole HTML part of the email, so a<style>block in it is sent as well and classes do work in some clients. They cannot be relied on: Gmail strips<style>in several contexts, Outlook.com rewrites class names, and Outlook on Windows ignores most selectors. Anything that must be seen belongs in astyleattribute on the element; keep a<style>block for refinements you can afford to lose.
The template a new entry starts from already follows both, so it is a working example to copy. It also carries an HTML comment above every line saying which placeholder that line shows, so you can read it without this page. The comments are not visible to a reader: no email client shows them, and the plain-text version of the email is derived from the HTML with the comments removed.
Colour by priority
Section titled “Colour by priority”A template that is restricted to one priority starts with its header bar and its Priority line in the colour of that priority — the same four colours the HMI alarm components use:
| Priority | Colour |
|---|---|
| 1 Critical | red #d32f2f |
| 2 High | orange #f57c00 |
| 3 Medium | amber #fbc02d |
| 4 Low | green #388e3c |
A template set to Any priority cannot do this. The device replaces {{priority}} with the priority
name, and the template language has no way to react to that name, so such a template is seeded in the
neutral blue instead. To get coloured emails, add one template per priority.
A template keeps the body you gave it, so the colours do not follow a later change. The reset button on the template’s row replaces the subject and the body with a freshly coloured built-in one, keeping the priority and transition the template applies to. That button is also how you bring a template saved before this layout in line: it drops the old table body and any Acknowledge or Disable/Close link it carried.
A logo goes in with an ordinary image tag:
<img src="https://example.com/logo.png" alt="Example GmbH" width="160" style="display:block;border:0;">Three things decide whether it appears:
- The URL must be reachable by the person reading the email, not by the device. A logo on a plant-internal server will not load for someone reading on a phone, so host it somewhere public.
- Outlook and Gmail block remote images by default until the reader allows them. Always set
alt, and make sure the email still reads correctly with no images at all. data:URIs do not work — Outlook and Gmail both block them. Embedding an image in the message itself (acid:reference) is not supported: the device sends amultipart/alternativemessage with a text and an HTML part, and no attachments.
Links in an email
Section titled “Links in an email”When an HMI base URL is set, an email can carry an Acknowledge and a Disable/Close link. Both open the HMI at that address.
Both are in the email by default: the built-in template and the template a new entry starts from carry them below the Open in HMI link, as buttons.
Each is wrapped in its own section, so a link only reaches a recipient when the matching action is allowed on the connection page and the alarm is in a state where it applies — a closed alarm carries neither. To drop one, delete its section from the body:
{{#ackLink}}…{{/ackLink}}{{#closeLink}}…{{/closeLink}}Opening a link never performs the action. The HMI asks the operator to confirm it after login. A link for an older occurrence of the alarm is rejected, so an email that has been sitting in an inbox cannot acknowledge a later occurrence. Disable/Close ends the current occurrence; the alarm stays closed until its condition clears.
Requirements
Section titled “Requirements”The connector is shown only while the project’s alarming is enabled. A disabled connection keeps its settings and sends nothing.