Skip to content

Commit

Permalink
Merge pull request #3270 from JamesWilson19947/add-markdown-to-emails
Browse files Browse the repository at this point in the history
Added markdown to some emails #3101
  • Loading branch information
jbrooksuk committed Oct 15, 2018
2 parents 40e9815 + 363c9fb commit 8fe5dc2
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,15 @@ public function toMail($notifiable)
]);

return (new MailMessage())
->subject(trans('notifications.component.status_update.mail.subject'))
->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.manage.manage_at_link', ['link' => cachet_route('subscribe.manage', $notifiable->verify_code)]));
->subject(trans('notifications.component.status_update.mail.subject'))
->markdown('notifications.component.update', [
'componentName' => $this->component->name,
'content' => $content,
'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
23 changes: 13 additions & 10 deletions app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,19 @@ public function toMail($notifiable)
]);

return (new MailMessage())
->subject(trans('notifications.incident.update.mail.subject'))
->greeting(trans('notifications.incident.update.mail.title', [
'name' => $this->update->incident->name,
'new_status' => $this->update->human_status,
]))
->line($content)
->action(trans('notifications.incident.update.mail.action'), cachet_route('incident', [$this->update->incident]))
->line($this->update->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)]));
->subject(trans('notifications.incident.update.mail.subject'))
->markdown('notifications.incident.update', [
'incident' => $this->update->incident,
'content' => $content,
'actionText' => trans('notifications.incident.new.mail.action'),
'actionUrl' => cachet_route('incident', [$this->update->incident]),
'incidentName' => $this->update->incident->name,
'newStatus' => $this->update->human_status,
'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
13 changes: 8 additions & 5 deletions app/Notifications/Schedule/NewScheduleNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ public function toMail($notifiable)
]);

return (new MailMessage())
->subject(trans('notifications.schedule.new.mail.subject'))
->greeting(trans('notifications.schedule.new.mail.title'))
->line($content)
->action(trans('notifications.schedule.new.mail.action'), cachet_route('schedule', [$this->schedule]))
->line(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)]));
->subject(trans('notifications.schedule.new.mail.subject'))
->markdown('notifications.schedule.new', [
'content' => $content,
'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
11 changes: 11 additions & 0 deletions resources/views/notifications/component/update.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@component('mail::message')
# {{ trans('notifications.component.status_update.mail.greeting') }}

{{ $content }}

Thanks,<br>
{{ Config::get('setting.app_name') }}

@include('notifications.partials.subscription')

@endcomponent
11 changes: 11 additions & 0 deletions resources/views/notifications/incident/update.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@component('mail::message')
# {{ trans('notifications.incident.update.mail.title', ['name' => $incidentName, 'new_status' => $newStatus]) }}

{{ $content }}

Thanks,<br>
{{ Config::get('setting.app_name') }}

@include('notifications.partials.subscription')

@endcomponent
11 changes: 11 additions & 0 deletions resources/views/notifications/schedule/new.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@component('mail::message')
# {{ trans('notifications.schedule.new.mail.title') }}

{{ $content }}

Thanks,<br>
{{ Config::get('setting.app_name') }}

@include('notifications.partials.subscription')

@endcomponent

0 comments on commit 8fe5dc2

Please sign in to comment.