Email Templating
Email templates can easily be developed locally without ever sending a real email. This is done to:
- Keep development local
- Avoid hurting email domain reputation
You can run the local React Email preview server from the email-templates
directory via bun run dev
. Then navigate
to http://localhost:3333.
All email templates are statically compiled and copied to the backend/src/generated
directory. This is to allow for
speedy email sending and reducing CPU cycles on Cloudflare for cost. As a result, it is very important to follow a strict pattern when writing new templates.
- Each template must have it's own directory
- Each template must have a single file inside the directory called
email.tsx
andexport const Email
You can place shared components in the src/components
directory.
Locales have their own file (two-letter language code.json format), one per language, in src/locales
.
For full documentation see React Email.