feat: adds account deletion confirmation email

This commit is contained in:
Piyush Gupta
2025-10-06 21:53:19 +05:30
parent 3887fbc6a2
commit f17fcd6046
4 changed files with 55 additions and 2 deletions
+13
View File
@@ -347,6 +347,19 @@ 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
}
});
}
return user;
};