Changed the logic for email engine and backend also changed the from email address to send mail

This commit is contained in:
rota3015 2024-05-05 01:27:48 +00:00
parent e08aeee91b
commit ba076dab5c

View File

@ -1,5 +1,5 @@
var db, transporter = require('../config/dbConfig');
const db = require('../config/dbConfig');
const transporter = require('../config/emailConfig');
const mailOptions = {
from: 'your-email@example.com', // Replace with your email address
to: 'recipient@example.com', // Replace with the recipient's email address
@ -20,7 +20,7 @@ exports.sendOtp = (req, res) => {
res.status(500).json({ success: false, message: 'Internal Server Error' });
return;
}
sendMail(otp, email, req);
sendMail(otp, email, req, res);
}
);
@ -48,9 +48,9 @@ exports.validateOtp = async (req, res) => {
});
};
function sendMail(otp, email, req) {
function sendMail(otp, email, req, res) {
const mailOptions = {
from: 'communityrule.app@medlab.host', // Replace with your email address
from: 'hello@communityrule.info', // Replace with your email address
to: email, // Replace with the recipient's email address
subject: 'Login code for commnunityRule',
text: 'Login code for CommunityRule: ' + otp,