Improve email content and subject, fix component notification presenter

This commit is contained in:
Joseph Cohen
2016-05-28 12:25:36 -05:00
parent bad9b1d550
commit f3440389be
9 changed files with 69 additions and 30 deletions
@@ -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,
@@ -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,
@@ -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,