/** * Gets the message for a notification mail as fluid template * * @param Comment $comment comment which triggers the mail send method * @return string The rendered fluid template (HTML or plain text) * * @throws \Exception */ protected function getMailMessage(Comment $comment) { $mailTemplate = GeneralUtility::getFileAbsFileName($this->getTemplatePath()); if (!file_exists($mailTemplate)) { throw new \Exception('Mail template (' . $mailTemplate . ') not found. '); } $this->fluidTemplate->setTemplatePathAndFilename($mailTemplate); // Assign variables $this->fluidTemplate->assign('comment', $comment); $this->fluidTemplate->assign('settings', $this->settings); $uriBuilder = $this->controllerContext->getUriBuilder(); $subFolder = $this->settings['subFolder'] ? $this->settings['subFolder'] : ''; $articleLink = 'http://' . GeneralUtility::getHostname() . $subFolder . '/' . $uriBuilder->setTargetPageUid($comment->getPid())->setAddQueryString($this->getAddQueryStringToLinks())->setArgumentsToBeExcludedFromQueryString(array('id', 'cHash', 'tx_pwcomments_pi1[action]', 'tx_pwcomments_pi1[controller]'))->setUseCacheHash(FALSE)->buildFrontendUri(); $this->fluidTemplate->assign('articleLink', $articleLink); $backendDomain = $this->settings['overwriteBackendDomain'] ? $this->settings['overwriteBackendDomain'] : GeneralUtility::getHostname(); $backendLink = 'http://' . $backendDomain . $subFolder . '/typo3/alt_doc.php?M=web_list&id=' . $comment->getPid() . '&edit[tx_pwcomments_domain_model_comment][' . $comment->getUid() . ']=edit'; $this->fluidTemplate->assign('backendLink', $backendLink); return $this->fluidTemplate->render(); }
/** * Initializes Template in Fluid renderer */ protected function initTemplate() { $fullQualifiedTemplatePath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->templatePath); $this->fluidRenderer->setTemplatePathAndFilename($fullQualifiedTemplatePath); }