public function buildContents(Context $context, array $bodies, string $salesChannelId): array
    {
        $mailHeaderFooter = $this->findSalesChannel($context, $salesChannelId)->getMailHeaderFooter();
        if ($mailHeaderFooter !== null) {
            return [
                'text/plain' => $mailHeaderFooter->getHeaderPlain() . $bodies['text/plain'] . $mailHeaderFooter->getFooterPlain(),
                'text/html' => $mailHeaderFooter->getHeaderHtml() . $bodies['text/html'] . $mailHeaderFooter->getFooterHtml(),
            ];
        }

        return $bodies;
    }
public function buildContents(Context $context, array $bodies, string $salesChannelId): array
    {
        $mailHeaderFooter = $this->findSalesChannel($context, $salesChannelId)->getMailHeaderFooter();
        if ($mailHeaderFooter !== null) {
            return [
                'text/plain' => $mailHeaderFooter->getHeaderPlain() . $bodies['text/plain'] . $mailHeaderFooter->getFooterPlain(),
                'text/html' => $mailHeaderFooter->getHeaderHtml() . $bodies['text/html'] . $mailHeaderFooter->getFooterHtml(),
            ];
        }

        return $bodies;
    }
public function buildContents ( Context $ context , array $ bodies , string $ salesChannelId ) : array { $ mailHeaderFooter = $ this -> findSalesChannel ( $ context , $ salesChannelId ) -> getMailHeaderFooter ( ) ; if ( $ mailHeaderFooter !== null ) { return [ 'text/plain' => $ mailHeaderFooter -> getHeaderPlain ( ) . $ bodies [ 'text/plain' ] . $ mailHeaderFooter -> getFooterPlain ( ) , 'text/html' => $ mailHeaderFooter -> getHeaderHtml ( ) . $ bodies [ 'text/html' ] . $ mailHeaderFooter -> getFooterHtml ( ) , ] ; } return $ bodies ; }
Attaches header and footer to given email bodies

@param array $bodies e.g. ['text/plain' => 'foobar', 'text/html' => '<h1>foobar</h1>']

@return array e.g. ['text/plain' => '{{foobar}}', 'text/html' => '<h1>{{foobar}}</h1>']
Attaches header and footer to given email bodies