Sylius\Bundle\MailerBundle\Renderer\Adapter\EmailTwigAdapter::provideEmailWithTemplate PHP Method

provideEmailWithTemplate() private method

private provideEmailWithTemplate ( Sylius\Component\Mailer\Model\EmailInterface $email, array $data ) : Sylius\Component\Mailer\Renderer\RenderedEmail
$email Sylius\Component\Mailer\Model\EmailInterface
$data array
return Sylius\Component\Mailer\Renderer\RenderedEmail
    private function provideEmailWithTemplate(EmailInterface $email, array $data)
    {
        $data = $this->twig->mergeGlobals($data);
        /** @var \Twig_Template $template */
        $template = $this->twig->loadTemplate($email->getTemplate());
        $subject = $template->renderBlock('subject', $data);
        $body = $template->renderBlock('body', $data);
        return new RenderedEmail($subject, $body);
    }