Skip to content

shemna/sendNRecordMail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SendNRecordMail is used to send mails with a mail client and record the activity in db with status

Current supported mail sender is sendgrid and db is mongo.

Installation: npm install send-and-record-mail

Usage:

var sendNRecordMail = require('send-and-record-mail');
var mongodb = require('mongodb');
mongodb.connect(config.mongo.uri, function(error, db) {
    var storage = sendNRecordMail.storage.get('mongodb', {client: db});
    var mailClient = sendNRecordMail.mailClient.get('sendgrid', {key: '<your key>'});
    var mailTracker = new sendNRecordMail.sendAndRecord(storage, mailClient, console.log, {});
    mailTracker.sendMail(sendAddress, fromMail, emailSubject, body, options); 
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published