markAsRendered example


        return array_merge($this->context, parent::getContext());
    }

    public function isRendered(): bool
    {
        return $this->rendered;
    }

    public function markAsRendered(): void
    {
        parent::markAsRendered();

        $this->rendered = true;
    }

    public function getPreparedHeaders(): Headers
    {
        $headers = parent::getPreparedHeaders();

        $importance = $this->context['importance'] ?? self::IMPORTANCE_LOW;
        $this->priority($this->determinePriority($importance));
        if ($this->context['importance']) {
            
'email' => new WrappedTemplatedEmail($this->twig, $message),
        ]);

        if ($template = $message->getTextTemplate()) {
            $message->text($this->twig->render($template$vars));
        }

        if ($template = $message->getHtmlTemplate()) {
            $message->html($this->twig->render($template$vars));
        }

        $message->markAsRendered();

        // if text body is empty, compute one from the HTML body         if (!$message->getTextBody() && null !== $html = $message->getHtmlBody()) {
            $text = $this->converter->convert(\is_resource($html) ? stream_get_contents($html) : $html$message->getHtmlCharset());
            $message->text($text$message->getHtmlCharset());
        }
    }
}
Home | Imprint | This part of the site doesn't use cookies.