Skip to content

Instantly share code, notes, and snippets.

@shaikh-shahid
Created April 6, 2016 12:00
Show Gist options
  • Save shaikh-shahid/1b887c14cb994869263a4876e1a90908 to your computer and use it in GitHub Desktop.
Save shaikh-shahid/1b887c14cb994869263a4876e1a90908 to your computer and use it in GitHub Desktop.
var async = require('async');
var emails = ["[email protected]","[email protected]"];
async.each(emails,function(singleEmail,callback) {
async.waterfall([
function(callback) {
// code to send email.
callback(null,Flag);
},
function(emailSentOrNot,callback) {
// Update DB.
}
],function(err,data) {
});
},function(err,data) {
// Once all done, comes here.
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment