Drupal is a registered trademark of Dries Buytaert
drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! linkit 7.0.14 Minor update available for module linkit (7.0.14). masquerade 8.x-2.2 Minor update available for module masquerade (8.x-2.2). video_embed_field 3.1.0 Minor update available for module video_embed_field (3.1.0). bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). editoria11y 3.0.0 Major update available for module editoria11y (3.0.0). trash 3.0.27 Minor update available for module trash (3.0.27). twig_tweak 4.0.0-alpha2 New alpha version released for module twig_tweak (4.0.0-alpha2). twig_tweak 4.0.0-alpha1 First alpha version released for module twig_tweak (4.0.0-alpha1). node_revision_delete 2.1.1 Minor update available for module node_revision_delete (2.1.1). commerce_paypal 2.1.2 Minor update available for module commerce_paypal (2.1.2).

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.

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.

Activity

Total releases
2
First release
Apr 2026
Latest release
4 hours ago
Release cadence
0 days
Stability
0% stable

Releases

Version Type Release date
1.0.0-alpha2 Pre-release Apr 28, 2026
1.0.0-alpha1 Pre-release Apr 28, 2026