Skip to content

keiloktql/express-react-email-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is my research on the integration of react-email and NodeJS (express). I used mailtrap and nodemailer to mock the sending of email.

Learning Points

  • React email does not work with NodeJS very well and would be better paired with NextJS
  • Node does not recognize tsx/jsx by default, so it is not possible to import the react file into the nodejs code directly
  • Found a workaround albeit less dynamic i.e. generate raw HTML output of the email's React files through email export command and readfilesync the generated html file
  • Let's hope there will be a good solution for this soon

Getting Started

To run this application locally, please follow the steps below:

  1. Clone the repository to your local machine:
  git clone https://github.com/keiloktql/express-react-email-service
  1. Install the dependencies:
  npm install
  1. Create a .env file in your project root and add your Mailtrap API Keys.
MAILTRAP_AUTH_USER=xxxxxxxxx
MAILTRAP_AUTH_PASS=xxxxxxxxx
  1. To start the NodeJS development server:
  npm start
  1. To start the React Email development server:
  npm run devEmail

Resources

License

Distributed under the MIT License. See LICENSE.txt for more information.

Cheers!

About

Email sending API powered by Express and React Email

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published