|
@@ -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,
|