Skip to content

Commit 7836226

Browse files
committed
Fix notifications for deleted accounts
Admins shouldn't get notifications when an account is created as a deleted account. This happens when we delete users, as a new user is created with deleted set to true to block the username
1 parent 5d0bccd commit 7836226

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/MessageHandler/Notification/SentNewSignupNotificationHandler.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ public function doWork(MessageInterface $message): void
3838
if (!$user) {
3939
throw new UnrecoverableMessageHandlingException('user not found');
4040
}
41-
$this->signupNotificationManager->sendNewSignupNotification($user);
41+
42+
if (!$user->isAccountDeleted() && !$user->isSoftDeleted() && null === $user->markedForDeletionAt) {
43+
// only send notifications for new accounts if the account is not deleted,
44+
// this is necessary because we create dummy accounts to block the username when an account is deleted
45+
$this->signupNotificationManager->sendNewSignupNotification($user);
46+
}
4247
}
4348
}

0 commit comments

Comments
 (0)