My App
Emails

React Email

Here you can find all the information you need to get started with react email.

Tools

Location: packages/transactional

How use it

  1. Create a new email in packages/transactional/emails folder.
  2. Add locale to the email.
  3. Check the email in the browser. // yarn dev
  4. Add a new email to api endpoint(/api/emails) in web app.
    const templates: Record<
      string,
      {
        template: ComponentType<{ lang: Lang }>;
        subject: Record<Lang, string>;
      }
    > = {
      welcome: {
        template: RateallWelcomeEmail,
        subject: {
          ru: "Добро пожаловать в RateAll!",
          en: "Welcome to RateAll!",
          uk: "Вітаємо в RateAll!",
        },
      },
      // ...
      // add new email here
      {
        template: NewEmail,
        subject: {
          ru: "Новая тема",
          en: "New topic",
          uk: "Нова тема",
        },
      },
    };

On this page