The Node SDK renders React Email components in your application into HTML and plain text before sending. React code is never uploaded or executed by RavenRelay. Existing HTML and text sending does not require React.
React and react-email are optional peer dependencies of the SDK. Install both for the example below: WelcomeEmail uses React Email components internally, and passing the react field makes the SDK load React Email’s renderer to generate HTML and plain text. Your application does not need to import react-email directly when using a starter component.
Welcome email · TSX
import { RavenRelay } from"@ravenrelay/node";import { WelcomeEmail } from"@ravenrelay/node/templates";const client = new RavenRelay({ apiKey: process.env.RAVENRELAY_API_KEY!, baseUrl: "https://api-production-1c6a.up.railway.app",});await client.emails.send({from: "accounts@example.com", to: "user@example.com", subject: "Welcome to your account", react: <WelcomeEmail appName="Your app" name="Joshua" actionUrl="https://example.com/account" />,}, { idempotencyKey: "welcome-user-123" });
Starter components include WelcomeEmail, VerificationEmail, PasswordResetEmail and ReceiptEmail. They contain no RavenRelay branding. You can also pass your own React Email component.
If you send HTML, plain text or a saved dashboard template instead of a React component, install only the SDK. React and react-email are not required for those sends.
Browse the four built-in Node.js templates below. Each preview uses the same SDK component as its copyable TSX example. All props are required strings. These examples use sample values; supply your own app name, recipient details and action URLs. Your application generates and validates verification and password-reset links.
Welcome
Introduce your product and help new users get started.
Open Templates in your project to create a named HTML or plain-text template. Its slug is unique within that project. Use flat placeholders such as {{name}} in the subject and body, then preview with sample JSON values. Owners, administrators and developers can create, edit and delete; viewers can read and preview.
Supply every placeholder and no extra variables. Values may be strings, finite numbers or booleans. HTML values are escaped; placeholders do not execute code, access nested properties or inject raw HTML. Use quoted HTML attributes and validate action URLs in your application.
Saved template sends use the same API keys, domain restrictions, recipient limits, quota checks and suppression rules as other sends. Accepted messages retain their rendered content. Editing or deleting a template cannot change queued messages; retrying the same idempotency key and input reuses the original accepted message.