Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Configuration Language Lock 1.0.2 Minor update available for module config_language_lock (1.0.2). Release: Canvas Override 1.0.1 Minor update available for module canvas_override (1.0.1). Release: Media Remote Image 8.x-1.2 Minor update available for module media_entity_remote_image (8.x-1.2). Release: IDNA Convert Service (punycode) 2.0.4 Minor update available for module idna (2.0.4). Release: Bootstrap Cloud 7.1.3 Minor update available for theme bootstrap_cloud (7.1.3). Release: Token Browser 1.0.2 Minor update available for module token_browser (1.0.2). Release: Varbase Project 11.0.8 Minor update available for module varbase_project (11.0.8). Release: Media Remote Image 2.0.0-beta1 First beta version released for module media_entity_remote_image (2.0.0-beta1). Usage Milestone: Term CSV Export Import Module term_csv_export_import crossed 1,000 active installs. Security Coverage: Module Scout Module module_scout now has official Drupal security advisory coverage.

MJML Render Devel

1 sites Security covered Drupal 11 · not 10
View on drupal.org

This module offers a development tool to preview MJML email templates directly in your browser. It automatically finds your MJML templates, allows you to provide mock data, and shows you how the emails will render across different email client viewports, with options to view the source, parsed, or final HTML.

MJML Render Devel provides a browser-based preview UI for MJML email templates. Discover, render with mock data, and preview emails across client viewports — without sending a single email.

Features

Template Discovery
Automatically scans all enabled themes and modules for .html.twig.mjml files and presents them in a grouped listing page — organized by themes and modules — so you can quickly find and select any MJML template in your project.
Three View Modes
  • Source — raw template file contents with syntax highlighting
  • Parsed — split view showing the Twig→MJML intermediate output and the MJML→HTML final output side-by-side, with copy buttons for each panel
  • Preview — rendered HTML in a sandboxed iframe with email client viewport emulation
Email Client Emulation
Switch between preset viewport widths that match popular email clients — Gmail (640px), Outlook (600px), iOS (375px), Android (360px), and Tablet (768px). Toggle dark mode to test dark background rendering.
Variable Introspection & Mock Data
Statically analyzes the template (and its {% include %} dependencies) via Twig AST to discover all expected variables. The sidebar auto-generates a form where you can provide mock values. Supports structured form inputs, raw JSON editing, and named presets stored in localStorage.
Live Reload
Toggle Live Reload to automatically re-render the preview whenever a template file (or any of its included dependencies) changes on disk. Uses lightweight polling — no WebSockets or additional server configuration required.
Navigation Module Integration
When Drupal Core's Navigation module is enabled, the MJML Preview link automatically appears as a top-level item in the Navigation sidebar for quick access during development.

Use Cases

A Technical Deep Dive into Drupal's MJML Render Engine
by Golems GABB

Post-Installation

After enabling the module, navigate to Administration → Configuration → Development → MJML Preview. The landing page will list all discovered .html.twig.mjml templates grouped by theme and module.

Click any template to open the preview page. Fill in mock variable values in the sidebar panel and click Render to see the output. Use the tab bar to switch between Source, Parsed, and Preview views. In Preview mode, use the email client toolbar to test different viewport widths.

To prevent the module from leaking into production configuration exports, add the following to your settings.php:

$settings['config_exclude_modules'][] = 'mjml_render_devel';

Additional Requirements

  • Drupal 11.3.0 or later
  • MJML Render Engine — the Twig MJML theme engine (installed automatically as a dependency)
  • MJML Render Binary — the standalone MJML binary (installed as a transitive dependency of MJML Render Engine; no Node.js required at runtime)
  • Navigation (Drupal Core) — when enabled, MJML Preview appears as a top-level item in the admin sidebar for quick access
  • Symfony Mailer — for a complete email sending solution alongside MJML template rendering

Similar projects

There is currently no known Drupal module that provides a dedicated preview UI specifically for MJML email templates. Generic template preview tools exist, but they do not handle the two-stage Twig→MJML→HTML rendering pipeline or provide email client viewport emulation.

  • Canvas (Experience Builder) — a visual page builder for Drupal content; operates in a different domain (pages/components vs. email templates) but served as design inspiration for the preview UI layout

Supporting this Module

If you find this module useful, consider contributing back by submitting bug reports, feature requests, or patches in the issue queue.

Community Documentation

See the MJML Render Engine project page for documentation on creating MJML email themes and templates in Drupal.

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
5
Tracked since
Apr 2026
Latest release
3 months ago
Releases (12 mo)
5 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.0 Stable 11 May 27, 2026
1.0.0-alpha4 Pre-release 11 May 11, 2026
1.0.0-alpha3 Pre-release 11 Apr 28, 2026
1.0.0-alpha2 Pre-release 11 Apr 28, 2026
1.0.0-alpha1 Pre-release 11 Apr 28, 2026