Getting Started
Install emailmd and render your first email.
Installation
npm install emailmdBasic 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 thetext/htmlMIME part. It's not a fragment; you can send it as-is.text: the plain text version for thetext/plainMIME part. Buttons becomeLabel: https://url, images become[Image: alt], and all formatting is stripped.meta: frontmatter metadata extracted from the markdown, includingpreheader(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