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)15032MITPHPPHP ^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 1mo ago

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 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

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

781d 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

[spatie/laravel-failed-job-monitor

Get notified when a queued job fails

1.0k2.6M4](/packages/spatie-laravel-failed-job-monitor)[civicrm/civicrm-core

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

728272.9k20](/packages/civicrm-civicrm-core)[vemcogroup/laravel-sparkpost-driver

SparkPost driver to use with Laravel 6.x|7.x|8.x|9.x|10.x

421.7M1](/packages/vemcogroup-laravel-sparkpost-driver)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[spatie/mailcoach

Self-host Mailcoach

4007.0k](/packages/spatie-mailcoach)[guanguans/notify

Push notification SDK(AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

682104.9k7](/packages/guanguans-notify)

PHPackages © 2026

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