|
@@ -1,5 +1,5 @@
|
|
-var db, transporter = require('../config/dbConfig');
|
|
|
|
-
|
|
|
|
|
|
+const db = require('../config/dbConfig');
|
|
|
|
+const transporter = require('../config/emailConfig');
|
|
const mailOptions = {
|
|
const mailOptions = {
|
|
from: 'your-email@example.com', // Replace with your email address
|
|
from: 'your-email@example.com', // Replace with your email address
|
|
to: 'recipient@example.com', // Replace with the recipient's 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' });
|
|
res.status(500).json({ success: false, message: 'Internal Server Error' });
|
|
return;
|
|
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 = {
|
|
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
|
|
to: email, // Replace with the recipient's email address
|
|
subject: 'Login code for commnunityRule',
|
|
subject: 'Login code for commnunityRule',
|
|
text: 'Login code for CommunityRule: ' + otp,
|
|
text: 'Login code for CommunityRule: ' + otp,
|