Introduction

OverviewPhilosophyStructureUpdatesFAQ

Usage

Other

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.

Resend is an optional integration. If RESEND_TOKEN is not set, the resend export will be undefined. Make sure to handle this when sending emails.

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
import { resend } from '@repo/email';

await resend.emails.send({
  from: 'sender@acme.com',
  to: 'recipient@acme.com',
  subject: 'The email subject',
  text: 'The email text',
});

Email Templates

The email package is separated into @repo/email so the templates and SDK can be imported directly from the apps that send transactional 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
import { resend } from '@repo/email';
import { ContactTemplate } from '@repo/email/templates/contact';

await resend.emails.send({
  from: 'sender@acme.com',
  to: 'recipient@acme.com',
  subject: 'The email subject',
  react: <ContactTemplate name={name} email={email} message={message} />,
});

On this page

GitHubEdit this page on GitHub