PHPackages                             vercoutere/laravel-mjml - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. vercoutere/laravel-mjml

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

vercoutere/laravel-mjml
=======================

A package that allows you to use MJML templates within your Laravel mailables.

v0.4.0(2y ago)15722MITPHPPHP ^8.2.0

Since Jun 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Vercoutere/laravel-mjml)[ Packagist](https://packagist.org/packages/vercoutere/laravel-mjml)[ RSS](/packages/vercoutere-laravel-mjml/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (7)Versions (5)Used By (0)

[![Run tests](https://github.com/Vercoutere/laravel-mjml/actions/workflows/run-tests.yml/badge.svg)](https://github.com/Vercoutere/laravel-mjml/actions/workflows/run-tests.yml)

Installation
============

[](#installation)

Installing this package is done using Composer:

```
composer require vercoutere/laravel-mjml

```

Configuration
=============

[](#configuration)

Rendering strategies
--------------------

[](#rendering-strategies)

There are two available strategies to use for rendering MJML using this package:

- `local`: Uses a local MJML binary.
- `api`: Uses the publicly available [MJML API](https://mjml.io/api).

The strategy can be configured using an environment variable.

```
MJML_STRATEGY=local/api

```

### Local strategy

[](#local-strategy)

To use the local strategy you will need to have both NodeJS and MJML installed on your machine. It is recommended to install MJML using the available [npm package](https://www.npmjs.com/package/mjml).

If you're not installing MJML using the npm package, you will also need to configure the path to your MJML installation:

```
MJML_BINARY_PATH=/path/to/your/mjml/installation

```

### API strategy

[](#api-strategy)

When using the API strategy, you will need to configure your application id and secret.

```
MJML_APP_ID=your-app-id
MJML_SECRET_KEY=your-secret

```

View caching
------------

[](#view-caching)

The MJML compiler implementation extends Laravel's Blade compiler. This means that view caching behaves the same and can be managed using the `view:cache` Artisan command and the `view.cache` config variable.

Usage
=====

[](#usage)

To use MJML in your mailables, make sure your mails extend the `Vercoutere\LaravelMjml\MjmlMailable` class instead of the default `Illuminate\Mail\Mailable` class.

```
use Illuminate\Mail\Mailables\Content;
use Vercoutere\LaravelMjml\MjmlMailable;

class MyMail extends MjmlMailable
{
    public function content(): Content
    {
        return new Content(
            view: 'my-template',
        );
    }
}
```

The template files you want to use in an MJML mailable must have a `.mjml.blade.php` extension.

> Blade directives in MJML templates must be wrapped in `mj-raw` tags to prevent the MJML engine from trying to parse them.

```

        @if (true)
        {{ App::environment() }}
        @endif

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~92 days

Total

4

Last Release

835d ago

PHP version history (2 changes)0.1.0PHP ^8.1.0

v0.3.0PHP ^8.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a5e5ad815b4d37376a61a3815df0b866f7a2148dfb02d8011c1a48b7f8504d0?d=identicon)[Vercoutere](/maintainers/Vercoutere)

---

Top Contributors

[![Vercoutere](https://avatars.githubusercontent.com/u/3820377?v=4)](https://github.com/Vercoutere "Vercoutere (17 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vercoutere-laravel-mjml/health.svg)

```
[![Health](https://phpackages.com/badges/vercoutere-laravel-mjml/health.svg)](https://phpackages.com/packages/vercoutere-laravel-mjml)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M993](/packages/statamic-cms)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
