'; public const WC_HEADING_AFTER = ' '; /** @var TransactionalEmails */ private $transactionalEmails; public function __construct( TransactionalEmails $transactionalEmails ) { $this->transactionalEmails = $transactionalEmails; } public function preprocessContent() { return $this->renderPlaceholderBlock(self::WC_CONTENT_PLACEHOLDER); } public function preprocessHeader() { $wcEmailSettings = $this->transactionalEmails->getWCEmailSettings(); $content = self::WC_HEADING_BEFORE . '

' . self::WC_HEADING_PLACEHOLDER . '

' . self::WC_HEADING_AFTER; return $this->renderTextBlock($content, ['backgroundColor' => $wcEmailSettings['base_color']]); } private function renderTextBlock(string $text, array $styles = []): array { return [ LayoutHelper::row([ LayoutHelper::col([[ 'type' => 'text', 'text' => $text, ]]), ], $styles), ]; } private function renderPlaceholderBlock(string $placeholder): array { return [ LayoutHelper::row([ LayoutHelper::col([[ 'type' => 'placeholder', 'placeholder' => $placeholder, ]]), ]), ]; } }