Symfony and MJML. Sending emails like a professional

Basic guide to send emails using the MJML and Symfony language

Image for post
Image for post
Photo by Carol Jeng on Unsplash

What is MJML?

Basic structure of an email with MJML

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Integrating MJML with Symfony and Twig

yarn add mjml
Image for post
Image for post
mjml templates/emails/mjml/*.mjml.html.twig -o templates/emails
"scripts": {"build:email": "mjml templates/emails/mjml/*.mjml.html.twig -o templates/emails"},
yarn build:email

Escape tags within MJML

Image for post
Image for post
Image for post
Image for post

Final thoughts

Do you want to read more articles like this?

Entre paseo y paseo con Simba desarrollo en Symfony y React