Getting Started
Install Email.md 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 } = 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 thetext/htmlMIME part. Not a fragment — you can send it as-is.text— 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. Includespreheader(inbox preview text) and any custom keys you define. See Frontmatter.
Next Steps
- Theme — Customize colors and fonts
- Frontmatter — Set metadata per-email
- Buttons — Add call-to-action buttons
- Directives — Use header, hero, callout, and more
- API Reference — Full API documentation