Featured

Email API Migration Guide: Mailchimp to Elastic Email

by Ula Chwesiuk | Jul 29, 2024

Moving from Mailchimp to Elastic Email? Welcome onboard! We look forward to assisting you with migrating from one email service provider to another. Let us walk you through all the essential steps to make your transition as smooth and seamless as possible. In this article, you will learn about our API libraries and documentation, how to get started and how to send your first email via Elastic Email API.

If you're sending email through Mailchimp's API, you're most likely using Mailchimp Transactional Email - the product formerly known as Mandrill. This guide walks through moving that integration to Elastic Email's email API, including the endpoint equivalents, your contacts, and your suppression list.

TL;DR

To migrate your email API from Mailchimp Transactional (Mandrill) to Elastic Email: create a free Elastic Email account, verify your sending domain via DNS, generate an API key in Settings, install one of the 12 official libraries, then map your Mailchimp API calls to their Elastic Email equivalents using the comparison table below. Before you cut over, export your contacts and your suppression list from Mailchimp and import both, skipping suppressions means mailing people who already unsubscribed. Run both providers in parallel until your Elastic Email delivery rates look healthy, then switch fully.

Elastic Email API libraries and SDKs

When starting with using our API, we recommend you check out our API libraries. To ensure you the easiest integration possible, we have prepared and constantly maintain them for 12 programming languages and frameworks. You can choose one below, and you will find a downloadable API library with authentication instructions, code samples, guides, and other useful resources. Here are our libraries:

If you cannot find the library you’re looking for, let us know at contact@elasticemail.com.

How to set up Elastic Email's email API: step by step

Let’s take a look at the essential steps to set up your Elastic Email account, integrate with our email API, and start sending emails.
When making the first steps in your journey with Elastic Email, you can also use our API documentation to integrate with our email API and use it according to your sending needs. Looking at API documentation is the best way to see the difference between email service providers. To simplify matters, we prepared a comparison of the most essential API references for both Elastic Email and Mailchimp Transactional (formerly Mandrill):

API Name

Email Marketing platform | Elastic EmailEmail Marketing platform | Elastic Email
Introduction
IntroductionGetting started
Authentication
AuthenticationAuthentication
Sending Emails
EmailsMessages
Managing Suppressions
SuppressionsRejection Blocklist
Managing Templates
TemplatesTemplates
Inbound Email Processing
Inbound RouteInbound
Statistics
StatisticsActivity and reports

Signing up

The first step is to sign up for an Elastic Email account. To do it, you need to choose the Email API product and create your account for free. To try out our platform, you don’t need to provide any credit card details. After registration, you will receive a confirmation email to verify your profile.

Setting up a sending domain

After creating your Elastic Email account, you need to add and verify your sending domain. To do it, you will need to log into your domain provider and adjust the DNS settings of your domain. For more information, check out our help article on how to verify your domain or watch our YouTube guide below:\

Creating your API Key

To start using our email API, you will need to authenticate yourself with an API key. To generate it, enter settings on your Elastic Email account and go to Settings->Manage API Keys->Create.

At this point, you can set custom permissions and optional access for your API key. 

After creating your API key, please keep it safe as you will need your API key for every call you make in order to identify yourself and confirm your account’s credentials. 

Your API key should be sent inside the header with the parameter name ‘x-elasticemail-apikey’ and your API key as a value.

Installing API library

To make your migration process easier and quicker, we recommend downloading and installing a repository of the programming language you use. Both Mailchimp and Elastic Email have a large collection of email API libraries and SDKs of many programming languages. Just like you integrated with Mailchimp’s email API by installing a library or SDK, you need to do the same with Elastic Email. All our downloadable repositories are available on GitHub.

Let’s show you the installation process using JavaScript. For example, when you want to install the repository for Node.js.

Npm

To publish the library via npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install @elasticemail/elasticemail-client --save

Sending your first email

const mailchimp = require("mailchimp_transactional")(
  "YOUR_API_KEY"
);

const message = {
  from_email: "hello@example.com",
  subject: "Hello world",
  text: "Welcome to Mailchimp Transactional!",
  to: [
    {
      email: "freddie@example.com",
      type: "to"
    }
  ]
};

async function run() {
  const response = await mailchimp.messages.send({
    message
  });
  console.log(response);
}
run();

If you want to send your first email via Elastic Email, you need to load the library, get client instance, use your newly generated Elastic Email API key, and create an instance of EmailsApi that will be used to send the email.

Based on the JavaScript example, here’s the whole code for sending an email to copy and paste:

const ElasticEmail = require('@elasticemail/elasticemail-client');

const client = ElasticEmail.ApiClient.instance;

const apikey = client.authentications['apikey'];
apikey.apiKey = "YOUR_API_KEY";

const emailsApi = new ElasticEmail.EmailsApi();
const emailData = {
    Recipients: [
        {
            Email: "johnsmith@domain.com",
            Fields: {
                name: "John"
            }
        }
    ],
    Content: {
        Body: [
            {
                ContentType: "HTML",
                Charset: "utf-8",
                Content: "<strong>Hi {name}!<strong>"
            },
            {
                ContentType: "PlainText",
                Charset: "utf-8",
                Content: "Hi {name}!"
            }
        ],
        From: "myemail@domain.com",
        Subject: "Example email"
    }
};

const callback = (error, data, response) => {
    if (error) {
        console.error(error);
    } else {
        console.log('API called successfully.');
        console.log('Email sent.');
    }
};
emailsApi.emailsPost(emailData, callback);

Start migrating

We hope you managed to find all the information you need to move from Mailchimp to Elastic Email and to integrate with our API smoothly and effortlessly. If you have any questions or need additional assistance, our customer support experts will be happy to help you from day one. They are available to you 24/7 via email at support@elasticemail.com or via live chat, which you can find in the bottom right corner of our website and platform. 
Haven’t you signed up for an Elastic Email account? Try it out and start sending emails with us today!

Enjoying this Content?

You can receive articles like this straight to your inbox.
Sign up for our newsletter and get a dose of email marketing knowledge every month!

FAQ

Yes. Mandrill was rebranded as Mailchimp Transactional Email, and both names are still in common use. It's Mailchimp's transactional sending product, separate from its marketing campaign features, and it's the product most developers are migrating away from when they move an email API.

The API integration itself is usually a day or less. Domain verification adds up to 48 hours for DNS propagation, and a staged cutover with domain warm-up typically runs two to three weeks.

Not if you export both. Contacts move via CSV export and import. Your suppression list - unsubscribes, bounces and complaints - must be exported separately, and importing it before your first send is essential for compliance and deliverability.

Yes. You'll add SPF, DKIM and DMARC records for Elastic Email to your sending domain.

Official libraries cover 12 languages including JavaScript/Node.js, Python, PHP, Ruby, Java, C#/.NET and Go. You can also integrate over plain HTTP or SMTP without a library.

Yes. Elastic Email supports SMTP relay as well as the REST API, which is often the fastest migration path, many applications only need new SMTP credentials and host details, with no code changes at all.

Yes. You can create a free account with no credit card and test the full API before committing.

Templates don't transfer automatically, but you don't have to rebuild from scratch. Export them from Mailchimp as HTML and paste that HTML into Elastic Email's raw HTML editor.

If you like this article, share it with friends:

FacebookXLinkedIn
Ula Chwesiuk

Ula Chwesiuk

Ula is a content creator at Elastic Email. She is passionate about marketing, creative writing and language learning. Outside of work, Ula likes to travel, try new recipes and go to concerts.

Eager to put this knowledge to some use?

Try one of our products!