Move backend files to backend/ subdirectory

This commit is contained in:
2025-07-25 19:09:35 -03:00
parent d04304b573
commit 1bd4ca0d98
59 changed files with 0 additions and 0 deletions

32
backend/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);
}
};