Skip to content

Commit

Permalink
Merge pull request #3100 from CachetHQ/fix-mail-markdown-notifications
Browse files Browse the repository at this point in the history
Fix mail markdown notifications
  • Loading branch information
jbrooksuk committed Jun 18, 2018
2 parents f276982 + b26ec12 commit 5d1e696
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
16 changes: 10 additions & 6 deletions app/Notifications/Incident/NewIncidentNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,16 @@ public function toMail($notifiable)

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

/**
Expand Down
9 changes: 5 additions & 4 deletions resources/lang/en/cachet.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@

// 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',
Expand Down
15 changes: 15 additions & 0 deletions resources/views/notifications/incident/new.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@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::get('setting.app_name') }}

@include('notifications.partials.subscription')

@endcomponent
3 changes: 3 additions & 0 deletions resources/views/notifications/partials/subscription.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@component('mail::subcopy')
[{{ $unsubscribeText }}]({{ $unsubscribeUrl }}) &mdash; [{{ $manageSubscriptionText }}]({{ $manageSubscriptionUrl }})
@endcomponent

0 comments on commit 5d1e696

Please sign in to comment.