Skip to content

Commit

Permalink
Adds a line in the notification email to manage its subscriptions.
Browse files Browse the repository at this point in the history
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 cachethq#2887
  • Loading branch information
uxen-ab committed Mar 27, 2018
1 parent 0ebaa39 commit 2d4d823
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Notifications/Incident/NewIncidentNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)]))
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)]);

}

/**
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/cachet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down

0 comments on commit 2d4d823

Please sign in to comment.