Email template changed for forget Otp

This commit is contained in:
unknown 2026-01-09 13:15:15 +05:30
parent c67fc05115
commit 63938243e0

View File

@ -1051,13 +1051,16 @@ exports.forgotPasswordRequestOTP = async (req, res) => {
reset_otp_expires_at: new Date(Date.now() + 10 * 60 * 1000), // valid for 10 mins
});
// Send OTP email
await sendEmail(
registered_email,
"Password Reset OTP",
`<p>Dear ${user.name},</p><p>Your OTP for password reset is <b>${otp}</b>. It is valid for 10 minutes.</p>`
);
const formattedSupportPhone = formatUAEPhoneNumber(process.env.SUPPORT_PHONE);
const placeHolderData = {
username: user.name,
verfication_code: otp,
otp_expiry: 10,
support_email: process.env.SUPPORT_EMAIL,
support_phone: formattedSupportPhone,
};
await sendEmailService(registered_email, "iip_reset_password", placeHolderData);
logger.info(`Reset Password email trigger: ${sanitizeForLog(registered_email)}`);
}else{
const adminUser = await user.findOne({where: { email: registered_email },});
@ -1077,12 +1080,17 @@ exports.forgotPasswordRequestOTP = async (req, res) => {
reset_otp_expires_at: new Date(Date.now() + 10 * 60 * 1000), // valid for 10 mins
});
// Send OTP email
await sendEmail(
registered_email,
"Password Reset OTP",
`<p>Dear ${adminUser.name},</p><p>Your OTP for password reset is <b>${otp}</b>. It is valid for 10 minutes.</p>`
);
const formattedSupportPhone = formatUAEPhoneNumber(process.env.SUPPORT_PHONE);
const formattedOtp = otp.split("").join(" ");
const placeHolderData = {
username: user.name,
verfication_code: formattedOtp,
otp_expiry: 10,
support_email: process.env.SUPPORT_EMAIL,
support_phone: formattedSupportPhone,
};
await sendEmailService(registered_email, "iip_reset_password", placeHolderData);
logger.info(`Reset Password email trigger: ${sanitizeForLog(registered_email)}`);
}
const safeEmail = sanitizeForLog(registered_email);
@ -1252,9 +1260,10 @@ exports.requestOTPForLogin = async (req, res) => {
}
);
const formattedSupportPhone = formatUAEPhoneNumber(process.env.SUPPORT_PHONE);
const formattedOtp = otp.split("").join(" ");
const placeHolderData = {
username: loggingUser.name,
verfication_code: otp,
verfication_code: formattedOtp,
otp_expiry: 10,
support_email: process.env.SUPPORT_EMAIL,
support_phone: formattedSupportPhone,