PHPackages                             zellien/zellien-mjml - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. zellien/zellien-mjml

ActiveLibrary[Templating &amp; Views](/categories/templating)

zellien/zellien-mjml
====================

PHP library for rendering MJML templates

v1.0.1(1y ago)010MITPHPPHP ~8.1.0 || ~8.2.0 || ~8.3.0

Since Jun 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/zellien/zellien-mjml)[ Packagist](https://packagist.org/packages/zellien/zellien-mjml)[ Docs](https://github.com/zellien/zellien-mjml)[ RSS](/packages/zellien-zellien-mjml/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

zellien-mjml
============

[](#zellien-mjml)

PHP library for rendering MJML templates

[![Static Badge](https://camo.githubusercontent.com/f0f21083a7db4d873f931d29d467c9469b9113410499f3e2f69b0a9a3b226cd9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d7a656c6c69656e2532467a656c6c69656e2d2d6d6a6d6c2d626c75653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/f0f21083a7db4d873f931d29d467c9469b9113410499f3e2f69b0a9a3b226cd9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d7a656c6c69656e2532467a656c6c69656e2d2d6d6a6d6c2d626c75653f7374796c653d666c61742d737175617265)[![Static Badge](https://camo.githubusercontent.com/3205353fe556f1389d668fc05d6ca2414bc2119ddd73e9fcb5c2ff4970379462/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d627269676874677265656e3f7374796c653d666c61742d73717561726526636f6c6f723d253233346435383865)](https://camo.githubusercontent.com/3205353fe556f1389d668fc05d6ca2414bc2119ddd73e9fcb5c2ff4970379462/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d627269676874677265656e3f7374796c653d666c61742d73717561726526636f6c6f723d253233346435383865)

Installation
------------

[](#installation)

The preferred method of installation is via Composer. Run the following command to install the package and add it as a requirement to your project's

```
composer require zellien/zellien-mjml
```

Usage
-----

[](#usage)

Create an instance of the MjmlRenderer class by passing the configuration array to the constructor. The configuration array should contain the application\_id and secret\_key as non-empty strings.

Call the render method on the $renderer object, passing the MJML template as a non-empty string. It will return the rendered HTML as a non-empty string.

```
$mjmlTemplate = 'Your MJML template goes here';
$renderedHtml = $renderer->render($mjmlTemplate);
```

Handle the potential exceptions that can be thrown by the render method:

- `BadRequestException` if the request is invalid.
- `UnauthorizedException` if authentication fails.
- `ForbiddenException` if the request is unauthorized.
- `UnexpectedErrorException` if an unexpected error occurs.

```
try {
    $renderedHtml = $renderer->render($mjmlTemplate);
} catch (BadRequestException $e) {
    // Handle bad request error
} catch (UnauthorizedException $e) {
    // Handle unauthorized error
} catch (ForbiddenException $e) {
    // Handle forbidden error
} catch (UnexpectedErrorException $e) {
    // Handle unexpected error
}
```

Additional Notes
----------------

[](#additional-notes)

> Make sure you have the necessary dependencies installed, such as the cURL extension.
>
> Ensure that the API URL () is accessible from your environment.

That's it! You can now utilize the MjmlRenderer library in your project to render MJML templates using the API.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance44

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~614 days

Total

2

Last Release

441d ago

PHP version history (2 changes)v1.0.0PHP ~8.1.0 || ~8.2.0

v1.0.1PHP ~8.1.0 || ~8.2.0 || ~8.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4817662f4693ae4b91c1caa92f73bd64f43f06daebba7c019de34d1c97bd6ca5?d=identicon)[zellien](/maintainers/zellien)

---

Top Contributors

[![zellien](https://avatars.githubusercontent.com/u/445095?v=4)](https://github.com/zellien "zellien (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/zellien-zellien-mjml/health.svg)

```
[![Health](https://phpackages.com/badges/zellien-zellien-mjml/health.svg)](https://phpackages.com/packages/zellien-zellien-mjml)
```

###  Alternatives

[moonshine/moonshine

Laravel administration panel

1.3k217.1k59](/packages/moonshine-moonshine)[laminas/laminas-view

Fast and type safe HTML templating library with a flexible plugin system supporting multistep template composition

7526.3M230](/packages/laminas-laminas-view)[qossmic/rich-model-forms-bundle

Provides additional data mapper options that ease the use of the Symfony Form component with rich models.

218278.7k](/packages/qossmic-rich-model-forms-bundle)[rareloop/lumberjack-core

A powerful MVC framework for the modern WordPress developer. Write better, more expressive and easier to maintain code

42155.0k19](/packages/rareloop-lumberjack-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
