Skip to content

juanmaescudero/api-mails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Mails built with Node.js

This is a sample API for sending emails using Node.js, Express, and Nodemailer.

Installation

  1. Clone the repository:
git clone https://github.com/juanmaescudero/api-mails
  1. Navigate to the project directory:
cd api-mails
  1. Install dependencies:
npm install

Usage

Create a .env file in the root of your project and set the following variables:

MAIL_USER=YOUR_EMAIL
MAIL_PASS=YOUR_PASS
MAIL_HOST=YOUR_SMTP_HOST
MAIL_PORT=YOUR_PORT

Make sure to replace YOUR_EMAIL, YOUR_PASS, YOUR_SMTP_HOST, and YOUR_PORT with your actual email credentials and SMTP server information.

API Endpoints

  • POST /mails/register: Send an email using the following JSON format:
{
    "name": "John Doe",
    "email": "[email protected]",
    "template": "USER_REGISTER"
}
  • POST /mails/lostPassword: Send an email using the following JSON format:
{
    "name": "John Doe",
    "email": "[email protected]",
    "template": "LOST_PASSWORD"
}

Ensure to set the appropriate headers and provide the required JSON payload when making requests to the API.

Feel free to customize and extend the API based on your specific email sending needs.

About

This is a sample API for sending emails using Node.js, Express, and Nodemailer.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published