Mailgun

Use Mailgun to send text or HTML emails, retrieve messages and delivery events, manage mailing lists, and inspect sending domains. Tags help associate sent messages with a workflow or campaign.

Use the block

Send text or HTML emails, manage mailing lists and members, inspect domains, and track email events with tags.

Actions

Mailgun Send Message

Send an email using Mailgun API

Inputs and outputs

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
regionstringNoMailgun account region: "us" (default) or "eu"
domainstringYesMailgun sending domain (e.g., mg.example.com)
fromstringYesSender email address (e.g., sender@example.com or "Name <sender@example.com>")
tostringYesRecipient email address (e.g., user@example.com). Use comma-separated values for multiple recipients
subjectstringYesEmail subject line
textstringNoPlain text body of the email
htmlstringNoHTML body of the email (e.g., "<h1>Hello</h1><p>Message content</p>")
ccstringNoCC recipient email address (e.g., cc@example.com). Use comma-separated values for multiple recipients
bccstringNoBCC recipient email address (e.g., bcc@example.com). Use comma-separated values for multiple recipients
tagsstringNoTags for the email (comma-separated)

Output

ParameterTypeDescription
successbooleanWhether the message was sent successfully
idstringMessage ID
messagestringResponse message from Mailgun

Mailgun Get Message

Retrieve a stored message by its key

Inputs and outputs

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
regionstringNoMailgun account region: "us" (default) or "eu"
domainstringYesMailgun domain for retrieving messages (e.g., mg.example.com)
messageKeystringYesMessage storage key

Output

ParameterTypeDescription
successbooleanWhether the request was successful
recipientsstringMessage recipients
fromstringSender email
subjectstringMessage subject
bodyPlainstringPlain text body
strippedTextstringStripped text
strippedSignaturestringStripped signature
bodyHtmlstringHTML body
strippedHtmlstringStripped HTML
attachmentCountnumberNumber of attachments
timestampnumberMessage timestamp
messageHeadersjsonMessage headers
contentIdMapjsonContent ID map

Mailgun List Messages

List events (logs) for messages sent through Mailgun

Inputs and outputs

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
regionstringNoMailgun account region: "us" (default) or "eu"
domainstringYesMailgun domain for listing events (e.g., mg.example.com)
eventstringNoFilter by event type (accepted, delivered, failed, opened, clicked, etc.)
limitnumberNoMaximum number of events to return (default: 100)

Output

ParameterTypeDescription
successbooleanWhether the request was successful
itemsjsonArray of event items
pagingjsonPaging information

Mailgun Create Mailing List

Create a new mailing list

Inputs and outputs

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
regionstringNoMailgun account region: "us" (default) or "eu"
addressstringYesMailing list address (e.g., newsletter@mg.example.com)
namestringNoMailing list name
descriptionstringNoMailing list description
accessLevelstringNoAccess level: readonly, members, or everyone

Output

ParameterTypeDescription
successbooleanWhether the list was created successfully
messagestringResponse message
listjsonCreated mailing list details

Mailgun Get Mailing List

Get details of a mailing list

Inputs and outputs

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
regionstringNoMailgun account region: "us" (default) or "eu"
addressstringYesMailing list address to retrieve (e.g., newsletter@mg.example.com)

Output

ParameterTypeDescription
successbooleanWhether the request was successful
listjsonMailing list details

Mailgun Add List Member

Add a member to a mailing list

Inputs and outputs

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
regionstringNoMailgun account region: "us" (default) or "eu"
listAddressstringYesMailing list address (e.g., list@mg.example.com)
addressstringYesMember email address to add (e.g., user@example.com)
namestringNoMember name
varsstringNoJSON string of custom variables
subscribedbooleanNoWhether the member is subscribed

Output

ParameterTypeDescription
successbooleanWhether the member was added successfully
messagestringResponse message
memberjsonAdded member details

Mailgun List Domains

List all domains for your Mailgun account

Inputs and outputs

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
regionstringNoMailgun account region: "us" (default) or "eu"

Output

ParameterTypeDescription
successbooleanWhether the request was successful
totalCountnumberTotal number of domains
itemsjsonArray of domain objects

Mailgun Get Domain

Get details of a specific domain

Inputs and outputs

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
regionstringNoMailgun account region: "us" (default) or "eu"
domainstringYesDomain name to retrieve details for (e.g., mg.example.com)

Output

ParameterTypeDescription
successbooleanWhether the request was successful
domainjsonDomain details