Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mjml Sidecar Laravel Package

spatie/mjml-sidecar

Compile MJML email templates to responsive HTML via AWS Lambda using Sidecar. A companion to spatie/mjml-php: deploy the provided MjmlFunction, then call Mjml::new()->sidecar()->toHtml($mjml) to render HTML without local Node/MJML.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Email Template Standardization: Accelerate adoption of MJML (a markup language for responsive emails) across marketing, sales, and support teams by providing a seamless Laravel-native compilation pipeline. Reduces reliance on manual HTML tweaks or third-party tools like MJML CLI.
  • Performance Optimization: Replace slower PHP-based MJML compilation (e.g., mjml-php) with Sidecar, a faster, Node.js-based alternative, improving build times for high-volume email campaigns (e.g., transactional emails, newsletters).
  • Developer Experience (DX): Enable frontend teams to design emails in MJML (with live previews in tools like MJML Playground) while backend teams compile them to HTML via Laravel, reducing context-switching.
  • Roadmap Alignment:
    • Build vs. Buy: Avoid reinventing MJML compilation logic; leverage Spatie’s battle-tested package instead of custom solutions.
    • Multi-Channel Templates: Extend MJML usage beyond emails to SMS/voice templates (if Sidecar supports other outputs) for unified messaging.
    • Headless CMS Integration: Pair with Laravel-based headless CMS (e.g., October CMS, Strapi) to compile MJML templates dynamically from content APIs.
  • Use Cases:
    • Marketing Campaigns: A/B test email templates with MJML’s responsive components, compile via Laravel queues for scalability.
    • Transactional Emails: Compile order confirmations, password resets, etc., in real-time during user flows.
    • Localization: Store MJML templates in a database (e.g., mjml_content table) and compile per locale dynamically.

When to Consider This Package

  • Adopt if:

    • Your team already uses MJML for email design but struggles with PHP compilation performance or tooling.
    • You’re building a Laravel-based email system (e.g., using Laravel Notifications, Mailgun, or Postmark) and want to standardize on MJML.
    • You need faster compilation than mjml-php (Sidecar is ~2–3x faster for large templates).
    • Your frontend team prefers designing in MJML (with tools like MJML Playground) while backend compiles to HTML.
    • You’re using Sidecar elsewhere in your stack (e.g., for other Node.js-based tasks) and want consistency.
  • Look elsewhere if:

    • You’re not using Laravel/PHP: This package is Laravel-specific; for other stacks, use mjml-php or Sidecar directly.
    • Your emails are simple (no responsive components) and don’t need MJML’s markup benefits.
    • You lack Node.js runtime in your deployment (Sidecar requires Node.js 18+).
    • You need advanced MJML features not supported by Sidecar (e.g., custom components; check Sidecar’s docs).
    • Your team prefers designing in HTML/CSS or using tools like Webflow for emails.

How to Pitch It (Stakeholders)

For Executives:

"We’re about to modernize our email infrastructure to reduce costs and improve speed. Currently, our MJML templates compile slowly via PHP, which delays campaign launches and increases server load. By switching to Spatie’s MJML-Sidecar, we’ll cut compilation time by up to 70%—freeing up dev resources and enabling faster iteration on marketing emails. This is a low-risk, high-reward change: it’s a drop-in replacement for our existing MJML workflow, leverages open-source tools we already trust (Spatie, Sidecar), and aligns with our Laravel stack. The MIT license means no vendor lock-in, and the performance gain directly impacts our bottom line by accelerating revenue-generating campaigns."

Ask: "Approvals needed for Node.js runtime setup and a 2-week pilot with the marketing team’s highest-traffic email template."


For Engineering:

*"This package lets us replace mjml-php with Sidecar for faster, more reliable MJML compilation in Laravel. Key benefits:

  • Performance: Sidecar is optimized for speed (uses Node.js under the hood), reducing compilation time for complex templates from ~500ms to ~150ms.
  • Simplicity: One-line swap in Laravel (Spatie\MjmlSidecar\MjmlCompiler)—no need to manage Node.js globally; Sidecar handles it.
  • DX: Frontend teams can keep designing in MJML (with their preferred tools), while backend compiles to HTML seamlessly.
  • Scalability: Ideal for high-volume emails (e.g., password resets, newsletters) where latency matters.

Implementation Plan:

  1. Pilot: Test with 1–2 high-traffic email templates (e.g., onboarding sequence).
  2. CI/CD: Update deployment to include Node.js 18+ (lightweight; can use Docker or platform-managed runtimes).
  3. Fallback: Keep mjml-php as a backup during migration.

Risks: Minimal—Sidecar is production-ready, and Spatie’s packages have a strong track record. We’ll monitor compilation times and error rates post-migration."*

Ask: "Approval to allocate 1 dev-day for migration and 1 day for testing with the marketing team."

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport