Drupal is a registered trademark of Dries Buytaert
cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)!

Standalone MJML to HTML renderer for PHP with pre-built binaries. No Node.js required at runtime.

This package provides a self-contained MJML binary and a PHP wrapper that converts MJML markup into responsive HTML email. It is designed to be used as a dependency of the MJML Render Engine module, but can also be used independently in any PHP project.

How It Works

MJML is a markup language for building responsive emails. Normally it requires Node.js to render. This package eliminates that requirement by shipping pre-built standalone binaries compiled with @yao-pkg/pkg — the Node.js runtime is embedded directly in the binary.

A Composer plugin automatically detects your platform during composer install and downloads the correct binary from a platform-specific release tag. The binary is placed at a single known path: vendor/drupal/mjml_render_bin/bin/mjml.

Supported Platforms

Platform Architecture Linux x64 Linux ARM64 macOS (Darwin) x64 macOS (Darwin) ARM64

Installation

composer require drupal/mjml_render_bin

Usage


use Drupal\mjml_render_bin\MjmlBinaryRenderer; $renderer = new MjmlBinaryRenderer(); $html = $renderer->render('<mjml><mj-body>...</mj-body></mjml>');

Custom Binary Path

You can provide a custom binary path:

$renderer = new MjmlBinaryRenderer('/path/to/custom/mjml');

When used with the MJML Render Engine module, configure the path in settings.php:

$settings['mjml_render_bin.path'] = '/path/to/custom/mjml';

Building a Custom Binary with Docker

Build the latest MJML binary without installing Node.js locally:


# Latest version for Linux x64 docker run --rm -v $(pwd)/custom-bin:/output node:22-alpine sh -c \ "npm install -g mjml @yao-pkg/pkg && \ pkg \$(which mjml) -t node22-linuxstatic-x64 -o /output/mjml" # Specific version (e.g., 4.15.3) docker run --rm -v $(pwd)/custom-bin:/output node:22-alpine sh -c \ "npm install -g [email protected] @yao-pkg/pkg && \ pkg \$(which mjml) -t node22-linuxstatic-x64 -o /output/mjml"

Release Strategy

This package uses a branching strategy to deliver platform-specific binaries without bloating the main package:

  • The main branch contains only PHP code (~50KB)
  • Platform branches (linux-x64, darwin-arm64, etc.) contain the same code plus the binary
  • Stable tags (e.g., 1.0.0) are created on main
  • Platform-suffixed tags (e.g., 1.0.0-linux-x64) are created on platform branches
  • The Composer plugin automatically downloads the binary from the matching platform tag

Activity

Total releases
8
First release
Apr 2026
Latest release
2 weeks ago
Release cadence
4 days
Stability
25% stable

Release Timeline

Releases

Version Type Release date
1.0.1 Stable May 28, 2026
1.0.0 Stable May 3, 2026
1.0.0-beta5 Pre-release May 3, 2026
1.0.0-beta2 Pre-release May 3, 2026
1.0.0-beta1 Pre-release May 3, 2026
1.0.x-dev Dev May 3, 2026
1.0.0-beta4 Pre-release Apr 27, 2026
1.0.0-beta3 Pre-release Apr 27, 2026