https://github.com/spatie/mjml-sidecar
Compile MJML to HTML using Sidecar
https://github.com/spatie/mjml-sidecar
mails mjml sidecar
Last synced: 3 days ago
JSON representation
Compile MJML to HTML using Sidecar
- Host: GitHub
- URL: https://github.com/spatie/mjml-sidecar
- Owner: spatie
- License: mit
- Created: 2023-08-23T15:33:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-27T08:52:14.000Z (29 days ago)
- Last Synced: 2025-03-27T09:38:30.392Z (29 days ago)
- Topics: mails, mjml, sidecar
- Language: PHP
- Homepage: https://freek.dev/2549-convert-mjml-to-html-using-php
- Size: 2.75 MB
- Stars: 7
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Compile MJML to HTML using Sidecar
[](https://packagist.org/packages/spatie/mjml-sidecar)
[](https://github.com/spatie/mjml-sidecar/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/spatie/mjml-sidecar/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[](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
[
](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
You can install the package via composer:
```bash
composer require spatie/mjml-sidecar
```Register the `MjmlFunction` in your `sidecar.php` config file.
```php
/*
* All of your function classes that you'd like to deploy go here.
*/
'functions' => [
\Spatie\MjmlSidecar\MjmlFunction::class,
],
```Deploy the Lambda function by running:
```shell
php artisan sidecar:deploy --activate
```See the [Sidecar documentation](https://hammerstone.dev/sidecar/docs/main/functions/deploying) for details.
## 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:
```php
Mjml::new()->sidecar()->toHtml($mjml);
```## Testing
```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Rias Van der Veken](https://github.com/spatie)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.