diff --git a/app/Console/Commands/Services/Tasks/NotifyAlarms.php b/app/Console/Commands/Services/Tasks/NotifyAlarms.php index 37004b67..704ef3a1 100644 --- a/app/Console/Commands/Services/Tasks/NotifyAlarms.php +++ b/app/Console/Commands/Services/Tasks/NotifyAlarms.php @@ -66,6 +66,8 @@ class NotifyAlarms 'notify_by_mail' => 1, ]); + $stored_alarms[] = $send->id; + switch ($alarm_level_id) { case 1: $message = 'ALARM LEVEL '.$alarm_level_id; @@ -91,8 +93,9 @@ class NotifyAlarms Mail::to($user) ->send(new AlarmNotification($message, $tablecontent, $alarm_level_id)); + } else { + $stored_alarms[] = $send; } - $stored_alarms[] = $send; break; case 'system': @@ -109,6 +112,7 @@ class NotifyAlarms 'fieldname' => $fieldname, 'notify_by_system' => 1, ]); + $stored_alarms[] = $send->id; switch ($alarm_level_id) { case 1: @@ -137,8 +141,9 @@ class NotifyAlarms ->sendToDatabase($user); break; + } else { + $stored_alarms[] = $send; } - $stored_alarms[] = $send; } } }