parseOption('format')); $standaloneView = $this->objectManager->get(MjmlBasedView::class); if (isset($this->options['templatePathAndFilename'])) { $this->options['templatePathAndFilename'] = strtr($this->options['templatePathAndFilename'], [ '{@format}' => $format ]); $standaloneView->setTemplatePathAndFilename($this->options['templatePathAndFilename']); } else { 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'], [ '{@format}' => $format ]); $standaloneView->setTemplate($this->options['templateName']); } $standaloneView->assign('finisherVariableProvider', $this->finisherContext->getFinisherVariableProvider()); if (isset($this->options['templateRootPaths']) && is_array($this->options['templateRootPaths'])) { $standaloneView->setTemplateRootPaths($this->options['templateRootPaths']); } if (isset($this->options['partialRootPaths']) && is_array($this->options['partialRootPaths'])) { $standaloneView->setPartialRootPaths($this->options['partialRootPaths']); } if (isset($this->options['layoutRootPaths']) && is_array($this->options['layoutRootPaths'])) { $standaloneView->setLayoutRootPaths($this->options['layoutRootPaths']); } if (isset($this->options['variables'])) { $standaloneView->assignMultiple($this->options['variables']); } $standaloneView->assign('form', $formRuntime); $standaloneView->getRenderingContext() ->getViewHelperVariableContainer() ->addOrUpdate(RenderRenderableViewHelper::class, 'formRuntime', $formRuntime); return $standaloneView; } }