defectivecode/mjml
| Install | |
|---|---|
composer require defectivecode/mjml |
|
| Latest Version: | 3.0.0 |
| PHP: | >=8.4 |
| License: | MIT |
| Last Updated: | Jun 30, 2026 |
| Links: | GitHub · Packagist |
English | العربية | বাংলা | Bosanski | Deutsch | Español | Français | हिन्दी | Italiano | 日本語 | 한국어 | मराठी | Português | Русский | Kiswahili | தமிழ் | తెలుగు | Türkçe | اردو | Tiếng Việt | 中文
Introduction
MJML is a markup language specifically designed to simplify the process of coding responsive emails. Its semantic syntax ensures ease and simplicity, while its extensive library of standard components accelerates development and reduces the complexity of your email codebase. The open-source engine of MJML generates high-quality, responsive HTML that adheres to best practices. If you've experienced the frustrations of working with Outlook, this package is tailored for you.
Our MJML implementation serves as a wrapper for the official MJML API. It enables convenient compilation of MJML into HTML directly within PHP, without the need for NodeJS. This package is ideal for PHP applications that wish to incorporate MJML without the hassle of installing NodeJS and the MJML CLI.
Example
// Without Laravel
(new MJML)->render(
'<mjml><mj-body><mj-section><mj-column><mj-text>Hello World</mj-text></mj-column></mj-section></mj-body></mjml>'
);
// Minified HTML
(new MJML)->minify()->render(
'<mjml><mj-body><mj-section><mj-column><mj-text>Hello World</mj-text></mj-column></mj-section></mj-body></mjml>'
);
// With Laravel
MJML::render(
'<mjml><mj-body><mj-section><mj-column><mj-text>Hello World</mj-text></mj-column></mj-section></mj-body></mjml>'
);
// With Laravel and minified HTML
MJML::minify()->render(
'<mjml><mj-body><mj-section><mj-column><mj-text>Hello World</mj-text></mj-column></mj-section></mj-body></mjml>'
);
Documentation
You may read the documentation on our website.
License
The MIT License (MIT). Please see License File for more information.
Related Packages
This Laravel Eloquent extension provides recursive relationships using common ta...
laravel 中轻松容易的输出完整的 SQL 语句。 - Easy output of complete SQL statemen...