mirror of
https://github.com/saccas/mjml-typo3.git
synced 2024-07-06 09:58:29 +02:00
Use one functional test to ensure everything works, no unit tests with heavy mocking. Update mjml to fix security issues and allow new options. Provide GitHub Actions. This is a public extension with free minutes which should ensure that existing setup still works.
29 lines
664 B
PHP
29 lines
664 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Saccas\Mjml\View;
|
|
|
|
use Saccas\Mjml\Domain\Renderer\RendererInterface;
|
|
use TYPO3\CMS\Fluid\View\StandaloneView;
|
|
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
|
|
|
class MjmlBasedView extends StandaloneView
|
|
{
|
|
protected RendererInterface $renderer;
|
|
|
|
public function __construct(
|
|
ContentObjectRenderer $contentObject,
|
|
RendererInterface $renderer
|
|
) {
|
|
parent::__construct($contentObject);
|
|
|
|
$this->renderer = $renderer;
|
|
}
|
|
|
|
public function render($actionName = null): string
|
|
{
|
|
return $this->renderer->getHtmlFromMjml(parent::render($actionName));
|
|
}
|
|
}
|