Set up Mailgun in RouteIQ
Verify a sending domain, create a narrowly scoped sending key, and choose the address RouteIQ uses for transactional email.
Before you start
You will need a Mailgun account, access to edit DNS for your sending domain, permission to manage sending keys, and RouteIQ administrator access.
Using a dedicated subdomain such as mg.example.com keeps email sent by RouteIQ separate from your normal employee email and makes its DNS settings easier to manage.
1. Add a sending domain
- In Mailgun, add the custom domain or subdomain RouteIQ should send from.
- Select the US or EU region. Note your choice because RouteIQ must use the same region.
- Choose a domain that you control and can update in DNS.
Follow Mailgun's custom-domain guide.
2. Publish and verify the DNS records
- Copy the SPF, DKIM, tracking, and any other records Mailgun displays.
- Add the records exactly at your DNS provider.
- Wait for propagation, then select Verify DNS settings in Mailgun.
- Continue only after the sending domain shows as verified.
Mailgun's domain-verification guide explains each record.
3. Create a Domain Sending Key
- Open the verified domain's Sending keys area.
- Create a dedicated key named for RouteIQ.
- Copy it when shown and store it securely.
Only permission to send mail is needed. A key limited to this domain is safer than a broad account API key and does not need to match an outdated prefix example.
See Mailgun's API key management guide.
4. Connect Mailgun to RouteIQ
- Sign in to RouteIQ and open Settings > Integrations.
- Find Mailgun and turn it on.
- After it shows Connected, select Configure.
- Enter the Private API Key and exact Mailgun Domain.
- Set Mailgun Region to
usoreuso it matches the region selected for the domain. You may leave it blank for a US domain. - Enter a Default From Email under that domain and an optional From Name.
- Leave Is Active selected and save.
5. Verify the setup
- Send a real RouteIQ test notification to an address you control. The generic Sync action does not validate Mailgun credentials.
- Confirm the message appears in Mailgun Logs or Events.
- Confirm it is delivered and shows the intended From name and address.
- Inspect authentication results to confirm SPF and DKIM pass.
Troubleshooting
Mailgun returns 401
Recopy the sending key and confirm it belongs to the configured domain.
The domain is not found
Enter the exact Mailgun domain, including a subdomain such as mg., and confirm the configured region matches the domain's Mailgun region.
Mailgun rejects the region
Enter us or eu. Leave the field blank only when the domain is in the US region.
Mailgun accepts but does not deliver
Check Events, suppressions, DNS verification, and the recipient provider's response.
Rotate or remove the key
- Create a new Domain Sending Key.
- Update RouteIQ and send a test email.
- Confirm delivery in Mailgun Events.
- Revoke the old key only after verification.