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.

Usage Instructions

Integrate Mailgun into your workflow. Send transactional emails, manage mailing lists and members, view domain information, and track email events. Supports text and HTML emails, tags for tracking, and comprehensive list management.

Actions

Mailgun Send Message

Send an email using Mailgun API

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
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

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
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

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
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

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
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

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
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

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
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

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key

Output

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

Mailgun Get Domain

Get details of a specific domain

Input

ParameterTypeRequiredDescription
apiKeystringYesMailgun API key
domainstringYesDomain name to retrieve details for (e.g., mg.example.com)

Output

ParameterTypeDescription
successbooleanWhether the request was successful
domainjsonDomain details