Decorate component
This commit is contained in:
@@ -61,7 +61,8 @@ class SendIncidentEmailNotificationHandler
|
||||
*/
|
||||
public function handle(IncidentHasReportedEvent $event)
|
||||
{
|
||||
$data = $this->presenter->decorate($event->incident);
|
||||
$incident = $this->presenter->decorate($event->incident);
|
||||
$component = $this->presenter->decorate($event->incident->component);
|
||||
|
||||
// Only send emails for public incidents.
|
||||
if ($event->incident->visible === 1) {
|
||||
@@ -69,10 +70,11 @@ class SendIncidentEmailNotificationHandler
|
||||
$mail = [
|
||||
'email' => $subscriber->email,
|
||||
'subject' => 'New incident reported.',
|
||||
'component_name' => $event->incident->component->name,
|
||||
'status' => $data->humanStatus,
|
||||
'htmlContent' => $data->formattedMessage,
|
||||
'textContent' => $data->message,
|
||||
'hasComponent' => ($event->incident->component) ? true : false,
|
||||
'componentName' => $component->name,
|
||||
'status' => $incident->humanStatus,
|
||||
'htmlContent' => $incident->formattedMessage,
|
||||
'textContent' => $incident->message,
|
||||
'token' => $subscriber->token,
|
||||
'unsubscribeLink' => route('subscribe.unsubscribe', ['code' => $subscriber->verify_code]),
|
||||
'appUrl' => env('APP_URL'),
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
<p>
|
||||
{!! $status !!}
|
||||
@if(isset($incident->component))
|
||||
({{ $incident->component->name }})
|
||||
@if($hasComponent)
|
||||
({{ $componentName }})
|
||||
@endif
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{!! trans('cachet.subscriber.email.incident.text', ['app_name' => Setting::get('app_name')]) !!}
|
||||
|
||||
{!! $status !!}
|
||||
@if($component_name)
|
||||
({{ $component_name }})
|
||||
@if($hasComponent)
|
||||
({{ $componentName }})
|
||||
@endif
|
||||
|
||||
{!! $textContent !!}
|
||||
|
||||
Reference in New Issue
Block a user