From 2d4d823959b21e880769b83657157daca8ceed42 Mon Sep 17 00:00:00 2001 From: A Date: Fri, 26 Jan 2018 11:13:24 +0100 Subject: [PATCH] Adds a line in the notification email to manage its subscriptions. Untill now a subscriber wasn't able to manage its subscription because there was no link anywhere, so it was forced to unsubscribe and then subscribe again. Now the link is in the notification email, after 'Unsubscribe at'. Related to #2887 --- .../Component/ComponentStatusChangedNotification.php | 4 +++- app/Notifications/Incident/NewIncidentNotification.php | 2 +- .../IncidentUpdate/IncidentUpdatedNotification.php | 4 +++- resources/lang/en/cachet.php | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Notifications/Component/ComponentStatusChangedNotification.php b/app/Notifications/Component/ComponentStatusChangedNotification.php index dfe5ad8d..9c10ede5 100644 --- a/app/Notifications/Component/ComponentStatusChangedNotification.php +++ b/app/Notifications/Component/ComponentStatusChangedNotification.php @@ -88,7 +88,9 @@ class ComponentStatusChangedNotification extends Notification ->greeting(trans('notifications.component.status_update.mail.subject')) ->line($content) ->action(trans('notifications.component.status_update.mail.action'), cachet_route('status-page')) - ->line(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])); + ->line(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])) + //TODO: Translate the text below + ->line('Manage your subscriptions at ' . cachet_route('subscribe.manage', $notifiable->verify_code)); } /** diff --git a/app/Notifications/Incident/NewIncidentNotification.php b/app/Notifications/Incident/NewIncidentNotification.php index 6b7a64fe..3248b6f4 100644 --- a/app/Notifications/Incident/NewIncidentNotification.php +++ b/app/Notifications/Incident/NewIncidentNotification.php @@ -79,7 +79,7 @@ class NewIncidentNotification extends Notification ->line($content) ->action(trans('notifications.incident.new.mail.action'), cachet_route('incident', [$this->incident])) ->markdown($this->incident->message) - ->line(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])); + ->line(trans('cachet.subscriber.manage.manage_at_link', ['link' => cachet_route('subscribe.manage', $notifiable->verify_code)])) } /** diff --git a/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php b/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php index 30d9c6ea..605e1ca3 100644 --- a/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php +++ b/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php @@ -83,7 +83,9 @@ class IncidentUpdatedNotification extends Notification ->line($content) ->action(trans('notifications.incident.update.mail.action'), cachet_route('incident', [$this->update->incident])) ->markdown($this->update->message) - ->line(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])); + ->line(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])) + ->line(trans('cachet.subscriber.manage.manage_at_link', ['link' => cachet_route('subscribe.manage', $notifiable->verify_code)]); + } /** diff --git a/resources/lang/en/cachet.php b/resources/lang/en/cachet.php index 7b8099b5..e1656918 100644 --- a/resources/lang/en/cachet.php +++ b/resources/lang/en/cachet.php @@ -81,6 +81,7 @@ return [ 'manage' => [ 'no_subscriptions' => 'You\'re currently subscribed to all updates.', 'my_subscriptions' => 'You\'re currently subscribed to the following updates.', + 'manage_at_link' => 'Manage your subscriptions at :link' ], 'email' => [ 'subscribe' => 'Subscribe to email updates.',