packages/emails/ package and render to HTML that works across all major email clients.
Email Package Overview
Available Templates
BunShip ships with six templates that cover the core SaaS transactional email flows.Welcome Email
Sent after a user registers. Includes a link to the dashboard.Verify Email
Sent to confirm an email address. Includes a verification link and a resend option.Reset Password
Sent when a user requests a password reset.Team Invite
Sent when a team member is invited to join an organization.Invoice
Sent after a successful payment.Subscription Canceled
Sent when a user cancels their subscription.Template Structure
Every template follows the same pattern: a props interface, a React component, and inline styles.The Layout Component
All built-in templates use a sharedLayout component that provides consistent branding, a header with your logo, and a footer with your company details.
packages/emails/src/components/Layout.tsx to change:
- Brand logo URL and dimensions
- Header background color
- Footer text and links
- Default font family
Creating a Custom Template
1
Create the template file
Add a new file in
packages/emails/src/templates/:2
Export from the package
Add the export to
packages/emails/src/index.ts:3
Send the email from your API
Use the email queue to send asynchronously:
Rendering Emails
The@bunship/emails package exports two render functions:
HTML Rendering
Plain Text Rendering
For email clients that do not support HTML:Sending with Resend
BunShip sends emails through Resend via the background job queue. The queue is configured infeaturesConfig.jobs.queues.email:
Testing Emails Locally
React Email includes a development server that renders your templates in the browser with hot reload.http://localhost:3000 where you can:
- Browse all templates in a sidebar
- Preview with sample data
- Toggle between desktop and mobile widths
- View the raw HTML output
Sending Test Emails
To send a real test email through Resend (requires a valid API key):Styling Guidelines
Email clients have limited and inconsistent CSS support. Follow these rules for reliable rendering:Use inline styles only
Use inline styles only
Email clients strip
<style> tags and ignore external stylesheets. Define styles as JavaScript objects and apply them via the style prop.Stick to web-safe fonts
Stick to web-safe fonts
Use system font stacks that work everywhere:
Keep layouts simple
Keep layouts simple
Avoid complex CSS layouts (flexbox, grid). Use React Email’s
<Section>, <Row>, and <Column> components for multi-column layouts.Test across clients
Test across clients
The built-in templates are tested across Gmail, Outlook, Apple Mail, Yahoo Mail, and Thunderbird. Test your custom templates in the same clients before deploying.
Next Steps
Adding Routes
Trigger your new emails from API endpoints
OAuth Providers
Add social login to your authentication flow

