fix: review comments

This commit is contained in:
Piyush Gupta
2025-10-06 22:02:07 +05:30
parent f17fcd6046
commit 3e79223407

View File

@@ -348,16 +348,20 @@ export const userServiceFactory = ({
const deleteUser = async (userId: string) => {
const user = await userDAL.deleteById(userId);
if (user?.email) {
// Send email to user to confirm account deletion
await smtpService.sendMail({
template: SmtpTemplates.AccountDeletionConfirmation,
subjectLine: "Your Infisical account has been deleted",
recipients: [user.email],
substitutions: {
email: user.email
}
});
try {
if (user?.email) {
// Send email to user to confirm account deletion
await smtpService.sendMail({
template: SmtpTemplates.AccountDeletionConfirmation,
subjectLine: "Your Infisical account has been deleted",
recipients: [user.email],
substitutions: {
email: user.email
}
});
}
} catch (error) {
logger.error(error, `Failed to send account deletion confirmation email to ${user.email}`);
}
return user;