#14755·spree

Liquid and MJML Email Templates

Author: damianlegawiecCreated Sep 25, 2026Updated Sep 25, 2026

Transactional emails are the last HTML Spree renders through Rails views. This plan replaces all 61 ActionMailer ERB templates (16 mailers across spree_core and spree_emails) with Liquid templates written in MJML. Liquid fills in the data first, then MJML turns the result into email-safe HTML, using the mrml gem (no Node). Templates read plain JSON from email serializers, never models.

This makes the templates portable (Liquid also runs in Node through liquidjs), safe to hand to merchants later, and much shorter than today's hand-written HTML tables. Merchant editing in the dashboard, database-stored templates and live previews come later on this foundation. Action Mailer still delivers every email.

Status: design finalized, nothing built.

Migration path

  1. Move Alba into spree_core, together with its setup.
  2. Build the renderer and resolver in spree_core: liquid and mrml, the lookup chain with a deprecated ERB step, HTML escaping by default, render limits, filters, and plain-text generation.
  3. Rebuild the layout and partials in MJML.
  4. Migrate the core mailers, then the spree_emails mailers, each with its email serializer and a render spec.
  5. Write the docs: the override guide, a generated variable reference, and the upgrade note.
  6. In 6.2, remove the ERB fallback.

Plan: https://github.com/spree/spree/blob/main/docs/plans/6.1-liquid-mjml-emails.md

Tracked in Linear as V-3720