Migrate from Mailgun

Move from Mailgun
to OpenEmail.

Domains in the URL, o: options and v: variables, mapped field by field, with a converter that rewrites your code.

The same email,
written both ways.

One message with a reply-to address and a tag, sent through Mailgun and then through OpenEmail.

Mailgun
import FormData from 'form-data'import Mailgun from 'mailgun.js' const mailgun = new Mailgun(FormData)const mg = mailgun.client({ username: 'api', key: process.env.MAILGUN_API_KEY }) const result = await mg.messages.create('mg.acme.com', {  from: 'Acme <[email protected]>',  to: ['[email protected]'],  subject: 'Your invoice is ready',  html: '<p>Thanks for your order.</p>',  'h:Reply-To': '[email protected]',  'o:tag': ['invoice'],}) console.log(result.id)
OpenEmail code
import { init, openemail } from '@openemail/sdk' init({ apiKey: process.env.OPENEMAIL_API_KEY }) const email = await openemail.emails.send({  from: 'Acme <[email protected]>',  to: ['[email protected]'],  subject: 'Your invoice is ready',  html: '<p>Thanks for your order.</p>',  replyTo: '[email protected]',  tags: { tag: 'invoice' },}) console.log(email.id)

Field by field,
what goes where.

Each option Mailgun takes, and its place in OpenEmail.

MailgunOpenEmailNotes
messages.create(domain, …)fromThe domain of the from address decides.
h:Reply-ToreplyToOne address per message.
h:X-*headersOne object of names and values.
o:tag, v:*tagsUp to 10 key and value pairs.
o:deliverytimescheduledAtAn ISO time instead of an RFC 2822 date.
o:tracking-opens, o:tracking-clickstracking: { opens, clicks }Booleans instead of yes and no.
template, t:variablestemplate: { id, props }Recreate the template in OpenEmail first.
attachmentattachmentsBase64 or bytes, 5 MB in total.
recipient-variablesemails.sendBatchOne entry per recipient, values filled in.

Converter

Paste your Mailgun code,
get it back on OpenEmail.

Pick where the code comes from and its language. Recognised keys are removed in your browser, and nothing you paste is kept.

From Mailgun
Your Mailgun code
OpenEmail code

Your OpenEmail code appears here

Paste a file, or load an example, then convert.

0 of 12,000 charactersRecognised keys are removed before sending.

Beyond the code,
four more steps.

  1. 01

    Add your sending domain

    Add it in OpenEmail and publish the DNS records it lists. Sending starts once the signing record answers.

  2. 02

    Create an API key

    Keys start with oe_live_ and carry only the scopes you give them.

  3. 03

    Move your webhooks

    Create an endpoint for the events listed below and check the X-OpenEmail-Signature header on every request.

  4. 04

    Bring contacts and suppressions

    Import your contacts as a CSV on an audience page, and add the addresses Mailgun suppressed to the suppression list.

Webhook events,
renamed.

Each Mailgun event and the OpenEmail event that replaces it. Every request carries one event, signed.

MailgunOpenEmail
acceptedemail.sent
deliveredemail.delivered
failed (temporary)email.delivery_delayed
failed (permanent)email.bounced
complainedemail.complained
openedemail.opened
clickedemail.clicked
unsubscribedsuppression.added

Moving from Mailgun,
answered.

Converted?
Create the key it reads.

A workspace takes a minute. Add your domain, create an API key and set OPENEMAIL_API_KEY.