Email template changed for forget Otp
This commit is contained in:
parent
c67fc05115
commit
63938243e0
@ -1051,13 +1051,16 @@ exports.forgotPasswordRequestOTP = async (req, res) => {
|
|||||||
reset_otp_expires_at: new Date(Date.now() + 10 * 60 * 1000), // valid for 10 mins
|
reset_otp_expires_at: new Date(Date.now() + 10 * 60 * 1000), // valid for 10 mins
|
||||||
});
|
});
|
||||||
|
|
||||||
// Send OTP email
|
const formattedSupportPhone = formatUAEPhoneNumber(process.env.SUPPORT_PHONE);
|
||||||
await sendEmail(
|
const placeHolderData = {
|
||||||
registered_email,
|
username: user.name,
|
||||||
"Password Reset OTP",
|
verfication_code: otp,
|
||||||
`<p>Dear ${user.name},</p><p>Your OTP for password reset is <b>${otp}</b>. It is valid for 10 minutes.</p>`
|
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{
|
}else{
|
||||||
|
|
||||||
const adminUser = await user.findOne({where: { email: registered_email },});
|
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
|
reset_otp_expires_at: new Date(Date.now() + 10 * 60 * 1000), // valid for 10 mins
|
||||||
});
|
});
|
||||||
|
|
||||||
// Send OTP email
|
const formattedSupportPhone = formatUAEPhoneNumber(process.env.SUPPORT_PHONE);
|
||||||
await sendEmail(
|
const formattedOtp = otp.split("").join(" ");
|
||||||
registered_email,
|
const placeHolderData = {
|
||||||
"Password Reset OTP",
|
username: user.name,
|
||||||
`<p>Dear ${adminUser.name},</p><p>Your OTP for password reset is <b>${otp}</b>. It is valid for 10 minutes.</p>`
|
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);
|
const safeEmail = sanitizeForLog(registered_email);
|
||||||
@ -1252,9 +1260,10 @@ exports.requestOTPForLogin = async (req, res) => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
const formattedSupportPhone = formatUAEPhoneNumber(process.env.SUPPORT_PHONE);
|
const formattedSupportPhone = formatUAEPhoneNumber(process.env.SUPPORT_PHONE);
|
||||||
|
const formattedOtp = otp.split("").join(" ");
|
||||||
const placeHolderData = {
|
const placeHolderData = {
|
||||||
username: loggingUser.name,
|
username: loggingUser.name,
|
||||||
verfication_code: otp,
|
verfication_code: formattedOtp,
|
||||||
otp_expiry: 10,
|
otp_expiry: 10,
|
||||||
support_email: process.env.SUPPORT_EMAIL,
|
support_email: process.env.SUPPORT_EMAIL,
|
||||||
support_phone: formattedSupportPhone,
|
support_phone: formattedSupportPhone,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user