This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2020-10-14 12:49:18 -07:00
|
|
|
const mailer = require('mailer');
|
|
|
|
|
2020-10-31 06:54:56 -07:00
|
|
|
module.exports = (to, subject, body = undefined, html = undefined) => {
|
2020-10-14 12:49:18 -07:00
|
|
|
mailer.send({
|
|
|
|
host: process.env.MAILER_HOST,
|
|
|
|
port: parseInt(process.env.MAILER_PORT),
|
|
|
|
ssl: parseInt(process.env.MAILER_PORT) === 465,
|
|
|
|
authentication: 'login',
|
|
|
|
username: process.env.MAILER_USER,
|
|
|
|
password: process.env.MAILER_PASS,
|
|
|
|
from: process.env.MAILER_FROM,
|
|
|
|
to,
|
|
|
|
subject,
|
|
|
|
body,
|
2020-10-31 06:54:56 -07:00
|
|
|
html,
|
2020-10-14 12:49:18 -07:00
|
|
|
},
|
|
|
|
function(err){
|
|
|
|
if (err) {
|
|
|
|
console.error(err);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|