Getting started

Introduction

Learn what comark-email is, how it converts Comark Markdown to MJML email HTML, and why it runs on Node.js only.

comark-email is the email renderer for Comark. It converts Markdown — with frontmatter, bindings and email layout components — into responsive HTML that email clients can display. MJML compiles on the server; you pass the result to your email provider.

Node.js only. MJML compiles on the server. Do not import comark-email in browser-only bundles.

What it does

  • Renders email HTML from a markdown string or a pre-parsed Comark document
  • Extracts metadata — subject, previewText and a plain-text fallback alongside html
  • Maps layout components — ::email-button, ::email-columns, ::email-divider to native MJML tags
  • Merges configuration from frontmatter aliases, frontmatter.email and renderer options

When to use it

Use comark-email when you:

  • Send transactional or marketing email from Comark templates
  • Need MJML-compiled HTML without hand-writing MJML
  • Share one markdown source between web and email (with locale-specific files)
  • Want reusable renderers with shared brand defaults

Peer dependencies

comark and @comark/html are peer dependencies. mjml ships as a regular dependency.

Copyright © 2026