Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

opentelekomcloud-infra/express-mail-gateway-bak

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express Mail Gateway

This nodejs (Express JS) application will be used as mail gateway to hide sensitive information from the frontend. It is built as API gateway which receives a post request and enriches the message with the sensitive data and forwards everything to the mail gateway via SMTP provider.

Author

This repository was originally forked from 🔗 schadokar/nodemailer-app and enhanced with a couple of code snippets.

Installation

Clone the repository to your local folder:

git clone <reponame>

Install the nodejs dependencies with npm.

npm i

Configuration

Configure the application by using environment variables or a .env file with the following parameters.

SMTP_USER=<SMTP_USER>
SMTP_PASS=<SMTP_PASSWORD>
SMTP_DOMAIN=<SMTP_DOMAIN>
SMTP_PORT=<Port to be used e.g. 25>
[email protected],

Run the application

Dev mode:

npm run dev

Productive:

npm run start

Sample API Request

POST http://<hostname>:3000/api/v1/sendmail

REQUESTBODY
{
    "from": "[email protected]",
    "subject": "Subject for the mail",
    "message": {
        "test1":"test1Value",
        "test2":"test2Value"
    }
}

About

A simple mail gateway to send mails via API request.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 83.0%
  • CSS 13.9%
  • HTML 3.1%