Mailgun
Description
Mailgun is a cloud-based email service used to send, receive, and track emails via RESTful APIs. It supports advanced features like email routing, validation, and analytics at scale.
The Mailgun activity integrates with the Mailgun API to retrieve email events or stored messages. It supports two primary entities:
- Events – Track email delivery, opens, clicks, failures, and related metadata.
- Messages – Retrieve raw message content or metadata using a storage key.
Use this activity to:
- Monitor and export email delivery data in real time.
- Download stored message metadata or content for archiving.
- Analyze click-through rates or bounce statistics in workflows.
Use case:
After sending bulk emails using another system, use this activity to fetch bounce, delivery, or open events. You can then process this data usingStaticLookup
, enrich it with contact info usingJoin
, and upload filtered results to an external dashboard viaGoogle Sheets Upload
.
Input
Not Applicable
Output
Output Type | Format | Description |
---|---|---|
Files | CSV | One or more CSV files for event records. |
Data | JSON | For message retrieval, response is in JSON. |
Configuration Fields
Field Name | Description | Required |
---|---|---|
Connection | Mailgun connection (API Key and Domain). | Yes |
Entity | Type of resource to fetch: Events or Messages . | Yes |
Number Of Retries | Number of retry attempts on failure before giving up (default: 3). | Optional |
StorageKey | Mailgun storage key used to retrieve a specific message. Required for Messages . | Conditional |
Begin | Start of time range (in ISO format or epoch seconds) for events filter. | Optional |
End | End of time range (in ISO format or epoch seconds). | Optional |
Ascending | Sort by time in ascending order (yes/no). Needed if End is not provided. | Optional |
Limit | Max number of entries to retrieve (default: 300). | Optional |
Event | Filter events by type (e.g., delivered, opened, failed). | Optional |
List | Filter by mailing list address. | Optional |
Attachment | Filter by file name attached to the email. | Optional |
From | Filter by sender address. | Optional |
Message Id | Filter using Mailgun message ID. | Optional |
Subject | Filter by email subject line. | Optional |
To | Filter by recipient email in To header. | Optional |
Size | Filter emails based on size. | Optional |
Recipient | Filter by actual email recipient. | Optional |
Recipients | Filter by all recipients in case of stored events. | Optional |
Tags | Filter by user-defined Mailgun tags. | Optional |
Severity | Filter by event severity (e.g., temporary, permanent). | Optional |
Sample Input
Not applicable
Sample Configuration
Field | Value |
---|---|
Connection | Mailgun_Prod_Conn |
Entity | Events |
Begin | 2025-07-01T00:00:00Z |
End | 2025-07-10T23:59:59Z |
Limit | 100 |
Event | delivered |
Ascending | yes |
Sample Output
For Events
Entity (CSV file):
Id | Event | Timestamp | Recipient | Subject | Size | Tags |
---|---|---|---|---|---|---|
ev1234 | delivered | 2025-07-01T10:05:00Z | [email protected] | Welcome Email | 18KB | onboarding |
ev1235 | opened | 2025-07-01T10:08:00Z | [email protected] | Promo Offer | 22KB | promotions |
For Messages
Entity (JSON):
{ "headers": { "subject": "Password Reset", }, "attachments": ["reset_instructions.pdf"]}