> ## Documentation Index
> Fetch the complete documentation index at: https://test-8ad8522e-feat-ai-sre.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Email Integration

> Generate a unique email address in Flashduty to synchronize alert triggers and recoveries through email

Generate a unique email address in Flashduty to synchronize alert triggers and recoveries through email.

<div class="hide">
  ## Steps

  ***

  ### Create Email Integration

  You can obtain an email address through either of these two methods:

  #### Using Private Integration

  Choose this simpler option when you don't need to route alerts to different channels.

  <details>
    <summary>Expand</summary>

    1. Go to the Flashduty console, select **Channel**, and enter a channel's details page
    2. Select the **Integration** tab, click **Add Integration**, and enter the integration page
    3. Choose **Email** integration, click **Save** to generate a card
    4. Click the generated card to view the **Email Address**, copy it for later use, and you're done
  </details>

  #### Using Shared Integration

  Choose this option when you need to route alerts to different channels based on the alert payload information.

  <details>
    <summary>Expand</summary>

    1. Go to the Flashduty console, select **Integration Center=>Alerts**, and enter the integration selection page
    2. Select **Email** integration:
       * **Integration Name**: Define a name for the current integration
       * **Email Address**: Set an easy-to-remember prefix for the email, which must be unique within your account
       * **Push Mode**: Choose when the email should trigger or recover alerts
    3. Copy the **Email Address** from the current page for later use
    4. Configure the default route and select the corresponding channel (after the integration is created, you can go to `Route` to configure more routing rules)
    5. Done
  </details>
</div>

### Customize Email Integration

#### Email Address

By default, the system generates a unique email address for you. You can modify it, but note that **the email prefix must not contain uppercase letters** (lowercase letters and digits are recommended) and must remain unique within your account.

#### Push Mode

By default, the system creates a new alert for every email, but you can switch the mode to:

1. **Trigger or Update Alert Based on Email Subject**: In this mode, when receiving a new email, the system searches for open alerts based on the email subject. If found, it updates the alert; otherwise, it triggers a new alert.
2. **Trigger or Close Alert Based on Rules**: In this mode, when receiving a new email, the system matches emails according to your rules and either triggers new alerts or closes existing ones based on the matches.

   * You must fill in at least one **trigger** rule
   * You must set regex extraction rules for Alert Key. The system uses this field to find historical alerts for updates or closure; **if regex extraction fails, the system will use the email subject to generate an Alert Key** to ensure alerts aren't lost due to configuration errors
   * The Alert Key regex must be a valid RE2 expression. It is validated when the rule is saved; an illegal expression is rejected with the message "Please enter a valid regex"
   * You can choose whether to discard emails when no rules match

   Configuration example:

   * Receive all emails, close the alert when the email content contains **RESOLVED**, otherwise trigger a new alert
   * Extract Alert Key from email subject using the rule **/(.\*)/**

   <img src="https://download.flashcat.cloud/flashduty/integration/email/send-mode.png" alt="drawing" width="800" />

#### Silence Detection

In the integration card (edit and preview), the **Silence Detection** (Heartbeat) setting sits below the push settings: if no valid event arrives within the configured interval, the system generates a Warning alert.

| Setting                          | Description                                                                                                                                          |
| :------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Enable Silence Detection**     | Switch, off by default. When on, only upstream events that pass integration validation refresh the detection time                                    |
| **Detection Interval (minutes)** | A Warning alert is generated if no valid event arrives within this interval. Must be an integer between 10 minutes and 48 hours (default 10 minutes) |
| **Auto-recover on new event**    | Switch, on by default. When the next valid event arrives, the alert raised by silence detection is recovered automatically                           |

### Important Notes

1. The system will reject emails larger than 5MB
2. If the email text content exceeds 128KB, the system will truncate it and add a label in the incident details:

```
body_cut = true
```

3. If the email contains attachments, the system will discard them and add a label in the incident details:

```
attachment_stripped = true
```

4. For new alerts triggered by email, **the title is the email subject, and the description is the email content**

5. If you modify your account domain, this email address will also change, so remember to update the push URL

## Severity Mapping

***

Currently, all alerts pushed to Flashduty through the email integration are set to Warning severity. However, you can customize the severity using the [alert pipeline](/en/on-call/integration/alert-integration/alert-pipelines).
