Skip to content
Snippets Groups Projects
Commit c57bfddb authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Reading pid from tsfe

parent 16e4cf73
No related branches found
No related tags found
1 merge request!3New version 4 1
......@@ -39,6 +39,7 @@ use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
/**
* MailTemplateService
......@@ -290,7 +291,14 @@ class MailTemplateService {
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
*/
public function sendEmail($isPreview = FALSE) {
$pageUid = (int) GeneralUtility::_GP('id');
if (TYPO3_MODE === 'FE') {
/** @var TypoScriptFrontendController $tsfe */
$tsfe = $GLOBALS['TSFE'];
$pageUid = $tsfe->id;
} else {
$pageUid = (int) GeneralUtility::_GP('id');
}
$siteRootId = BackendService::getSiteRoot($pageUid);
/** @var Template $template */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment