<commit_before><?php namespace Flarum\Core\Notifications\Senders;

use Flarum\Core\Notifications\Types\Notification;
use Flarum\Core\Models\User;
use Flarum\Core\Models\Forum;
use Illuminate\Mail\Mailer;
use ReflectionClass;

class NotificationEmailer implements NotificationSender
{
    public function __construct(Mailer $mailer, Forum $forum)
    {
        $this->mailer = $mailer;
        $this->forum = $forum;
    }

    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());
        });
    }
<commit_msg>Fix broken notification emailer<commit_after><?php namespace Flarum\Core\Notifications\Senders;

use Flarum\Core\Notifications\Types\Notification;
use Flarum\Core\Models\User;
use Flarum\Core\Models\Forum;
use Illuminate\Mail\Mailer;
use ReflectionClass;

class NotificationEmailer implements NotificationSender
{
    public function __construct(Mailer $mailer, Forum $forum)
    {
        $this->mailer = $mailer;
        $this->forum = $forum;
    }

    public function send(Notification $notification, User $user)
    {
        $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());
            }
        );
    }

{'fraction_non_alphanumeric': 0.1404526987811956, 'fraction_numerical': 0.0, 'mean_word_length': 3.1743341404358354, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '673063', 'n_tokens_mistral': 500, 'n_tokens_neox': 477, 'n_words': 94}