1.1.6 • Published 5 years ago
email-engine v1.1.6
Email Engine
A simple engine who sets your API key and send mail for different platform like SendGrid,Mailgun, AWS-SES etc
How to Use
npm install email-engine --save
Set your respective API key
For Mailgun
const emailEngine = require('email-engine');
emailEngine.setKey(process.env.YOUR_API_KEY, 'MAIL_GUN', process.env.DOMAIN);
For Send Grid
- Set your API KEY (API KEYS)
const emailEngine = require('email-engine');
emailEngine.setKey(process.env.YOUR_API_KEY, 'SEND_GRID');
- Send Mails
to = "anymail@anydomain.com";
subject = "any subject";
html = "any html or your html template";
from = "anymail@anydomain.com"
emailEngine.sendMailFromSendGrid(to, subject, html,from);
For Declaring From constant
emailEngine.setFromMail('anymail@anydomain.com');
Now you would not pass from mail in sending mail.
Happy Coding
##Future plans
- Adding AWS-SES
- Testing
- Multiple Mails
- Cron Mails