Transactional Emails
We use Resend to send transactional emails. The templates, located in @repo/email
, are powered by React Email - a collection of high-quality, unstyled components for creating beautiful emails using React and TypeScript.
Sending Emails
To send an email, you can use the resend
object, which is imported from the @repo/email
package:
apps/web/app/contact/actions/contact.tsx
Email Templates
The email
package is separated from the app folder for two reasons:
- We can import the templates into the
email
app, allowing for previewing them in the UI; and - We can import both the templates and the SDK into our other apps and use them to send emails.
Resend and React Email play nicely together. For example, here’s how you can send a transactional email using a React email template:
apps/web/app/contact/actions/contact.tsx
Previewing Emails
To preview the emails templates, simply run the email
app.