RealURL用于电子邮件链接

时间:2015-05-07 20:03:13

标签: typo3 realurl

在Typo3后端,我正在使用Fluid模板来查找我的电子邮件正文。通过以下方式:

$emailView = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
$templateName = 'path/to/email/template.html';
$extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
$templateRootPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($extbaseFrameworkConfiguration['view']['templateRootPath']);
$templatePathAndFilename = $templateRootPath . $templateName;
$emailView->setTemplatePathAndFilename($templatePathAndFilename);
$emailView->assignMultiple($variables);
$emailBody = $emailView->render();

在加载的电子邮件模板中,我正在使用以下行创建指向页面的绝对链接:

<f:link.action absolute="true" pluginName="name" extensionName="extName" pageUid="{PageId}" controller="Ads" arguments="{uid: uid}">Klik hier</f:link.action>

这是生成一个工作链接,只是它不由RealURL处理。是否可能会这样做?

1 个答案:

答案 0 :(得分:0)

您需要一个有效的前端上下文才能实现。因此,我建议您将电子邮件模板移动到页面类型,并使用子请求呈现HTML。

相关问题