From 2d4d823959b21e880769b83657157daca8ceed42 Mon Sep 17 00:00:00 2001 From: A Date: Fri, 26 Jan 2018 11:13:24 +0100 Subject: [PATCH 1/4] 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 dfe5ad8d1edc..9c10ede5cf6a 100644 --- a/app/Notifications/Component/ComponentStatusChangedNotification.php +++ b/app/Notifications/Component/ComponentStatusChangedNotification.php @@ -88,7 +88,9 @@ public function toMail($notifiable) ->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 6b7a64fe637d..3248b6f4a093 100644 --- a/app/Notifications/Incident/NewIncidentNotification.php +++ b/app/Notifications/Incident/NewIncidentNotification.php @@ -79,7 +79,7 @@ public function toMail($notifiable) ->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 30d9c6eaa806..605e1ca3d4e0 100644 --- a/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php +++ b/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php @@ -83,7 +83,9 @@ public function toMail($notifiable) ->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 7b8099b5e87d..e165691854d1 100644 --- a/resources/lang/en/cachet.php +++ b/resources/lang/en/cachet.php @@ -81,6 +81,7 @@ '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.', From 81fd5f4420baebdf11687481371a53f5bba79ab0 Mon Sep 17 00:00:00 2001 From: A Date: Fri, 26 Jan 2018 11:13:24 +0100 Subject: [PATCH 2/4] 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 --- app/Notifications/Incident/NewIncidentNotification.php | 3 ++- .../IncidentUpdate/IncidentUpdatedNotification.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Notifications/Incident/NewIncidentNotification.php b/app/Notifications/Incident/NewIncidentNotification.php index 3248b6f4a093..64a36b7db6d2 100644 --- a/app/Notifications/Incident/NewIncidentNotification.php +++ b/app/Notifications/Incident/NewIncidentNotification.php @@ -79,7 +79,8 @@ public function toMail($notifiable) ->line($content) ->action(trans('notifications.incident.new.mail.action'), cachet_route('incident', [$this->incident])) ->markdown($this->incident->message) - ->line(trans('cachet.subscriber.manage.manage_at_link', ['link' => cachet_route('subscribe.manage', $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/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php b/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php index 605e1ca3d4e0..b8cd30605f66 100644 --- a/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php +++ b/app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php @@ -84,7 +84,7 @@ public function toMail($notifiable) ->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.manage.manage_at_link', ['link' => cachet_route('subscribe.manage', $notifiable->verify_code)]); + ->line(trans('cachet.subscriber.manage.manage_at_link', ['link' => cachet_route('subscribe.manage', $notifiable->verify_code)])); } From 763d74687f3706f8fdc1012b575b10aa71b41081 Mon Sep 17 00:00:00 2001 From: A Date: Tue, 30 Jan 2018 15:39:36 +0100 Subject: [PATCH 3/4] Uses the translation cachet.subscriber.manage. When a component's status changes or when an incident is created/updated, an email is sent to every people that has subscribed. At the end of the mail a link to manage its subscription has been introduced. Now, it uses the translation. --- .../Component/ComponentStatusChangedNotification.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Notifications/Component/ComponentStatusChangedNotification.php b/app/Notifications/Component/ComponentStatusChangedNotification.php index 9c10ede5cf6a..f2eb5b40e943 100644 --- a/app/Notifications/Component/ComponentStatusChangedNotification.php +++ b/app/Notifications/Component/ComponentStatusChangedNotification.php @@ -89,8 +89,7 @@ public function toMail($notifiable) ->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)])) - //TODO: Translate the text below - ->line('Manage your subscriptions at ' . cachet_route('subscribe.manage', $notifiable->verify_code)); + ->line(trans('cachet.subscriber.manage') . ' ' . cachet_route('subscribe.manage', $notifiable->verify_code)); } /** From d63de58f8fe834b206d51a0d16bb36ef05de1e04 Mon Sep 17 00:00:00 2001 From: A Date: Tue, 27 Mar 2018 10:53:27 +0200 Subject: [PATCH 4/4] Use 'cachet.subscriber.manage.manage_at_link' The new translation is used to manage its subscriptions. --- .../Component/ComponentStatusChangedNotification.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Notifications/Component/ComponentStatusChangedNotification.php b/app/Notifications/Component/ComponentStatusChangedNotification.php index f2eb5b40e943..67c1f04aa015 100644 --- a/app/Notifications/Component/ComponentStatusChangedNotification.php +++ b/app/Notifications/Component/ComponentStatusChangedNotification.php @@ -89,7 +89,7 @@ public function toMail($notifiable) ->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.manage') . ' ' . cachet_route('subscribe.manage', $notifiable->verify_code)); + ->line(trans('cachet.subscriber.manage.manage_at_link', ['link' => cachet_route('subscribe.manage', $notifiable->verify_code)])); } /**