From 38773c84acde6218cac2d0446dbbe85a276f229d Mon Sep 17 00:00:00 2001 From: James Brooks Date: Wed, 4 Jan 2017 20:25:41 +0000 Subject: [PATCH] Update all email notifications --- .../Component/ComponentStatusChangedNotification.php | 3 ++- app/Notifications/Incident/NewIncidentNotification.php | 10 ++-------- .../IncidentUpdate/IncidentUpdatedNotification.php | 3 ++- app/Notifications/Schedule/NewScheduleNotification.php | 3 ++- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/Notifications/Component/ComponentStatusChangedNotification.php b/app/Notifications/Component/ComponentStatusChangedNotification.php index 06094a5a..2f034e44 100644 --- a/app/Notifications/Component/ComponentStatusChangedNotification.php +++ b/app/Notifications/Component/ComponentStatusChangedNotification.php @@ -87,7 +87,8 @@ class ComponentStatusChangedNotification extends Notification ->subject(trans('notifications.component.status_update.subject')) ->greeting(trans('notifications.component.status_update.title')) ->line($content) - ->action('View Component', $this->component->link); + ->action('View', cachet_route('status-page')) + ->line(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])); } /** diff --git a/app/Notifications/Incident/NewIncidentNotification.php b/app/Notifications/Incident/NewIncidentNotification.php index 2b7140fa..3aee2b81 100644 --- a/app/Notifications/Incident/NewIncidentNotification.php +++ b/app/Notifications/Incident/NewIncidentNotification.php @@ -73,18 +73,12 @@ class NewIncidentNotification extends Notification 'name' => $this->incident->name, ]); - if ($this->incident->status === Incident::FIXED) { - $status = 'success'; - } else { - $status = 'error'; - } - return (new MailMessage()) ->subject(trans('notifications.incident.new.subject')) - ->$status() ->greeting(trans('notifications.incident.new.title', ['app_name' => Config::get('setting.app_name')])) ->line($content) - ->action('View Component', $this->incident->link); + ->action('View Incident', cachet_route('incident', [$this->incident])) + ->line(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])); } /** diff --git a/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php b/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php index ed2ba951..7986c54c 100644 --- a/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php +++ b/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php @@ -81,7 +81,8 @@ class IncidentUpdatedNotification extends Notification 'new_status' => $this->update->human_status, ])) ->line($content) - ->action('View Component', $this->update->link); + ->action('View Incident', cachet_route('incident', [$this->update->incident])) + ->line(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])); } /** diff --git a/app/Notifications/Schedule/NewScheduleNotification.php b/app/Notifications/Schedule/NewScheduleNotification.php index 0e88b699..f2fb3075 100644 --- a/app/Notifications/Schedule/NewScheduleNotification.php +++ b/app/Notifications/Schedule/NewScheduleNotification.php @@ -77,7 +77,8 @@ class NewScheduleNotification extends Notification ->subject(trans('notifications.schedule.new.subject')) ->greeting(trans('notifications.schedule.new.title')) ->line($content) - ->action('View Component', $this->schedule->link); + ->action('View Schedule', cachet_route('schedule', [$this->schedule])) + ->line(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])); } /**