https://github.com/danielspindler/reactemailservice
This Project is all about an easy Mailer to replace MJML with react email (which is easier to handle imo), saving time.
https://github.com/danielspindler/reactemailservice
express mailer react react-email tailwind typescript
Last synced: 2 months ago
JSON representation
This Project is all about an easy Mailer to replace MJML with react email (which is easier to handle imo), saving time.
- Host: GitHub
- URL: https://github.com/danielspindler/reactemailservice
- Owner: DanielSpindler
- Created: 2025-03-12T20:53:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-12T23:11:08.000Z (over 1 year ago)
- Last Synced: 2025-03-13T00:19:55.575Z (over 1 year ago)
- Topics: express, mailer, react, react-email, tailwind, typescript
- Language: TypeScript
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Email Service Setup
## 1. Choose a Mailer
Before using this service, you need to decide which mailer to use. **It is important that the mailer supports HTML as a string.**
By default, the service uses **SendGrid**. You can find the mailer configuration in the `src/mailer.ts` file.
If you decide not to use SendGrid, be sure to uninstall it:
```sh
npm uninstall @sendgrid/mail
```
After removing it and installing your choice, run the following command to install required dependencies:
```sh
npm install
```
## 2. Update the `.env` File
Make sure to create your `.env` file with the necessary configurations for your chosen mailer.
## 3. Available Scripts
Check the `package.json` file to see the available scripts for running the project.
## 4. Sending an Email via POST Request
Here is an example of how to send a POST request to the server:
```json
{
"type": "orderConfirmation",
"to": "SomeMail@ymail.com",
"subject": "Some Subject"
}
```
You can send additional data and customize the templates accordingly to personalize outgoing emails.
## 5. Adjust the Email Template
Data marked as **"EXAMPLEDATA"** must be updated as soon as possible. Additionally, the entire template file should be adjusted to fit your needs.
## 6. React Email Gui
```sh
npm run dev
```
Starts a Test-Server to watch your templates in the browser.
Be careful, every Email-Client has different "Problems" that need different fixes (css wise)