Include unsubscribe link in Slack footer

This commit is contained in:
James Brooks
2017-01-03 15:14:51 +00:00
parent e8ce42b8d6
commit ce577fb97d
2 changed files with 7 additions and 5 deletions

View File

@@ -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)]));
});
}
}