
In order to have the background rendered full-width in the column, set the column width to 600px with width="600px". The button’s href sets the button location. Similarly to the first header, you will have to center the text both vertically and horizontally. To add the image header, you will have to replace the section’s background-color with a background-url. We’ll also have a call to action button that points to a page with more details.

In this section, we’ll have a background image and a block of text, which should represent our company slogan. The mj-text component is for our text content and takes styling attributes like font-style, font-size, color, etc. The mj-column component is used to define a column.

This section of our email will only contain our company/brand name in a center banner position: This helps our readers to easily identify sections of our email. mj-body defines the starting point of our email, and mj-section defines a section to contain other components.įor each section defined, a background-color attribute with their respective hex value is also defined. In our email.mjml file: įrom the above, you can see we’re making use of two MJML components: mj-body and mj-section. As seen above, our email will be divided into six sections. The sections serve as the skeleton for our responsive email. Now that we’ve created the file, our responsive email will be divided into the following sections: To get started, create a file named email.mjml, although you can also choose any other name you’d like.
#MJML EMAIL INSTALL#
You can install MJML with npm to use it with Node.js or the CLI: $ npm install -g mjml In this tutorial, we’ll be building beautiful and responsive emails with MJML and testing across several email clients. It is also feature-rich, with standard components that speed up development time. Its semantic syntax makes it easy and straightforward to use. This markup language is designed to reduce the pain of coding responsive emails. MJML is a modern email tool that allows developers to create great emails that are beautiful and responsive across all devices and mail clients.
#MJML EMAIL SOFTWARE#
Interested in having Brevity send out some beautiful, responsive emails to your contacts? Let’s get in touch.Ogundipe Samuel Follow Software engineer and technical writer. It makes developing responsive emails significantly easier, faster and… dare we say it… fun! We’re looking forward to integrating these new capabilities into our email strategies and learning more about building custom components.

The pros of developing in MJML far outweigh those minor cons for us. We also have the ability to write raw HTML if more columns are truly necessary.
#MJML EMAIL CODE#
Using components reduces our testing time significantly, and debugging is much simpler when the code is so easy to comb through. The basics of MJML have already been thoroughly tested across all major email clients. The library of components allows us to offer our clients more advanced features in their emails without sinking extra time and testing into them. It simply makes things more efficient and understandable. It doesn’t add any bulk or unused code to the project. One of the reasons we are integrating MJML into our email workflow is that it is super lightweight and flexible. The community surrounding it is super helpful, and it’s clear the team who is building it is really listening to their users and care a lot about the project.

Finding information is straightforward and examples were illustrated well. MJML’s documentation is accessible and easy to understand.
