This is an application built with Next.js to create and send React email templates using React Email and Nodemailer.
- Next.js 13 (App Router)
- TypeScript
- TailwindCSS
- React Email
- Nodemailer
- Email service: Google Mail.
First, install the project dependencies:
npm run install:all
Run the the Next.js app, React Email's preview server, or the both:
#run root app
npm run dev
#run email preview only
npm run preview
#run root app and email preview server
npm run dev:preview
The root Next.js app runs on localhost:3000 while React Email's preview server runs on localhost:3001.
You can start creating or editing email templates by modifying files in react-email-starter/emails
. The page auto-updates as you edit the file.
To send emails from your Google account, Google requires you to enable 2FA and generate an application password. Follow the steps on that page to create yours and add to your .env.local
file.
To learn more about React Email and Next.js, take a look at their documentation:
- React Email - a collection of React templates for creating emails.
- Next.js Documentation - learn about Next.js features and API.