Forum\Controller\Post\SaveController::sendMail PHP Метод

sendMail() защищенный Метод

sendMail
protected sendMail ( Windwalker\Record\Record $topic, Windwalker\Data\Data $data ) : void
$topic Windwalker\Record\Record
$data Windwalker\Data\Data
Результат void
    protected function sendMail($topic, $data)
    {
        $topicNotifies = Notification::getNotifications('topic', $topic->id);
        $catNotifies = Notification::getNotifications('category', $topic->category_id);
        $notifications = array_merge($topicNotifies->email, $catNotifies->email);
        if (!count($notifications)) {
            return;
        }
        $view = $this->getView('Mail');
        $view['topic'] = $topic;
        $view['siteName'] = HtmlHeader::getSiteName();
        $view['link'] = $this->getSuccessRedirect($data);
        $body = $view->setLayout('new-post')->render();
        $message = SwiftMailer::newMessage('A new reply for topic: ' . $topic->title)->setBody($body);
        foreach ($notifications as $notification) {
            $message->addTo($notification);
        }
        SwiftMailer::send($message);
    }