Skip to content

Commit

Permalink
add all the fields
Browse files Browse the repository at this point in the history
  • Loading branch information
edalzell committed Aug 21, 2021
1 parent 6abbd6e commit a4b2660
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Notifications/AbstractAlert.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ abstract class AbstractAlert extends Notification
use Queueable;

protected string $event;
protected string $subject;

public function __construct(protected $alert = [])
{
Expand All @@ -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'),
];
}
}
1 change: 1 addition & 0 deletions src/Notifications/AlertCleared.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
class AlertCleared extends AbstractAlert
{
protected string $event = 'alert_cleared';
protected string $subject = 'Monitor Alert: Alert Cleared';
}
1 change: 1 addition & 0 deletions src/Notifications/AlertRaised.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
class AlertRaised extends AbstractAlert
{
protected string $event = 'alert_raised';
protected string $subject = 'Monitor Alert: Error Detected';
}

0 comments on commit a4b2660

Please sign in to comment.