Skip to content

bryonbean/mjml

Repository files navigation

MJML Compilation for PHP

Description

A PHP API for MailJet's mjml transpiler.

Installation

$ composer require bryonbean/mjml

Requirements

  • The npm executable must be available in PATH.
  • The node executable must be located at /usr/local/bin/node

Usage

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');

Contributing

Pull requests are welcome. For major changes please open an issue first to discuss what you would like to change.

License

MIT

About

MJML Compiler for PHP

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages