_emailmd_

Getting Started

Install emailmd and render your first email.

Installation

npm install emailmd

Basic Usage

Import the render function and pass it a markdown string:

import { render } from "emailmd";

const { html, text } = await render(`
# Welcome!

Thanks for signing up.

[Get Started](https://example.com){button}
`);

render is asynchronous, so await it (or use .then()).

The render function returns:

  • html: a complete HTML document (DOCTYPE, html, head, body) ready to use as the text/html MIME part. It's not a fragment; you can send it as-is.
  • text: the plain text version for the text/plain MIME part. Buttons become Label: https://url, images become [Image: alt], and all formatting is stripped.
  • meta: frontmatter metadata extracted from the markdown, including preheader (inbox preview text) and any custom keys you define. See Frontmatter.

Next Steps

  • Builder: write markdown and watch the email render live
  • Templates: production-ready designs to start from
  • Buttons: add call-to-action buttons
  • Directives: heroes, columns, callouts, and more
  • Theme: customize colors, fonts, and dark mode
  • API Reference: full API documentation

On this page