- Install node js on machine
- Checkout the repository
- Rename 'config/default.example.json' to 'config/default.json'
- Update SMTP details in 'default.json'
- Open command line tool in directory where index.js
- Execute command
npm install
- Execute command
node index.js
- You can replace this file with your app name e.g 'emailApp.js'
- Install node js on server, for more information Click Here
- Install pm2 globally on server
npm install pm2 -g
, for more inforamtion Click Here - Rename 'config/default.example.json' to 'config/default.json'
- Update SMTP details in 'default.json'
- Execute command
npm install
- Start node server
pm2 start <YourStartUpFileName>.js
Route
http://{domain}:{port}/admin/getKey
POST Request
Body:-
{
"clientId" : "clientId",
"expiryinDays": 50
}
Header:-
{
"secretkey": "<Token generated by generate key above API>"
}
Route
http://{domain}:{port}/email/send
POST Request
Header:-
{
"secretkey": "<Admin key which is mentioned in defualt.json>"
}
Body:-
{
"fromName": "My Name",
"fromEmail": "[email protected]",
"toEmails": "[email protected], [email protected]",
"cCEmails": "[email protected], [email protected]",
"bccEmails": "[email protected], [email protected]",
"replyToEmails": "[email protected], [email protected]",
"subject": "Subject",
"htmlBody": "<b>Welcome</b>",
"textBody": "welcome Test"
}
Note:- fromName, fromEmail, toEmails, cCEmails, bccEmails, replyToEmails
are optional fields if you not sent through request body, API will take it from client configuration file