Skip to main content
If you would rather build emails from components than from HTML strings or dashboard templates, pass a React element as react. The SDK renders it with React Email and sends the result as html and text.
1

Install the renderer

The SDK itself has no dependencies; the renderer is an optional peer dependency you add when you need it.
React Email’s components (@react-email/components) are optional; plain JSX works too.
2

Write the email

emails/order-shipped.tsx
3

Send it

react works in emails.batch() too; every item is rendered before the request is sent.

What gets sent

  • The component is rendered once to HTML and once to plain text (links and headings preserved), so every email has both parts. Pass your own text to keep the HTML render and skip the text one.
  • The API receives ordinary html and text; the element never leaves your server. Nothing about the message changes on the Sendbaze side.
  • react cannot be combined with html or templateId. Rendering happens in your process, so rendering errors are thrown by send() before any request is made.

Render without sending

renderReactEmail gives you the same output for previews, snapshot tests or storing the HTML in a template:
Options: { text: false } skips the plain-text part; { pretty: true } indents the HTML (larger payload, easier to read).

Runtime notes

  • Rendering uses react-dom/server, which runs on Node.js 18+, Bun and the Edge runtime. On Next.js, keep the send in a route handler or server action.
  • The renderer is loaded on first use with a dynamic import. If it is missing, send() throws Sendbaze: \react` needs the optional peer dependency @react-email/render` with the install command.
  • Images referenced from components must be hosted URLs, or inline attachments addressed with cid:.