简体   繁体   中英

RealURL used in email link

In the Typo3 backend I'm redering my email body with a Fluid template. In the following way:

$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();

In the loaded email template I'm making an absolute link to a page with the following line:

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

This is generating a working link only it is not processed by RealURL. Is it possible that is will be done?

You need a valid frontend context for realurl to work. Therefore I suggest that you move your email template to a page type and use a subrequest to render the HTML.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM