A PHP API for MailJet's mjml transpiler.
$ composer require bryonbean/mjml
- The
npm
executable must be available in PATH. - The node executable must be located at
/usr/local/bin/node
use Mjml\Factory;
use Mjml\Compiler;
$mjml = '
<mjml>
<mj-body>
<mj-section>
<mj-raw><p>Hello world</p></mj-raw>
</mj-section>
</mj-body>
</mjml>
';
$factory = new Factory();
$compiler = new Compiler($factory);
$compiler->compile($mjml, '/path/to/my/template');
Pull requests are welcome. For major changes please open an issue first to discuss what you would like to change.