vineyard/statamic-mjml

There is no license information available for the latest version (v1.0.1) of this package.

v1.0.1 2025-03-10 00:08 UTC

This package is auto-updated.

Last update: 2025-05-02 17:24:44 UTC


README

A MJML tag for Statamic that parses MJML into HTML.

How to Install

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

composer require vineyard/statamic-mjml

Publish the addon's config file:

php artisan vendor:publish --provider="Vineyard\StatamicMjml\ServiceProvider"

Get an MJML API key from https://mjml.io/api. This is required. Add it to your .env file as "MJML_API_KEY" or change the API key value in your config/statamic-mjml.php file.

How to Use

In your Antlers template, wrap any chunk of MJML in a new {{ mjml }} tag and it will be converted to HTML.

{{ mjml }}

    <mj-body>
        <mj-section>
            <mj-column>
                <mj-text font-family="Helvetica" color="#F45E43">
                    <h1>Title</h1>
                    <p>Paragraph</p>
                    <p style="font-family:Comic Sans Ms">Another paragraph</p>
                </mj-text>
            </mj-column>
        </mj-section>
    </mj-body>

{{ /mjml }}