@yermangderrff/mail-service
v0.0.1
Published
HTTP Api service to send mails with different options.
Downloads
1
Readme
Polydiploma Mail Service
HTTP Api service to send mails with different options.
Installation
- Install required dependencies :
npm install
- Start the API server :
npm start
Configuration
- Add a .env file at the root of the project and add:
- PORT (server port)
- EMAIL (Gmail address to send mails)
- PASSWORD (Gmail password)
(You can change the server port in the .env file)
Usage
HTTP routes :
- GET http://127.0.0.1:
PORT
/ : Gets the server status - POST http://127.0.0.1:
PORT
/mails : Send a mail from the email address specified in the .env file.- HTTP body parameters:
- to: Array of strings (email addresses)
- subject: String (Email subject)
- text: String (Email content (text or HTML))
- (optional) values: dictionary of key values to replace variables in the text param (ex: text: "This is a {{name}} mail", values: {name: "super"})
- HTTP body parameters: