_Email.md_

Getting Started

Install Email.md 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 } = render(`
# Welcome!

Thanks for signing up.

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

The render function returns:

  • html — a complete HTML document (DOCTYPE, html, head, body) ready to use as the text/html MIME part. Not a fragment — you can send it as-is.
  • text — 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. Includes preheader (inbox preview text) and any custom keys you define. See Frontmatter.

Next Steps

On this page