This project is a simple Node.js application that sends an email to a recipient using the Mailgun API. The objective of this project is to test how an email template appears once it has been sent to the recipient's email address.
- Clone this repository.
- Run npm install to install the project's dependencies.
- Create a .env file in the root of the project and add your Mailgun API key and domain:
MAILGUN_API_KEY=<your mailgun api key>
MAILGUN_DOMAIN=<domain name>
MAILGUN_FROM_EMAIL=<from name><from email>
PORT=<port to run the app.js on>
- Run npm run dev to start the development server using Nodemon.
- Open POSTMAN
- Add a request for url: http://localhost:PORT/api/v1/mailsender/sendemail
- Add email in the body as raw json
{
"email": "m.ahmedk287@gmail.com"
}
- Check the recipient's email inbox for the test email.