Determine if notifications are suppressed when handeling events

This commit is contained in:
Nico Stapelbroek
2018-01-21 13:05:46 +01:00
parent f53f88f950
commit e358332048
5 changed files with 15 additions and 25 deletions
@@ -55,16 +55,11 @@ class SendIncidentUpdateEmailNotificationHandler
*/
public function handle(IncidentUpdateWasReportedEvent $event)
{
// Don't send incident updates if we're under maintenance.
if ($this->system->underMaintenance()) {
return false;
}
$update = $event->update;
$incident = $update->incident;
// Only send emails for public incidents.
if (!$incident->visible) {
// Only send emails for public incidents while the system is not under scheduled maintenance.
if (!$incident->visible || !$this->system->canNotifySubscribers()) {
return;
}