Skip to content

Muzammil-Bilwani/email-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

About

A simple engine who sets your API key and send mail for different platform

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published