From 1adfe5d867d3451b11e615665dde2ffee86d6860 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 19 May 2015 10:53:17 +0930 Subject: [PATCH] Fix broken notification emailer --- .../Notifications/Senders/NotificationEmailer.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/framework/core/src/Core/Notifications/Senders/NotificationEmailer.php b/framework/core/src/Core/Notifications/Senders/NotificationEmailer.php index c903b3e09..58c7a9897 100644 --- a/framework/core/src/Core/Notifications/Senders/NotificationEmailer.php +++ b/framework/core/src/Core/Notifications/Senders/NotificationEmailer.php @@ -16,10 +16,14 @@ class NotificationEmailer implements NotificationSender public function send(Notification $notification, User $user) { - $this->mailer->send($notification->getEmailView(), ['notification' => $notification], function ($message) use ($notification, $recipient) { - $message->to($recipient->email, $recipient->username) - ->subject('['.$this->forum->title.'] '.$notification->getEmailSubject()); - }); + $this->mailer->send( + $notification->getEmailView(), + compact('notification', 'user'), + function ($message) use ($notification, $user) { + $message->to($user->email, $user->username) + ->subject('['.$this->forum->title.'] '.$notification->getEmailSubject()); + } + ); } public static function compatibleWith($class)