- Do I need Node.js or npm to compile MJML in Laravel with gollumsf/mjml-binary?
- No. The package ships precompiled MJML binaries as a Composer dependency and invokes them through a subprocess (Symfony Process), so you do not need Node.js or npm on your servers or in your Docker images. The trade-off is that you must be able to execute a bundled native binary at runtime, which rules out serverless and edge runtimes.
- How do I install and use gollumsf/mjml-binary in a Laravel app?
- Install it with composer require gollumsf/mjml-binary, then call the bundled binary on a .mjml template through Symfony Process and capture the HTML from stdout. The package was built for MjmlBundle (Symfony), so in Laravel you write a small wrapper service yourself instead of getting config, caching, and template helpers out of the box. There is no service to run, no API key, and no network call at render time.
- Which MJML version is bundled, and how do I upgrade it?
- The shipped binary is effectively frozen at an MJML release from around early 2021, since the package's last release was January 2021. Any newer MJML components or responsive-email fixes are unavailable unless you rebuild or replace the binary yourself. Check the artifact in vendor before assuming a component works, and plan an upgrade path before depending on new MJML features.
- Does this package work on Alpine, ARM64, or Windows?
- Binaries are architecture- and libc-specific, so Alpine (musl), ARM64 (Graviton, Apple Silicon), and Windows are common failure points. Confirm the release assets cover your Docker base image and CI runner before adopting, because your base-image choice becomes constrained by what the package ships. Many teams end up pinning a glibc amd64 image purely to make it run.
- Is gollumsf/mjml-binary compatible with Laravel 10 or 11 and PHP 8.x?
- The package is a thin binary wrapper, so PHP 8.x itself is not the blocker; the real constraint is that it targets MjmlBundle for Symfony, which must be current and compatible with your stack. Because the last release was January 2021, there is no tested or declared support for modern Laravel versions, so you should validate the binary in your own CI before committing. In Laravel you would bypass MjmlBundle entirely and invoke the binary via Process.
- What license does gollumsf/mjml-binary use, and is GPL-3.0 a problem for my SaaS?
- It is licensed GPL-3.0. For internal SaaS email rendering this is usually tolerable, but for redistributed or on-premise-shipped PHP products it is a legal review item and possibly a blocker. Escalate this early rather than assuming it is fine, especially if your product bundles vendor code.
- Does Composer install of this package require network access, and will it work in air-gapped CI?
- Binary distribution packages typically fetch or place a platform-specific artifact during Composer install or post-install scripts, which means network egress and writable paths at build time. Air-gapped or strict CI pipelines will break unless the artifact is vendored or pre-cached in your internal Composer mirror. Test a clean install in a locked-down pipeline before rolling it out.
- Is gollumsf/mjml-binary still maintained, and what are the alternatives if it is abandoned?
- It is effectively unmaintained: last release January 2021, around 3 stars, and 0 dependents, so the bus factor is one. Realistic alternatives are running the MJML npm CLI as a build step, calling a hosted MJML API, or adopting a maintained PHP-native renderer. Decide your exit path now, because templates are portable MJML files and swapping the renderer later is mostly a Dockerfile and pipeline change.
- How should I test MJML email rendering in PHPUnit or Pest with this binary?
- Because rendering happens in a subprocess, your test suite needs the binary available in CI with a matching OS, architecture, and libc. Keep small .mjml fixtures and assert on key output HTML (head styles, media queries, table structure) rather than brittle full-string comparisons. Snapshot tests for a handful of transactional templates catch most regressions from a binary or MJML version change.
- How do I render MJML to HTML in Laravel without MjmlBundle?
- Run the bundled binary through Symfony Process, passing the template via a file path or stdin, and take the compiled HTML from stdout. Wrap that in a service class or queued job so email sending stays out of the request cycle for high-volume transactional mail. Templates remain plain MJML, so migration from an npm build step or a hosted MJML API is mostly Dockerfile and pipeline cleanup.