Fixes #2996 - New incident notification is Markdown powered

This commit is contained in:
James Brooks
2018-06-17 18:41:48 +01:00
parent 139a0a4eb1
commit 9ac6b8b1a2
3 changed files with 32 additions and 10 deletions

View File

@@ -75,12 +75,16 @@ class NewIncidentNotification extends Notification
return (new MailMessage())
->subject(trans('notifications.incident.new.mail.subject'))
->greeting(trans('notifications.incident.new.mail.greeting', ['app_name' => Config::get('setting.app_name')]))
->line($content)
->action(trans('notifications.incident.new.mail.action'), cachet_route('incident', [$this->incident]))
->line($this->incident->raw_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)]));
->markdown('notifications.incident.new', [
'incident' => $this->incident,
'content' => $content,
'actionText' => trans('notifications.incident.new.mail.action'),
'actionUrl' => cachet_route('incident', [$this->incident]),
'unsubscribeText' => trans('cachet.subscriber.unsubscribe'),
'unsubscribeUrl' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code),
'manageSubscriptionText' => trans('cachet.subscriber.manage_subscription'),
'manageSubscriptionUrl' => cachet_route('subscribe.manage', $notifiable->verify_code),
]);
}
/**

View File

@@ -75,10 +75,11 @@ return [
// Subscriber
'subscriber' => [
'subscribe' => 'Subscribe to get the updates',
'unsubscribe' => 'Unsubscribe at :link',
'button' => 'Subscribe',
'manage' => [
'subscribe' => 'Subscribe to get the updates',
'unsubscribe' => 'Unsubscribe',
'button' => 'Subscribe',
'manage_subscription' => 'Manage subscription',
'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',

View File

@@ -0,0 +1,17 @@
@component('mail::message')
# {{ trans('notifications.incident.new.mail.greeting', ['app_name' => Config::get('setting.app_name')]) }}
{{ $incident->message }}
@component('mail::button', ['url' => $actionUrl])
{{ $actionText }}
@endcomponent
Thanks,<br>
{{ config('app.name') }}
@component('mail::subcopy')
[{{ $unsubscribeText }}]({{ $unsubscribeUrl }}) &mdash; [{{ $manageSubscriptionText }}]({{ $manageSubscriptionUrl }})
@endcomponent
@endcomponent