Mailgun
App · Email · 4 actions
Send and track emails with Mailgun.
Actions
| Action | What it does |
|---|---|
| Get domain stats | Get summary statistics for email events, such as delivered or opened, on your Mailgun domain. |
| List events | List what happened to emails sent from your Mailgun domain - accepted, delivered, failed (bounced), opened, clicked, unsubscribed or marked as spam - newest first, or oldest first from a time. |
| Send an email | Send a plain text or HTML email through a Mailgun sending domain. |
| Send an email with a template | Send an email whose body is one of your Mailgun templates, filling in its {{variables}}. |
Get domain stats
Get summary statistics for email events, such as delivered or opened, on your Mailgun domain. Requires a full-access account API key; a domain-restricted Sending key cannot read stats.
Inputs
- Event
eventtextRequired - The email event to report on.One of:
accepted,delivered,failed,opened,clicked,unsubscribed,complained,stored. - Start date
start_datetextRequired - Start date (YYYY-MM-DD).
- End date
end_datetextRequired - End date (YYYY-MM-DD).
- Group results by
resolutiontext - Optional grouping for the results.One of:
hour,day,month.
Outputs
statsobject- Stats details.
Example output
{
"stats": {}
}List events
List what happened to emails sent from your Mailgun domain - accepted, delivered, failed (bounced), opened, clicked, unsubscribed or marked as spam - newest first, or oldest first from a time. Mailgun keeps events for a few days to a month, depending on your plan. Requires a full-access account API key.
Inputs
- Event
eventtext - Only this kind of event. Leave blank for every kind.One of:
accepted,delivered,failed(Failed (bounced)),opened,clicked,unsubscribed,complained(Marked as spam). - Recipient
recipienttext - Only events for this recipient's email address.
- From
sincedate and time - Only events from this time on, listed oldest first. Leave blank for the newest first.
- How many
limitnumber - How many events to return, from 1 to 300. 50 if left blank.
- Next page
pagetext - The next_page value of an earlier 'List events', to read on from there. The other fields are ignored then.
Outputs
resultobject- The events found.
Example output
{
"result": {
"count": 1,
"events": [
{
"event": "failed",
"from": "shop@mg.example.com",
"id": "czsjqFATSlC3QtAK-C80nw",
"message_id": "20261107120000.1.ABC@mg.example.com",
"reason": "No such mailbox",
"recipient": "ana@example.com",
"severity": "permanent",
"subject": "Your order has shipped",
"tags": [
"orders"
],
"time": "2026-11-07T12:04:31Z",
"url": ""
}
],
"next_page": "WzMsIFsiZiJdLCBbXV0="
}
}Send an email
Send a plain text or HTML email through a Mailgun sending domain.
Inputs
- From email
from_emailtextRequired - Sender email address (must belong to the Mailgun domain).
- To
totextRequired - Recipient email address or comma-separated list.
- Subject
subjecttextRequired - Subject line for the email.
- Body (plain text)
texttextRequired - Plain text body.
- Body (HTML)
htmltext - Optional HTML version of the email body.
- CC
cctext - Optional CC recipients (comma-separated).
- BCC
bcctext - Optional BCC recipients (comma-separated).
Outputs
resultobject- Result details.
Example output
{
"result": {}
}Send an email with a template
Send an email whose body is one of your Mailgun templates, filling in its {{variables}}.
Inputs
- From
from_emailtextRequired - Sender email address (must belong to the Mailgun domain).
- To
totextRequired - Recipient email address or comma-separated list.
- Subject
subjecttextRequired - Subject line for the email.
- Template
templatetextRequired - The Mailgun template to send.
- Template values
variablesobject - The values to fill the template's {{variables}} with, such as first_name: Ana.
- Template version
template_versiontext - Optional. A version of the template to send instead of its active one, by its tag.
- CC
cctext - Optional CC recipients (comma-separated).
- BCC
bcctext - Optional BCC recipients (comma-separated).
Outputs
resultobject- What Mailgun said when it took the email.
Example output
{
"result": {
"id": "<20261107120000.1.ABC@mg.example.com>",
"message": "Queued. Thank you."
}
}