HTML email is broken. Every client renders differently, inline styles are mandatory, and half of CSS doesn't work. Most teams end up copy-pasting fragile HTML between campaigns and hoping nothing breaks in Outlook.
Send Stack fixes this. It's a CLI tool that combines MJML and Handlebars into a simple templating workflow — layouts, partials, variables, and a live preview server — so you can build emails the same way you build any other frontend: with components, data, and a dev server.
Write clean markup. Get production-ready HTML that works everywhere.
npm install
npm run buildCompile all templates into production-ready HTML:
npm run buildBuild a single template:
npm run dev -- build -t welcomeMinify output:
npm run dev -- build -mStart a live preview server with hot reload:
npm run previewOpens on http://localhost:3000 by default. Change the port with -p:
npm run dev -- preview -p 8080Scaffold a new email template:
npm run dev -- new -n my-templateThis creates:
templates/emails/my-template.mjml— your email markupdata/my-template.json— template variables
Check all templates for issues:
npm run dev -- validateinspiration/ Screenshots of reference designs (gitignored)
templates/
layouts/ Base MJML layouts
partials/ Reusable components (header, footer, button)
emails/ Individual email templates
data/ JSON data files for each template
assets/ Images and static files
dist/ Compiled HTML output (gitignored)
src/ CLI and build tooling
The typical workflow for creating a new email:
- Find inspiration. Browse sites like Really Good Emails, Email Love, or similar galleries. Screenshot the designs you want to approximate.
- Drop screenshots in
inspiration/. This folder is gitignored, but it's where you (or a CLI agent) reference the visual direction for your templates. - Scaffold a template. Run
npm run dev -- new -n my-templateto create the MJML and data files. - Build the template. Write your markup in MJML with Handlebars expressions, referencing the screenshots in
inspiration/for layout, typography, and spacing cues. - Preview. Run
npm run previewto see your email in the browser with hot reload. - Validate and build. Run
npm run validateto check for issues, thennpm run buildfor production-ready HTML.
- Write your email in MJML with Handlebars expressions
- Define variables in a matching JSON data file
- Handlebars compiles the template with your data
- MJML converts the result to cross-client compatible HTML
Templates can extend layouts and include partials, keeping your emails DRY.
Node.js 18+
ISC