mirror of
https://github.com/saccas/mjml-typo3.git
synced 2024-12-23 08:26:09 +01:00
Fix v10
This commit is contained in:
parent
ec45d511c2
commit
2f68fd32da
2 changed files with 7 additions and 5 deletions
|
@ -11,12 +11,12 @@ class MjmlEmailFinisher extends \TYPO3\CMS\Form\Domain\Finishers\EmailFinisher
|
|||
{
|
||||
/**
|
||||
* @param FormRuntime $formRuntime
|
||||
* @param string $format
|
||||
* @return StandaloneView
|
||||
* @throws FinisherException
|
||||
*/
|
||||
protected function initializeStandaloneView(FormRuntime $formRuntime): StandaloneView
|
||||
protected function initializeStandaloneView(FormRuntime $formRuntime, string $format): StandaloneView
|
||||
{
|
||||
$format = ucfirst($this->parseOption('format'));
|
||||
$standaloneView = $this->objectManager->get(MjmlBasedView::class);
|
||||
|
||||
if (isset($this->options['templatePathAndFilename'])) {
|
||||
|
@ -28,10 +28,12 @@ class MjmlEmailFinisher extends \TYPO3\CMS\Form\Domain\Finishers\EmailFinisher
|
|||
if (!isset($this->options['templateName'])) {
|
||||
throw new FinisherException('The option "templateName" must be set for the EmailFinisher.', 1327058829);
|
||||
}
|
||||
$this->options['templateName'] = strtr($this->options['templateName'], [
|
||||
// Use local variable instead of augmenting the options to
|
||||
// keep the format intact when sending multi-format mails
|
||||
$templateName = strtr($this->options['templateName'], [
|
||||
'{@format}' => $format
|
||||
]);
|
||||
$standaloneView->setTemplate($this->options['templateName']);
|
||||
$standaloneView->setTemplate($templateName);
|
||||
}
|
||||
|
||||
$standaloneView->assign('finisherVariableProvider', $this->finisherContext->getFinisherVariableProvider());
|
||||
|
|
|
@ -7,7 +7,7 @@ use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
|||
|
||||
class MjmlBasedView extends StandaloneView
|
||||
{
|
||||
protected RendererInterface $renderer;
|
||||
protected ?RendererInterface $renderer = null;
|
||||
|
||||
public function __construct(ContentObjectRenderer $contentObject = null, RendererInterface $renderer = null)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue