Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typo3 电子邮件链接中使用的RealURL_Typo3_Realurl - Fatal编程技术网

Typo3 电子邮件链接中使用的RealURL

Typo3 电子邮件链接中使用的RealURL,typo3,realurl,Typo3,Realurl,在Typo3后端,我用流动模板重新设计了我的电子邮件正文。以以下方式: $emailView = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView'); $templateName = 'path/to/email/template.html'; $extbaseFrameworkConfiguration = $this->configurationManager->getConfigu

在Typo3后端,我用流动模板重新设计了我的电子邮件正文。以以下方式:

$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>
Klik-hier

这只是生成了一个工作链接,而RealURL没有处理它。有可能完成吗?

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

您是否有一个如何实现此目的的示例?我发现一个更简单的解决方案是在配置文件中设置enable RealUrl,它可以工作。不知道为什么我没有早点尝试。