Skip to content
Mailgun

How to use Mailgun

CommunicationMarketingCost: 1 credit per runTechnical reference

What it is for

Email delivery service for sending, receiving, and tracking emails

Mailgun triggers react instantly to events in the app (some of them check periodically every few minutes).

Set up the connection

Authentication type: Custom credentials

  1. 1Sign in to Mailgun and look for the API or integrations section in its settings.
  2. 2Create an API key or token with the permissions you need and copy it.
  3. 3In flooows, add a Mailgun step, click "Connect" and paste it into: API Key, Region.
  4. 4Save the connection: it is stored encrypted and is never shown in plain text.
Connection fieldTypeRequired
API KeySecret keyYes
RegionFixed listYes

Credentials are stored encrypted in your isolated database, in Spain, and are never shown in plain text.

How to use it in a flow

  • Send Email: fill in Domain, From, To Email Address, Email Subject; use the data selector to map values from earlier steps.
  • Validate Email: fill in Email Address; use the data selector to map values from earlier steps.
  • Add Mailing List Member: fill in Mailing List, Member Email Address, Update If Exists; use the data selector to map values from earlier steps.

Tips

  • •Test each step before publishing to see the exact output structure.
  • •Enable retries on steps that call external services.

Triggers (8)

Events that can start a flow. Expand each one to see its fields.

New Bounce EventWebhook (paste the URL in the app)1 fields
FieldTypeRequired
DomainList (from your account)Yes
New Complaint EventWebhook (paste the URL in the app)1 fields
FieldTypeRequired
DomainList (from your account)Yes
New Delivery EventWebhook (paste the URL in the app)1 fields
FieldTypeRequired
DomainList (from your account)Yes
New Failed Delivery EventWebhook (paste the URL in the app)1 fields
FieldTypeRequired
DomainList (from your account)Yes
New Open EventWebhook (paste the URL in the app)1 fields
FieldTypeRequired
DomainList (from your account)Yes
New Click EventWebhook (paste the URL in the app)1 fields
FieldTypeRequired
DomainList (from your account)Yes
New Unsubscribe EventWebhook (paste the URL in the app)1 fields
FieldTypeRequired
DomainList (from your account)Yes
Bulk Bounce Threshold ExceededPeriodic check4 fields
FieldTypeRequired
DomainList (from your account)Yes
ThresholdNumberYes
Window (minutes)NumberYes
Bounce TypeFixed listYes

Actions (9)

Operations available as flow steps. Expand each one to see its fields.

Send Email9 fields
FieldTypeRequired
DomainList (from your account)Yes
FromTextYes
To Email AddressTextYes
CC Email AddressTextNo
BCC Email AddressTextNo
Reply-To Email AddressTextNo
Email SubjectTextYes
Email Body (Plain Text)Long textNo
Email Body (HTML)Long textNo
Validate Email2 fields
FieldTypeRequired
Email AddressTextYes
Provider LookupYes / NoNo
Add Mailing List Member6 fields
FieldTypeRequired
Mailing ListList (from your account)Yes
Member Email AddressTextYes
Member NameTextNo
Update If ExistsYes / NoYes
SubscribedYes / NoNo
Custom VariablesJSONNo
Get Events6 fields
FieldTypeRequired
DomainList (from your account)Yes
Event TypeFixed listYes
SeverityFixed listNo
Begin DateTextNo
End DateTextNo
Max ResultsNumberNo
Get Domain Stats3 fields
FieldTypeRequired
DomainList (from your account)Yes
Event TypesMulti-selectYes
DurationFixed listYes
List Bounces2 fields
FieldTypeRequired
DomainList (from your account)Yes
Max ResultsNumberNo
Delete Bounces (Bulk)3 fields
FieldTypeRequired
DomainList (from your account)Yes
ScopeFixed listYes
AddressTextNo
Get Domain Health1 fields
FieldTypeRequired
DomainList (from your account)Yes
Custom API Call10 fields
FieldTypeRequired
urlDynamic fieldsYes
MethodFixed listYes
HeadersKey / value pairsNo
Query ParametersKey / value pairsNo
Body TypeList (from your account)No
BodyDynamic fieldsNo
Response is BinaryYes / NoNo
Return Error as OutputYes / NoNo
TimeoutNumberNo
Follow redirectsYes / NoNo

Common errors

Authentication error

The connection expired or the key was revoked: reconnect it from Connections.

Field not found or empty

Re-test the previous step and remap the field in the data selector.

Field types

"List (from your account)" loads options from your connected account; "Dynamic fields" appear depending on earlier choices; in any field you can insert data from previous steps with the data selector (e.g. {{trigger.email}}). More about data between steps