sendTemplate method from anywhere in the API.
It’s a plugin — installing it merges the @ship/emails package (packages/emails) into your repo, so every template and the service itself are yours to edit.
The package
@ship/emails exports a single emailService plus the template types:
packages/emails/src/index.ts
template.ts — a Template union, the EmailComponent map, and a TemplateProps map that ties each template to its prop type:
packages/emails/src/template.ts
template: 'verify-email' and TypeScript requires exactly VerifyEmailProps.
Sending email
ImportemailService and call sendTemplate. The params are checked against the chosen template’s props:
apps/api/src/auth.ts
sendTemplate renders the React component to HTML and hands it to Resend:
packages/emails/src/email.service.ts
With no
RESEND_API_KEY, sendTemplate logs the email payload and returns null instead of sending — so local development and tests never hit Resend.Configuration
The service is constructed from environment variables, with sensible fallbacks for the sender:packages/emails/src/email.service.ts
Writing a template
A template is a React Email component plus an exported props interface. It composes the sharedLayout and _components:
packages/emails/emails/sign-up-welcome.tsx
1
Create the component
Add
emails/<name>.tsx, exporting the component and its Props interface.2
Register it
In
src/template.ts, add the name to the Template union, the EmailComponent map, and TemplateProps.3
Send it
emailService.sendTemplate({ template: '<name>', params: { ... } }) — typed end to end.Local preview
React Email ships a live preview server. Run it to see your templates in the browser with hot reload:emails/ folder at http://localhost:4000. Default prop values (like name = 'John') render so every template has realistic content without wiring up data.

