mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 00:27:35 +00:00
fix: review comments
This commit is contained in:
@@ -348,16 +348,20 @@ export const userServiceFactory = ({
|
|||||||
const deleteUser = async (userId: string) => {
|
const deleteUser = async (userId: string) => {
|
||||||
const user = await userDAL.deleteById(userId);
|
const user = await userDAL.deleteById(userId);
|
||||||
|
|
||||||
if (user?.email) {
|
try {
|
||||||
// Send email to user to confirm account deletion
|
if (user?.email) {
|
||||||
await smtpService.sendMail({
|
// Send email to user to confirm account deletion
|
||||||
template: SmtpTemplates.AccountDeletionConfirmation,
|
await smtpService.sendMail({
|
||||||
subjectLine: "Your Infisical account has been deleted",
|
template: SmtpTemplates.AccountDeletionConfirmation,
|
||||||
recipients: [user.email],
|
subjectLine: "Your Infisical account has been deleted",
|
||||||
substitutions: {
|
recipients: [user.email],
|
||||||
email: user.email
|
substitutions: {
|
||||||
}
|
email: user.email
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(error, `Failed to send account deletion confirmation email to ${user.email}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
|
|||||||
Reference in New Issue
Block a user