From ba076dab5c05941adf8ef77686adcfe9ca83c43f Mon Sep 17 00:00:00 2001 From: rota3015 Date: Sun, 5 May 2024 01:27:48 +0000 Subject: [PATCH] Changed the logic for email engine and backend also changed the from email address to send mail --- controllers/emailController.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/controllers/emailController.js b/controllers/emailController.js index 7a13ba6..4ea243d 100644 --- a/controllers/emailController.js +++ b/controllers/emailController.js @@ -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,