Integrating MJML in your app couldn’t get easier: discover the MJML API 🔌
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.
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:
Here’s what the API will return, including possible errors and the version of MJML used:
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:
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 https://mjml.io/api and click on “Join the beta”. A documentation is also available at https://mjml.io/api/documentation.
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!