A Resend email port with a test driver.
@caisson/email is the transactional-email port. Resend is the default
driver, and it sits behind the port like every other vendor in the base — call sites depend on the
port, not the SDK.
The contract
A test driver captures sends in memory, so a suite asserts on what would have been emailed — recipient, template, payload — without a network call or a live key.
import { sendEmail } from "@caisson/email";
await sendEmail({
to: user.email,
template: "verify-email",
data: { url },
});Under the standards gate the same call resolves to the test driver, so email behavior is verified deterministically:
import { testEmail } from "@caisson/email/testing";
// The send is captured, not transmitted.
expect(testEmail.outbox).toHaveLength(1);Related
Jobs
Send email from a job to keep request handlers fast.
Auth
Verification and reset mail ride this port.
This page covers the essentials. The full @caisson/email API reference — the
email port, the Resend driver, and the template contract — is still expanding.