forked from wrenn/wrenn
feat: send email notification on account hard-delete
Notify users via email when their account is permanently deleted after the 15-day soft-delete grace period. Query now returns email alongside user ID so the notification can be sent after deletion. Email failure is logged as a warning but does not block cleanup.
This commit is contained in:
@ -92,7 +92,7 @@ WHERE ut.user_id = $1
|
||||
);
|
||||
|
||||
-- name: ListExpiredSoftDeletedUsers :many
|
||||
SELECT id FROM users WHERE deleted_at IS NOT NULL AND deleted_at < NOW() - INTERVAL '15 days';
|
||||
SELECT id, email FROM users WHERE deleted_at IS NOT NULL AND deleted_at < NOW() - INTERVAL '15 days';
|
||||
|
||||
-- name: HardDeleteUser :exec
|
||||
DELETE FROM users WHERE id = $1;
|
||||
|
||||
Reference in New Issue
Block a user