Integrating MJML in your app couldn’t get easier: discover the MJML API 🔌

Nicolas Garnier
Feb 14, 2017 · 2 min read

While MJML has been making email developers happy for a year now, with an easy-to-use syntax and responsive-by-design markup, we don’t want to stop here.

Freeing you from the NodeJS dependency

Until today, because MJML is coded in NodeJS, if you wanted to integrate it in your app you had to run MJML on a NodeJS server yourself. While we love NodeJS, we understand that you might not know it or use a different language in your app.

Image for post
Image for post
Our objective: make this engine free from any dependency

This was also requested by our community on MJML’s Github but also led to questions on StackOverflow and we can understand it’s a fair request.

Making MJML language-agnostic for app integrations

Now, all it takes to render responsive HTML from MJML is a HTTP POST request to the MJML API, for example here in cURL:

POST request to the /render route on the MJML API

Here’s what the API will return, including possible errors and the version of MJML used:

Response from the /render POST request on the MJML API

Using MJML in JSON

While you are probably using MJML as a markup to code your emails, this API is using the JSON format. This was an easy decision as JSON is a standard format for APIs, being a fast, reliable and easy-to-use format.

This means that if you want to use MJML as a markup with the API, you need to escape your MJML string so it is JSON compliant. However, MJML can also be used in JSON, which is a format much easier to manipulate dynamically. You can know more about this in MJML’s documentation, but here’s what a MJML template looks like in JSON:

Example of a MJML template in JSON

Integrations all the way!

We’re proud to release the MJML API in public beta. To register, all you have to do is head over to and click on “Join the beta”. A documentation is also available at

We hope you’ll love the API and use it to build awesome integrations. We already had requests for drag and drop builders, email test platforms and code editors. Hopefully, Litmus will even be able to use the API to support MJML in their builder, if you’d like so, upvote it in their roadmap!

Want to share what you built or need help? Join the team and the community on Slack, Twitter and always keep up to date by subscribing to the newsletter on

MJML: Making Responsive Email Easy

Stories and updates about mjml.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store