Create an Email integration
You can obtain an email address through either of these two methods:Use a dedicated integration
Choose this option if all alerts go to one channel. It’s the simpler setup.View dedicated integration setup steps
View dedicated integration setup steps
- In the Flashduty console, select Channel and open a channel
- Select Configuration → Integrations → Private integration, then click Add integration, and enter the integration page
- Choose Email integration, click Save to generate a card
- Click the generated card to view the Email Address, copy it for later use, and you’re done
Use a shared integration
Choose this option if you need to route alerts to different channels based on the alert payload.Configure the Email integration
1
Save the integration and copy the email address in Flashduty
Where: Flashduty › Integration Center › Alert events › Email › Receive › How emails become alerts › Receiving addressThe system generates a unique email prefix. You can change it:
The prefix can’t contain uppercase letters: incoming mail is matched to the integration by the recipient address as written (case-sensitive), and some sending systems lowercase the address, so a prefix with uppercase letters would receive nothing.The address takes effect only after you click Save: before you save (or while the integration is disabled), mail to this address is rejected and the sender gets a 553 bounce. After saving, copy the full email address. For a new integration, question 1 defaults to Merge when the subject is identical; adjust it in step 4 once a real email has arrived. An existing integration saved without a push mode behaves as Every email is a new alert.
2
Add the address as an alert recipient in the sending system
Where: the alert notification settings of the sending system (menus vary by system)In the alert notifications of your monitoring system, cloud service, or script, add the email address from the previous step as a recipient. If the system has a dedicated Flashduty integration (for example Prometheus, Zabbix, or Grafana), use that instead: a dedicated integration reads the alert severity and recovery status, while email alerts always have Warning severity.
3
Send a test email from the sending system
Where: the test option in the sending system’s alert notification settings (if there’s no test option, wait for a real alert email)Send an email in the same format as your real alerts, because you’ll select part of its subject in the next step. When it arrives, it shows up under Email source › Received in the Try an email panel, and the integration shows a Latest event time.
4
Answer two questions on a real email in Flashduty
Where: Flashduty › Integration Center › Alert eventsIn the integration list on the right, open your email integration (type Email) and go to the Receive tab; answer the two questions below in Simple mode of the How emails become alerts card.Question 1: How should emails about the same problem be grouped?
After choosing Identify by part of the subject:Email source in the Try an email panel offers three ways to try an email: Received (mail the integration received; discarded ones are marked “Discarded”), Upload .eml (a raw email exported from a mailbox, up to 5 MB, parsed the same way as a received email), and Paste (fill in the subject, body, and sender). Upload .eml and Paste work before the integration is saved, so you don’t have to wait for a real email first; to export a raw email use Gmail’s ”⋮ → Download message”, Outlook’s “Save as”, Apple Mail’s “File → Save As → Raw Message Source”, or QQ Mail / Foxmail’s “Export .eml”. What you copy out of a mailbox is the rendered body, not the original HTML, so conditions on Email content are only reliable against Received or Upload .eml.
- Pick the email you received in the previous step under Email source
- Drag across the part of the subject that identifies the problem, for example host plus check
web-01 disk. Leave out status words such asPROBLEMandRESOLVEDand values that change every time - The system generates a regex with exactly one capture group, for example
: (.+?) usagewhen you highlightweb-01 diskinPROBLEM: web-01 disk usage 93%, and checks that it captures the same text from the trigger email and the recovery email. The regex is shown after Generated regex; click Edit regex to adjust it if needed
When entering keywords:
- Keywords are case-sensitive: type them exactly as they appear in the recovery subject;
Resolveddoesn’t matchRESOLVED. When the system recognizes a Zabbix, Nagios, Grafana,【告警】, oris downsubject, it pre-fills the keyword in the subject’s own case; for Grafana’s[RESOLVED]it pre-fillsRESOLVED - Keywords can’t contain
*?.+()[]{}|^$\: a keyword is saved as the subject condition*keyword*, and these characters change what it matches;[RESOLVED], for example, would match almost every subject
5
Check that trigger and recovery emails match in Flashduty
Where: Flashduty › Integration Center › Alert eventsIn the integration list on the right, open your email integration (type Email) and go to the Receive tab. The lower part of the Try an email panel on the right is Pair check with a recovery email (shown when question 1 is Identify by part of the subject).The email above is the trigger email. Under Pick a recovery email, pick or paste a recovery email. The system runs both emails through the settings on the page, including unsaved changes:
- Both get the same Alert Key: the recovery email closes the alert, and you’re done.
- The keys differ, or the recovery email matches no close rule: the page shows why and what was captured from each email. Go back to questions 1 and 2 and adjust the highlight, the regex, or the keywords.
How rules work
Your answers to questions 1 and 2 are saved as one trigger rule and one close rule:
Setup style at the top right of the How emails become alerts card switches to Rules (full), where you edit the underlying rules directly (rule type, filters, Alert Key source field, and regex). Rules of existing integrations show up there as they are. When the rules go beyond what Simple can express (for example several trigger rules, conditions on the email body, or a key taken from the body), Simple is unavailable, hovering it says “These rules go beyond what Simple can express”, and you can only edit in Rules (full) — answering the two questions in Simple does not rewrite them.
- Close rules are checked before trigger rules; within each type, rules are checked in the configured order, and the first match wins.
- The Alert Key regex must be a valid RE2 expression and may be written as
/…/. It is validated on save; an invalid expression is rejected with the message “Please enter valid regex”. The regex must also have at least one capture group: without parentheses it cannot be saved either, and the message is “Wrap the part to extract in parentheses; the regex has none.” Where a fix can be derived, the page also shows the corrected expression after Change to, and Apply adopts it. At least one trigger rule is required. - The Alert Key is built from the regex capture groups, joined with
,. If the regex captures nothing, the system builds the Alert Key from the email subject, so a bad rule doesn’t lose alerts; that fallback covers a regex with parentheses that didn’t match a particular email, and a regex without parentheses can no longer be saved. - The Alert Key can be extracted from the email subject or the email body.
- When no rule matches, the Other emails choice applies: create an alert (Alert Key built from the subject) or discard the email.
Why /(.*)/ can’t be used as the Alert Key regex
/(.*)/ captures the whole subject. The trigger email PROBLEM: web-01 disk usage 93% and the recovery email RESOLVED: web-01 disk usage 71% have different subjects and so get different Alert Keys. The recovery email finds no matching alert, and the alert is never closed.
Capture only the part that identifies the problem. For the two emails above, use:
web-01 disk and get the same Alert Key. Add a close rule “subject contains RESOLVED”, and the recovery email closes the alert the trigger email created.
No-event detection
Where: Flashduty › Integration Center › Alert events In the integration list on the right, open your email integration (type Email) and go to Receive and find the No-event detection card. The No-event detection card creates a Warning alert when no valid event arrives within the set time. Its switch is at the right of the card’s title row and is off by default; when off, the card is a single row with no other options. When it is on, the card shows these options:Important notes
- The system rejects emails larger than 5MB.
-
If the email text exceeds 128 KiB, the system truncates it and adds a label in the incident details:
-
If the email contains attachments, the system discards them and adds a label in the incident details:
-
For new alerts triggered by email, the title is the email subject, and the description is the email content. The sender is in the
fromlabel. For HTML emails, the plain-text content is in thebody_textlabel; a condition on Email content matches the HTML source of the body (tags included), while an Alert Key extracted from the body is looked for in the plain text first and in the HTML source after that. - Emails kept for the try-out keep only the first 8KB of the body. If a rule extracts the Alert Key from the body and the text it needs comes after 8KB, the preview may differ from the real result; the page shows a warning.
- If you modify your account domain, this email address also changes, so remember to update it in the sending system.