- 1
Add your domain in Reloop
Add your domain in Reloop and publish the DKIM record (
reloop._domainkey). Mergeinclude:reloop.shinto your existing SPF record. Don't add a second SPF record. - 2
Swap the client
Replace
mg.messages.create(domain, {...})withreloop.mail.send({...}). Sendtoas a string or array, and drop the domain argument; Reloop reads it fromfrom. - 3
Handle errors as values
Mailgun throws; Reloop returns
emailError. Replacetry/catcharound sends with a check onemailError. - 4
Move templates
Change Handlebars placeholders to triple braces:
{{first_name}}becomes{{{first_name}}}, and pass values as template variables instead ofh:X-Mailgun-Variables. - 5
Replace inbound routes
Replace inbound routes with Reloop mailboxes, or keep a webhook flow with the
email.receivedevent. - 6
Point webhooks
Point webhooks at a new handler. Reloop events are named
email.delivered,email.bounced,email.complainedand so on, and are signed with HMAC-SHA256 in theReloop-Signatureheader. - 7
Import suppressions
Import suppressions from Mailgun's bounces, complaints and unsubscribes lists, so you don't mail addresses that already failed.
- 8
Ramp traffic
Ramp traffic from 10% to 100% over a week or two, then remove Mailgun's DNS records.
Our SendGrid migration guide covers the same steps in more detail, including a traffic-split flag and a suppression import script that work just as well when coming from Mailgun.