mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: verify webhook DSN exists before send notif
This commit is contained in:
@@ -83,13 +83,17 @@ final readonly class SendDomainEventNotifHandler
|
|||||||
if (TriggerAction::SendEmail == $watchListTrigger->getAction()) {
|
if (TriggerAction::SendEmail == $watchListTrigger->getAction()) {
|
||||||
$this->mailer->send($notification->asEmailMessage($recipient)->getMessage());
|
$this->mailer->send($notification->asEmailMessage($recipient)->getMessage());
|
||||||
} elseif (TriggerAction::SendChat == $watchListTrigger->getAction()) {
|
} elseif (TriggerAction::SendChat == $watchListTrigger->getAction()) {
|
||||||
|
$webhookDsn = $watchList->getWebhookDsn();
|
||||||
|
if (null === $webhookDsn || 0 === count($webhookDsn)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->chatNotificationService->sendChatNotification($watchList, $notification);
|
$this->chatNotificationService->sendChatNotification($watchList, $notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->statService->incrementStat('stats.alert.sent');
|
|
||||||
if ($this->influxdbEnabled) {
|
if ($this->influxdbEnabled) {
|
||||||
$this->influxdbService->addDomainNotificationPoint($domain, $watchListTrigger->getAction(), true);
|
$this->influxdbService->addDomainNotificationPoint($domain, TriggerAction::SendChat, true);
|
||||||
}
|
}
|
||||||
|
$this->statService->incrementStat('stats.alert.sent');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user