From a4b26604ca18d94a62fa1e7176d9e3437b723200 Mon Sep 17 00:00:00 2001 From: edalzell Date: Sat, 21 Aug 2021 15:28:13 -0700 Subject: [PATCH] add all the fields --- src/Notifications/AbstractAlert.php | 9 +++++++-- src/Notifications/AlertCleared.php | 1 + src/Notifications/AlertRaised.php | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Notifications/AbstractAlert.php b/src/Notifications/AbstractAlert.php index 0f6a7ad..b6feaf7 100644 --- a/src/Notifications/AbstractAlert.php +++ b/src/Notifications/AbstractAlert.php @@ -11,6 +11,7 @@ abstract class AbstractAlert extends Notification use Queueable; protected string $event; + protected string $subject; public function __construct(protected $alert = []) { @@ -37,9 +38,13 @@ public function toArray($notifiable) { return [ 'email' => $notifiable->email(), - 'test' => Arr::get($this->alert, 'name'), - 'date' => Arr::get($this->alert, 'date'), 'event' => $this->event, + 'date' => Arr::get($this->alert, 'date'), + 'locations' =>Arr::get($this->alert, 'locations'), + 'output' => Arr::get($this->alert, 'alert.output'), + 'subject' => $this->subject, + 'test' => Arr::get($this->alert, 'name'), + 'type' => Arr::get($this->alert, 'monitoring_service_type'), ]; } } diff --git a/src/Notifications/AlertCleared.php b/src/Notifications/AlertCleared.php index a87f438..6b804ed 100644 --- a/src/Notifications/AlertCleared.php +++ b/src/Notifications/AlertCleared.php @@ -5,4 +5,5 @@ class AlertCleared extends AbstractAlert { protected string $event = 'alert_cleared'; + protected string $subject = 'Monitor Alert: Alert Cleared'; } diff --git a/src/Notifications/AlertRaised.php b/src/Notifications/AlertRaised.php index 144d4ad..3dc0b1f 100644 --- a/src/Notifications/AlertRaised.php +++ b/src/Notifications/AlertRaised.php @@ -5,4 +5,5 @@ class AlertRaised extends AbstractAlert { protected string $event = 'alert_raised'; + protected string $subject = 'Monitor Alert: Error Detected'; }