From ce577fb97d4032f0ad616f4f0d6c543df8a83bbf Mon Sep 17 00:00:00 2001 From: James Brooks Date: Tue, 3 Jan 2017 15:14:51 +0000 Subject: [PATCH] Include unsubscribe link in Slack footer --- .../Component/ComponentStatusChangedNotification.php | 5 +++-- resources/lang/en/cachet.php | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Notifications/Component/ComponentStatusChangedNotification.php b/app/Notifications/Component/ComponentStatusChangedNotification.php index 92378ffd..b7a5b650 100644 --- a/app/Notifications/Component/ComponentStatusChangedNotification.php +++ b/app/Notifications/Component/ComponentStatusChangedNotification.php @@ -143,14 +143,15 @@ class ComponentStatusChangedNotification extends Notification return (new SlackMessage()) ->$status() ->content(trans('notifications.component.status_update.title')) - ->attachment(function ($attachment) use ($content) { + ->attachment(function ($attachment) use ($content, $notifiable) { $attachment->title($content, cachet_route('status-page')) ->fields(array_filter([ 'Component' => $this->component->name, 'Old Status' => $this->component->human_status, 'New Status' => trans("cachet.components.status.{$this->status}"), 'Link' => $this->component->link, - ])); + ])) + ->footer(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)])); }); } } diff --git a/resources/lang/en/cachet.php b/resources/lang/en/cachet.php index 3d208410..5f274993 100644 --- a/resources/lang/en/cachet.php +++ b/resources/lang/en/cachet.php @@ -76,9 +76,10 @@ return [ // Subscriber 'subscriber' => [ - 'subscribe' => 'Subscribe to get the updates', - 'button' => 'Subscribe', - 'manage' => [ + 'subscribe' => 'Subscribe to get the updates', + 'unsubscribe' => 'Unsubscribe at :link', + 'button' => 'Subscribe', + 'manage' => [ 'no_subscriptions' => 'You\'re currently subscribed to all updates.', 'my_subscriptions' => 'You\'re currently subscribed to the following updates.', ],