Skip to content
Connect an agent

Providers

Mailgun

Send your organisation's email through your own Mailgun account, in its US or its EU region, from an address on your domain. Plotwork takes the Mailgun domain from the From address, so the two must be the same.

TL;DR

QuestionAnswer
What do I need?A Mailgun account with your sending domain added and verified.
Which key?A sending key for that domain, which can only send.
Which region?The one your domain is in: US or EU. Choose it on the Connectors tab; US is the default.
Which domain?The part of the From address after the @. It must be the domain you added at Mailgun and the domain you verified in Plotwork.
Where does Plotwork send?https://api.mailgun.net/v3/<domain>/messages in the US, or https://api.eu.mailgun.net/v3/<domain>/messages in the EU, with the key as the password of the user api.

Choose the domain first

Mailgun is often set up on a subdomain, such as mg.acme.com. Plotwork sends to the Mailgun domain named by the From address, so:

Mailgun domainFrom addressDomain to verify in Plotwork
acme.complotwork@acme.comacme.com
mg.acme.complotwork@mg.acme.commg.acme.com

Plotwork matches the domain exactly, so a Mailgun subdomain must be verified in Plotwork as itself.

1. Verify the domain at Mailgun

  1. In Mailgun, choose the region, US or EU, and add the sending domain in it. A domain belongs to one region.
  2. Publish the DNS records Mailgun shows: the SPF and DKIM records, and the tracking and MX records if you use them.
  3. Wait until Mailgun shows the domain as verified.

2. Make a sending key

  1. In Mailgun, open the sending domain's settings and create a sending API key for it. A sending key works for that one domain and can only send messages.
  2. Give it a name that says what it is for, such as Plotwork.
  3. Copy the key. Mailgun shows it once.

An account API key also works, but it can do everything in the account. Prefer the sending key.

3. Fill in the connector

Field in PlotworkWhat to enter
ProviderMailgun
API tokenThe sending key from step 2
From addressAn address on the Mailgun domain, such as plotwork@mg.acme.com
RegionUS or EU, where the domain is

Then send a test from the Connectors tab.

If the test fails

AnswerLikely cause
The provider did not accept the tokenThe key was revoked or mistyped, or it is a sending key for another domain.
The provider refused the emailThe From address is not on the Mailgun domain, or the domain is not verified there yet.
Either of the two aboveThe region on the Connectors tab is not the region the domain is in.
The provider could not be reachedMailgun is down or slow. Try again later.

See also

PageWhy
Email through your own domainEvery step, including verifying the domain in Plotwork
ConnectorsWhich email goes through the connector
How your token is protectedHow Plotwork keeps the key
Mailgun documentation (opens in a new tab)Mailgun's own guides to domains, regions and API keys