API Reference
Exports
Every public export of newsletter-builder-react and newsletter-builder-react/node.
Components and hooks
React
- Full editor. See Components.
- Sandboxed iframe preview of a document.
- Headless editor state with undo and redo.
- The pure reducer behind the hook, useful for tests or other state libraries.
- Initial reducer state.
Functions
Compiler and utilities
- Compile to
{ html, text, subject, preheader, byteSize, warnings }. - Generate only the plain-text alternative.
- Convert inline rich text to plain text, keeping link URLs.
- Deliverability and accessibility checks.
- Replace
{{tags}}. OptionescapeValuesHTML-escapes values. - List tag names used in a string.
- Escape
& < > " '. - Reduce inline HTML to the allowed tag set.
- Return a safe URL or an empty string.
Document helpers
- Empty document with the default theme.
- Starter welcome email.
- Starter product update with columns.
- New block with sensible defaults and a fresh id.
- New columns block.
- Theme based on
DEFAULT_THEME. - Immutable operations over the block tree.
- Unique id generator.
Constants
Constants
- Default light and dark palettes and typography.
- Tags offered by default: first name, last name, company, unsubscribe URL and more.
- Sample values used by previews.
- Email-safe font stacks.
- 102 KB (Gmail clips larger messages).
- Defaults used when creating footer and image blocks.
newsletter-builder-react/node
sendDevEmail options
- Recipient address or addresses.
- Sender address.
- Output from
compileNewsletter(). - SMTP server.
portdefaults to 587 (465 whensecure). For local inboxes pass for example{ host: "localhost", port: 1025 }. - Optional
Reply-Toheader. - Extra headers such as
List-Unsubscribe.