feat: add log message when a domain is deleted from WHOIS

This commit is contained in:
Maël Gangloff 2025-12-14 13:53:30 +01:00
parent 94a29bc8df
commit 545677ddf7
No known key found for this signature in database
GPG Key ID: 11FDC81C24A7F629

View File

@ -166,6 +166,11 @@ final readonly class UpdateDomainHandler
$newDomain = $this->domainRepository->findOneBy(['ldhName' => $domain->getLdhName()]);
if (!$deleted && null !== $newDomain && $newDomain->getDeleted()) {
$this->logger->info('Domain has been deleted from WHOIS: a notification is sent to user', [
'ldhName' => $message->ldhName,
'username' => $watchlist->getUser()->getUserIdentifier(),
]);
$notification = new DomainDeletedNotification($this->sender, $domain);
$this->mailer->send($notification->asEmailMessage(new Recipient($watchlist->getUser()->getEmail()))->getMessage());
$this->chatNotificationService->sendChatNotification($watchlist, $notification);