Skip to content
Corven Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Verification code

Render an expiring verification code while keeping issuance and authorization in the host.

This application recipe uses the shared transactional layout. It returns a rendering Effect containing HTML and plain text; it does not submit email or implement the business operation.

import { renderReactEmail } from "@corven/email-sdk/react";
import { transactionalEmailLayout } from "./react-layout.js";

export const verificationCodeEmail = (input: { code: string; expiresIn: string }) =>
  renderReactEmail(
    transactionalEmailLayout({
      heading: "Verify your email",
      preview: "Your verification code",
      paragraphs: [`Your verification code is ${input.code}.`, `It expires in ${input.expiresIn}.`],
    }),
  );

Supply authorized data

Issue, expire and rate-limit codes in your authentication system. Render only the code for the authorized recipient. Never put it in a subject line, URL, telemetry event or model prompt.

Keep URLs and template inputs under host control. React text escaping is not URL validation or a consent check. Treat the rendered body as private message content.

Send the rendered body

Yield the rendering Effect in your application, then supply its body to Email.send with explicit sender and recipients. Apply ordinary provider validation, submission policy and any required approval. The React integration shows this composition.

These recipes are application examples, not additional template exports from the SDK. Rendering and compilation do not establish delivery or compatibility with every email client.