An API for sending an email to all subscribed users of the current exchange rate of BTC/UAH (Bitcoin to the Ukrainian hryvnia).
Uses the Binance API.
To run this project, you will need to add/change the following variables in ./config/config.json
file.
port
- Express server portfakeSMTP
-true
for using Fake SMTP Mailtrap,false
- for sending real emails with Sendinblue (Limit 300 emails per day)
In case of usage Fake SMTP Mailtrap, change following Variables :
-
host
- SMTP server address -
port
- SMTP server port -
user
- username -
pass
- password
In case of usage Sendinblue, change following Variables :
-
API_KEY
- Paste here your own api key :) -
host
- SMTP server address -
port
- SMTP server port -
from
- Sender email
path
- Path to thedb.txt
file
- Server port : 8080
GET /api/rate
- No parameters
Integer
BTC/UAH rate
POST /api/subscribe
Parameter | Type | Description |
---|---|---|
email |
string |
Email address. |
*form-data parameters
- Status: 200 OK
{
"message": "test@gmail.com successfully subscribed"
}
- Status: 409 Conflict
{
"message": "test@gmail.com already subscribed"
}
POST /api/sendEmails
- No parameters
- Status: 200 OK
{
"message": "Emails sent successfully",
"emailAddress": [
"test@gmail.com",
"test1@gmail.com",
"test2@gmail.com"
]
}
Clone the project
git clone https://github.com/swefd/gses2
Go to the project directory
cd gses2
Build image
docker build -t swefd:gses2 .
Run container
docker run --name gses2 -p 8080:8080/tcp -d swefd:gses2
Clone the project
git clone https://github.com/swefd/gses2
Go to the project directory
cd gses2
Install dependencies
npm install
Start the server
npm run start