Feature Highlight: Migrate from Mailgun to GreenArrow CloudMTA Without Rewriting Your Code
Feature Highlight: Migrate from Mailgun to GreenArrow CloudMTA Without Rewriting Your Code
Changing email providers can seem like a daunting task. Every app that sends mail has calls to its provider’s API woven into signup flows, password resets, receipts, and newsletters. Rewriting all of that is often enough to keep people on a platform they’ve outgrown.
We’d like to take that obstacle off the table. GreenArrow CloudMTA now speaks Mailgun’s API. If your software sends through Mailgun today, you can move it to CloudMTA by changing a hostname and an API key, without rewriting your integrations.
Four APIs, one familiar interface
CloudMTA’s Mailgun compatibility layer covers the parts of Mailgun’s API that most senders rely on:
- Messages API –
POST /v3/{domain}/messages. Build and send a message from form fields, just like you do now. It supports recipients,cc/bcc, HTML and text bodies, attachments, inline images, tags, open and click tracking, scheduled delivery, custom headers,v:variables, and batch sending with recipient variables. - MIME Messages API –
POST /v3/{domain}/messages.mime. Already building your own MIME messages? Send them as-is, with the sameo:,h:, andv:options. - Domains API – Create, list, verify, and delete sending domains, and get back the DNS records to publish.
- IP Pools API – List and create dedicated IP pools, and send through them with
o:sending-ip-pool.
Authentication works the way your code already expects: HTTP Basic auth with api as the username and a GreenArrow API key as the password.
What a migration looks like
Here’s the short version:
- Point your code at CloudMTA. Swap Mailgun’s base URL for your CloudMTA Mailgun compatibility hostname, and swap your Mailgun key for a GreenArrow API key.
- Add your sending domains. Create them through the Domains API (or the Engine interface). GreenArrow gives you three CNAME records to publish: one for click and open tracking, and two for DKIM. Then verify.
- Set up your IP pools. Create a pool, and GreenArrow assigns IP addresses to it automatically.
- Send. Your existing calls go out through GreenArrow:
curl -s --user "api:$API_KEY" \
https://mg.api.example.com/v3/mail.example.com/messages \
-F from='[email protected]' \
-F to='[email protected]' \
-F subject='Hello' \
-F text='Hello!'
Under the hood, each piece maps to something you’ll find in GreenArrow. Domains are GreenArrow Sending Domains, and IP pools are GreenArrow Routes. Anything you set up in the Engine web interface shows up through the Mailgun-compatible APIs too, and the other way around. Use whichever is handier that day.
Where GreenArrow differs
While we aimed for compatibility, there are differences that may matter to your use case:
- Unsupported options fail loudly. If you send a parameter we don’t support, you get a
400error instead of having it silently ignored. Run your test suite against CloudMTA and you’ll find any gaps right away. - Stored templates aren’t supported. Requests that use Mailgun’s
templateparameters are refused. Render your content before sending, or send it as MIME. - GreenArrow manages your IP addresses. Each new pool is assigned addresses automatically. You can’t pick, add, or move addresses yourself.
- Domain setup is simpler. Every message is signed with DKIM, and tracking links always use HTTPS. Domains created through the API only need CNAME records, and inbound mail isn’t part of the API.
- The From address has to match. The
fromdomain must match the sending domain in the URL.
The documentation for each API ends with a complete list of differences from Mailgun, so you can check your integration against it before you switch.
Why make the move?
- Keep your code. Your existing Mailgun integration keeps working, so the migration becomes a configuration change instead of a project.
- Keep your tools. Internal scripts and dashboards built around Mailgun’s domain and IP pool APIs keep working too.
- Gain GreenArrow. You get CloudMTA’s deliverability tools, reporting, and support team, plus the Engine interface whenever you want to look deeper.
Learn more
Each API has its own page in the documentation:
Thinking about leaving Mailgun? Contact us to schedule a free demo. We’ll walk you through CloudMTA and help you plan the move for your setup.
Queen One and Rejoiner's migration to GreenArrow
This blog post is an interview with Mike Arsenault from Queen One about their recent migration to GreenArrow.
Your New IPs Need to Learn to Walk Before They Run
You have a brand new IP address, maybe even several brand new IPs. Maybe you changed your email service provider,…