Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@abhishekdeb/ezmailer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@abhishekdeb/ezmailer

Out of the box Email wrapper for popular nodejs email systems

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-63.64%
Maintainers
1
Weekly downloads
 
Created
Source

ezMailer v0.0.1

Out of the box Email wrapper for popular nodejs email systems ( NodeMailer, Sendgrid, MailGun)

NPM Version Build Status Downloads Stats

Do you go through the hassel of changing code just to change the emailing system for your node app? Worry no more ... ezMailer is a one-stop solution for your node emailing system. Nodemailer, Sendgrid and Mailgun is already integrated and so you just basically use senMail function everywhere. If you need to change the underlying emailing system, just change it in the app, on the fly ( no need to restart your node app).

Oh, and it has full blown templating support as well! Yay!

Psst, it works out of the box. Go, rock your node app.

Requirements

  1. node >= 6
  2. npm >= 3

Installation

npm install @abhishekdeb/ezmailer --save

Usage example

ezMailer needs a config file which will contain your smtp credentials for NodeMailer, sendgrid, etc...
Have a look at example directory.

  1. Create a Config File:
"use strict";

var config=exports=module.exports={};

config.mailService={

    templatePath:'./',

    mailer:{ //Node-mailer
        service:'Gmail', //yahoo, etc.
        user:'[Username]@gmail.com',
        pass:'[Your_Password]'
    },

    sendgrid: '[Your_SendGrid_Key]',

    mailgun:{
        apiKey:'[Your_Mailgun_key]',
        domain:'[Your_website_domain]'
    }
};
  1. Require this config and pass it to ezmailer with default system
const config=require('./sample-config');
let ezmailer=require('ezmailer')(config.mailService,'mailer');  //mailer / sendgrid / mailgun

  1. Load up email options and sendMail

let mailOptions={
    from:'from@gmail.com',
    to:'to@gmail.com',
    subject:'Sample Basic ezmailer test',
    body:{
        text:'This is basic ezmailer test. ',
        html:'<h1>This is <u>Basic</u> <i>ezmailer</i> test.'
    }
};


//Send the mail. sendMail returns a promise.
ezmailer.sendMail(mailOptions).then(data=>{
    console.log('Email has been sent : ',data);
},err=>{
    console.log('Email could not be sent : ',err);
});


For more examples and usage, please refer to the (Wiki)wiki.

Features

  • Simple and ready to use, yet Powerful Email API
  • Nodemail, email-templates, sendgrid, Mailgun integrated
  • Examples incuded
  • Config style setup
  • Promisified API
  • Used in generator-restgoose
  • Much more to come ...

Release History

  • 0.0.1
    • Initial Release
    • Templating System Integrated

Meta

Abhishek Deb – @vikz91vikz91.deb@gmail.com

Distributed under the MIT license. See LICENSE for more information.

https://github.com/vikz91

Contributors

  1. VikZ91 - Base System
  2. EranGoldman - Adding Mailgun

Contributing

  1. Fork it (https://github.com/yourname/yourproject/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Bucet List

  1. Seperate Config File System
  2. Update ReadMe
  3. Seperate Npm Package (from generator-restgoose)
  4. Extensive Testing
  5. Write Test Cases using Karma
  6. Write Functions to add custom email transport
  7. Add to Travis / Circle
  8. Adding Attachments
  9. Subject Template
  10. Adding Support for MailChimp

Keywords

FAQs

Package last updated on 22 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc