We recently started using MJML to develop our emails, and we’re pretty excited. Let’s face it, developing emails is usually a chore. Between all of the tables, inline CSS, and conditional code for different clients, email development is slow, and the code is usually inefficient to edit. MJML is a wonderful solution to this problem.
What is MJML?
MJML, which stands for Mailjet Markup Language, is a framework designed to make coding responsive emails easier. Instead of wading through countless nested tables, MJML allows you to write simple, semantic code which is then converted to HTML. The output HTML is responsive and compatible with the vast majority of email clients. Writing MJML looks a little something like this:
What Makes it Uniquely Useful?
Creating modular code for emails has never been simpler. Thanks to the MJML function “mj-include”, we can build out independent, single-purpose sections that can easily be added or removed. This functionality saves dev time and keeps the code to smaller, more easily digestible files, making it easier to maintain and debug.
MJML also has a components library that further reduces development time and makes it easier than ever to generate compliant, responsive HTML emails. Some examples of standard components are buttons, invoices, hero images, maps, and an interactive carousel. MJML even gives you the opportunity to create your own components, which we’re looking forward to diving deeper into.
Why We Love It
There is an online editor, an app, and the ability to set it up locally on your computer. All it requires to get set up is Node/NPM, so after just a few terminal commands we were up and running. MJML’s app, Sublime, and Atom allow you to view the output email right next to the MJML, making life even simpler (plus Atom has a linter, too!).