Download the PHP package shyim/mjml-php without Composer

On this page you can find all versions of the php package shyim/mjml-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mjml-php

MJML-PHP

Native PHP port of MJML — the markup language for responsive HTML emails.

MJML-PHP converts MJML markup into responsive HTML that works across all major email clients, including Outlook. No Node.js dependency required.

Requirements

Installation

Usage

Basic

With Options

Custom Components

CLI

A small dependency-free CLI is exposed as Composer bin mjml-php:

Useful options:

Run vendor/bin/mjml-php --help for all options.

Supported Components

Structure

Content

Interactive

Head

Validation

MJML-PHP validates your markup and throws a ValidationException on errors:

Exception Model

All library exceptions extend MjmlPHP\MjmlException, so you can catch them with a single catch:

MjmlException extends \RuntimeException, so existing catch (\RuntimeException $e) blocks still work.

Security

Input is trusted. MJML markup is treated as a template authored by you, not as end-user input. Do not concatenate untrusted strings into MJML markup — attribute values flow into the rendered HTML without HTML-escaping, the same as the official JS MJML.

Defensive measures the renderer already applies:

If you must interpolate user data into MJML, escape it yourself before passing it to the renderer (htmlspecialchars for text content; URL-encode parameters you put into href query strings).

MJML Compatibility

This is a native PHP port aligned with MJML 5.2.1. The HTML output is tested against the original JavaScript implementation using snapshot tests to ensure identical rendering. A CI job re-renders the snapshot fixtures with [email protected] and fails on drift, so if the upstream JS package publishes a patch you may see CI failures — open an issue and regenerate the fixtures.

Limitations

Development

Fixture Tests

Small render and validation cases can be added as .test files under tests/Fixtures/. Use labeled sections:

For simple render fixtures, the legacy shorthand is also supported:

Regenerating Snapshot References

The snapshot test fixtures compare PHP output against reference HTML generated by the JS MJML CLI. To regenerate:

License

MIT


All versions of mjml-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-dom Version *
ext-libxml Version *
tijsverkoyen/css-to-inline-styles Version ^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package shyim/mjml-php contains the following files

Loading the files please wait ...