diff --git a/app/Bus/Handlers/Events/Component/SendComponentUpdateEmailNotificationHandler.php b/app/Bus/Handlers/Events/Component/SendComponentUpdateEmailNotificationHandler.php index 264d2bf5..38dd9689 100644 --- a/app/Bus/Handlers/Events/Component/SendComponentUpdateEmailNotificationHandler.php +++ b/app/Bus/Handlers/Events/Component/SendComponentUpdateEmailNotificationHandler.php @@ -57,7 +57,7 @@ class SendComponentUpdateEmailNotificationHandler */ public function handle(ComponentWasUpdatedEvent $event) { - $component = AutoPresenter::decorate($event->component); + $component = $event->component; // First notify all global subscribers. $globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get(); @@ -92,6 +92,8 @@ class SendComponentUpdateEmailNotificationHandler */ public function notify(Component $component, Subscriber $subscriber) { + $component = AutoPresenter::decorate($component); + $mail = [ 'subject' => trans('cachet.subscriber.email.component.subject'), 'component_name' => $component->name, diff --git a/app/Bus/Handlers/Events/Incident/SendIncidentEmailNotificationHandler.php b/app/Bus/Handlers/Events/Incident/SendIncidentEmailNotificationHandler.php index f55c263d..f92e49c0 100644 --- a/app/Bus/Handlers/Events/Incident/SendIncidentEmailNotificationHandler.php +++ b/app/Bus/Handlers/Events/Incident/SendIncidentEmailNotificationHandler.php @@ -107,9 +107,14 @@ class SendIncidentEmailNotificationHandler $mail = [ 'email' => $subscriber->email, - 'subject' => 'New incident reported.', + 'subject' => trans('cachet.subscriber.email.incident.subject', [ + 'status' => $incident->human_status, + 'name' => $incident->name, + ]), 'has_component' => ($event->incident->component) ? true : false, 'component_name' => $component ? $component->name : null, + 'name' => $incident->name, + 'timestamp' => $incident->created_at_formatted, 'status' => $incident->human_status, 'html_content' => $incident->formattedMessage, 'text_content' => $incident->message, diff --git a/app/Bus/Handlers/Events/Incident/SendMaintenanceEmailNotificationHandler.php b/app/Bus/Handlers/Events/Incident/SendMaintenanceEmailNotificationHandler.php index 7d9d9708..faa4fd38 100644 --- a/app/Bus/Handlers/Events/Incident/SendMaintenanceEmailNotificationHandler.php +++ b/app/Bus/Handlers/Events/Incident/SendMaintenanceEmailNotificationHandler.php @@ -107,9 +107,13 @@ class SendMaintenanceEmailNotificationHandler $mail = [ 'email' => $subscriber->email, - 'subject' => 'Scheduled maintenance.', + 'subject' => trans('cachet.subscriber.email.maintenance.subject', [ + 'name' => $incident->name, + ]), 'has_component' => ($event->incident->component) ? true : false, 'component_name' => $component ? $component->name : null, + 'name' => $incident->name, + 'timestamp' => $incident->scheduled_at_formatted, 'status' => $incident->human_status, 'html_content' => $incident->formattedMessage, 'text_content' => $incident->message, diff --git a/resources/lang/en/cachet.php b/resources/lang/en/cachet.php index 57013e1e..46b71e90 100755 --- a/resources/lang/en/cachet.php +++ b/resources/lang/en/cachet.php @@ -86,12 +86,10 @@ return [ 'button' => 'Confirm Subscription', ], 'maintenance' => [ - 'text' => "New maintenance has been scheduled on :app_name.\nThank you, :app_name", - 'html' => '
New maintenance has been scheduled on :app_name.
', + 'subject' => "[Maintenance Scheduled] :name", ], 'incident' => [ - 'text' => "New incident has been reported on :app_name.\nThank you, :app_name", - 'html' => 'New incident has been reported on :app_name.
Thank you, :app_name
', + 'subject' => "[New Incident] :status: :name", ], 'component' => [ 'subject' => 'Component Status Update', diff --git a/resources/views/emails/incidents/maintenance-html.blade.php b/resources/views/emails/incidents/maintenance-html.blade.php index 532b7fbd..c30598c0 100644 --- a/resources/views/emails/incidents/maintenance-html.blade.php +++ b/resources/views/emails/incidents/maintenance-html.blade.php @@ -1,13 +1,19 @@ @extends('layout.emails') @section('content') -{!! trans('cachet.subscriber.email.maintenance.html', ['app_name' => $app_name]) !!} +{{ $scheduled_at }}
- -{!! $status !!}
- -{!! $html_content !!}
+|
+ + {!! $status !!} @if($has_component) ({{ $component_name }}) @endif + {!! $html_content !!} + {!! $timestamp !!} + + |
+
| + |
|
+ + {!! $status !!} @if($has_component) ({{ $component_name }}) @endif + {!! $html_content !!} + {!! $timestamp !!} + + |
+
| + |