PHPackages                             spatie/mjml-sidecar - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. spatie/mjml-sidecar

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

spatie/mjml-sidecar
===================

Compile MJML to HTML using Sidecar

1.1.1(10mo ago)1342.6k—8%3[1 PRs](https://github.com/spatie/mjml-sidecar/pulls)MITPHPPHP ^8.1CI passing

Since Aug 23Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/spatie/mjml-sidecar)[ Packagist](https://packagist.org/packages/spatie/mjml-sidecar)[ Docs](https://github.com/spatie/mjml-sidecar)[ RSS](/packages/spatie-mjml-sidecar/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (15)Versions (10)Used By (0)

Compile MJML to HTML using Sidecar
==================================

[](#compile-mjml-to-html-using-sidecar)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d22b10429f4dfaf02d423bc5dc4588576d808a08e5e9f0f2b824c7ad0434cb84/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6d6a6d6c2d736964656361722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/mjml-sidecar)[![GitHub Tests Action Status](https://camo.githubusercontent.com/eaf6a2a44d59a2d8270d6ddf2cc7c59c24626e2af101c0852f92a7fbdfe7d771/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f6d6a6d6c2d736964656361722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/spatie/mjml-sidecar/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/3b0b6e4bed69fbfadde566287ad69d80c744d58a307fa4c34c5c53bb5abb0bcd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7370617469652f6d6a6d6c2d736964656361722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/spatie/mjml-sidecar/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/99f1da9f73d54096bf4ab237148698397710a2384fd280df6c0f0c8516973108/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6d6a6d6c2d736964656361722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/mjml-sidecar)

This is a companion package to [mjml-php](https://github.com/spatie/mjml-php) that runs compilation through [Sidecar](https://hammerstone.dev/sidecar) instead.

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/e7b68a3a799da6f68abadf177a247fe1a8ab136c4faf1ed5f47db205ccae16df/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6d6a6d6c2d736964656361722e6a70673f743d31)](https://spatie.be/github-ad-click/mjml-sidecar)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require spatie/mjml-sidecar
```

Register the `MjmlFunction` in your `sidecar.php` config file.

```
/*
 * All of your function classes that you'd like to deploy go here.
 */
'functions' => [
    \Spatie\MjmlSidecar\MjmlFunction::class,
],
```

Deploy the Lambda function by running:

```
php artisan sidecar:deploy --activate
```

See the [Sidecar documentation](https://hammerstone.dev/sidecar/docs/main/functions/deploying) for details.

Usage
-----

[](#usage)

For usage, check the [mjml-php](https://github.com/spatie/mjml-php) documentation.

All the methods are available, just make sure to add `->sidecar()`, for example:

```
Mjml::new()->sidecar()->toHtml($mjml);
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Rias Van der Veken](https://github.com/spatie)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance73

Regular maintenance activity

Popularity39

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~172 days

Total

5

Last Release

309d ago

Major Versions

0.0.1 → 1.0.02023-08-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (14 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (13 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (11 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (9 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (4 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (2 commits)")[![danielboendergaard](https://avatars.githubusercontent.com/u/314877?v=4)](https://github.com/danielboendergaard "danielboendergaard (1 commits)")

---

Tags

mailsmjmlsidecarspatielaravelmjml-sidecar

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/spatie-mjml-sidecar/health.svg)

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

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[wnx/sidecar-browsershot

A Sidecar function to run Browsershot on Lambda.

2331.5M5](/packages/wnx-sidecar-browsershot)[spatie/laravel-support-bubble

A non-intrusive support chat bubble that can be displayed on any page

391173.6k](/packages/spatie-laravel-support-bubble)[spatie/laravel-rdap

Perform RDAP queries in a Laravel app

72108.3k2](/packages/spatie-laravel-rdap)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)

PHPackages © 2026

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