bridge-node-server/node_server/ComServe/mailer-promises.js
Martin Donnelly 57bd6c8e6a init
2018-06-24 21:15:03 +01:00

16 lines
604 B
JavaScript

/**
* @file This file wraps the functions in mailer.js with promises for simpler
* use in promises and async/await
*/
const Q = require('q');
const mailer = require('./mailer.js');
module.exports = {
sendEmail: (...args) => Q.nfapply(mailer.sendEmail, args),
sendEmailByID: (...args) => Q.nfapply(mailer.sendEmailByID, args),
sendWelcomeEmail: (...args) => Q.nfapply(mailer.sendWelcomeEmail, args),
sendEmailChangedEmails: (...args) => Q.nfapply(mailer.sendEmailChangedEmails, args),
sendEmailRevertedEmails: (...args) => Q.nfapply(mailer.sendEmailRevertedEmails, args)
};