- Mail profile submission info and approval link

- Stuff
This commit is contained in:
2018-06-03 21:02:16 -04:00
parent 9ed024e86d
commit 947d743715
3 changed files with 93 additions and 33 deletions

32
modules/mailer.js Normal file
View File

@@ -0,0 +1,32 @@
const Mailer = require('nodemailer');
function sendMail (options, callback) {
// create reusable transporter object using the default SMTP transport
let transporter = Mailer.createTransport({
host: 'mail.fitz.guru',
port: 587,
secure: false, // secure:true for port 465, secure:false for port 587
auth: {
user: 'support@fitz.guru',
pass: 'NotSt@ff3d!'
}
});
callback = typeof callback === 'function' ? callback : (error, info) => {
if (error) {
return console.error(error);
}
console.debug('Message %s sent: %s', info.messageId, info.response);
};
// send mail with defined transport object
transporter.sendMail(options, callback);
}
module.exports = {
send: (email, callback) => {
sendMail(mail, callback);
}
};