Skip to content

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 using StaticLookup, enrich it with contact info using Join, and upload filtered results to an external dashboard via Google Sheets Upload.


Input

Not Applicable


Output

Output TypeFormatDescription
FilesCSVOne or more CSV files for event records.
DataJSONFor message retrieval, response is in JSON.

Configuration Fields

Field NameDescriptionRequired
ConnectionMailgun connection (API Key and Domain).Yes
EntityType of resource to fetch: Events or Messages.Yes
Number Of RetriesNumber of retry attempts on failure before giving up (default: 3).Optional
StorageKeyMailgun storage key used to retrieve a specific message. Required for Messages.Conditional
BeginStart of time range (in ISO format or epoch seconds) for events filter.Optional
EndEnd of time range (in ISO format or epoch seconds).Optional
AscendingSort by time in ascending order (yes/no). Needed if End is not provided.Optional
LimitMax number of entries to retrieve (default: 300).Optional
EventFilter events by type (e.g., delivered, opened, failed).Optional
ListFilter by mailing list address.Optional
AttachmentFilter by file name attached to the email.Optional
FromFilter by sender address.Optional
Message IdFilter using Mailgun message ID.Optional
SubjectFilter by email subject line.Optional
ToFilter by recipient email in To header.Optional
SizeFilter emails based on size.Optional
RecipientFilter by actual email recipient.Optional
RecipientsFilter by all recipients in case of stored events.Optional
TagsFilter by user-defined Mailgun tags.Optional
SeverityFilter by event severity (e.g., temporary, permanent).Optional

Sample Input

Not applicable


Sample Configuration

FieldValue
ConnectionMailgun_Prod_Conn
EntityEvents
Begin2025-07-01T00:00:00Z
End2025-07-10T23:59:59Z
Limit100
Eventdelivered
Ascendingyes

Sample Output

For Events Entity (CSV file):

IdEventTimestampRecipientSubjectSizeTags
ev1234delivered2025-07-01T10:05:00Z[email protected]Welcome Email18KBonboarding
ev1235opened2025-07-01T10:08:00Z[email protected]Promo Offer22KBpromotions

For Messages Entity (JSON):

{
"headers": {
"message-id": "<[email protected]>",
"subject": "Password Reset",
},
"recipients": ["[email protected]"],
"attachments": ["reset_instructions.pdf"]
}