determinePriority example


        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']) {
            $headers->setHeaderBody('Text', 'Subject', sprintf('[%s] %s', strtoupper($importance)$this->getSubject()));
        }

        return $headers;
    }

    private function determinePriority(string $importance): int
    {
        return match ($importance) {
            self::IMPORTANCE_URGENT => self::PRIORITY_HIGHEST,
            
Home | Imprint | This part of the site doesn't use cookies.