> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sendpost.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Mailgun Event Types

> Understand Mailgun event types and how they map to SendPost for tracking email delivery and engagement.

Mailgun events are tracked with specific event type IDs in SendPost, allowing you to distinguish between native SendPost events and Mailgun events.

***

## Mailgun Event Types

| Event Type      | ID | Mailgun Event                    | Description                               |
| --------------- | -- | -------------------------------- | ----------------------------------------- |
| MG Processed    | 48 | (generated)                      | Email processed and sent to Mailgun       |
| MG Sent         | 49 | `accepted`                       | Mailgun accepted the message for delivery |
| MG Delivered    | 50 | `delivered`                      | Email successfully delivered to recipient |
| MG Hard Bounced | 51 | `failed` (severity: "permanent") | Permanent delivery failure                |
| MG Soft Bounced | 52 | `failed` (severity: "temporary") | Temporary delivery failure                |
| MG Dropped      | 53 | `rejected`                       | Email rejected by Mailgun                 |
| MG Opened       | 54 | `opened`                         | Recipient opened the email                |
| MG Clicked      | 55 | `clicked`                        | Recipient clicked a link                  |
| MG Spam Report  | 56 | `complained`                     | Recipient marked email as spam            |
| MG Unsubscribe  | 57 | `unsubscribed`                   | Recipient unsubscribed                    |

<Note>
  **MG Processed** (ID 48) is generated by SendPost when the message is successfully submitted to Mailgun, not from a webhook event.
</Note>

***

## Bounce Type Details

Mailgun categorizes bounces based on the `severity` field in the `failed` event:

<AccordionGroup>
  <Accordion title="Hard Bounce (ID: 51)" icon="circle-xmark">
    Permanent failure indicated by `severity: "permanent"`. This includes invalid email addresses, non-existent domains, or permanent rejections. These addresses should be removed from your list.
  </Accordion>

  <Accordion title="Soft Bounce (ID: 52)" icon="circle-exclamation">
    Temporary failure indicated by `severity: "temporary"`. This includes full mailboxes, temporary server issues, or rate limiting. Mailgun may retry these automatically.
  </Accordion>
</AccordionGroup>

***

## Event Data

Each Mailgun event includes:

* Message ID (for correlation)
* Recipient email
* Timestamp
* SMTP response code and message (for bounces)
* User agent (for opens)
* Client IP address (for opens/clicks)
* Clicked URL (for clicks)
* Mailgun-specific IDs

***

## Bounce Status Information

Mailgun provides detailed delivery status in the `delivery-status` field:

| Field     | Description                    |
| --------- | ------------------------------ |
| `code`    | SMTP response code (integer)   |
| `message` | SMTP response message (string) |

**Example SMTP Codes**:

| Code | Meaning                         |
| ---- | ------------------------------- |
| 250  | Success                         |
| 421  | Service temporarily unavailable |
| 450  | Mailbox temporarily unavailable |
| 452  | Insufficient storage            |
| 550  | Mailbox unavailable (permanent) |
| 551  | User not local                  |
| 552  | Exceeded storage allocation     |
| 553  | Mailbox name invalid            |
| 554  | Transaction failed              |

***

## Event Type Quick Reference

| Event       | ID | Mailgun Webhook Event  |
| ----------- | -- | ---------------------- |
| Processed   | 48 | (generated internally) |
| Sent        | 49 | `accepted`             |
| Delivered   | 50 | `delivered`            |
| Hard Bounce | 51 | `failed` (permanent)   |
| Soft Bounce | 52 | `failed` (temporary)   |
| Dropped     | 53 | `rejected`             |
| Open        | 54 | `opened`               |
| Click       | 55 | `clicked`              |
| Spam        | 56 | `complained`           |
| Unsubscribe | 57 | `unsubscribed`         |

***

## Next Steps

* [View analytics](/guides/mailgun/analytics) to see event statistics
* [Troubleshoot issues](/guides/mailgun/troubleshooting) with event processing
