Skip to content

Instantly share code, notes, and snippets.

@MrMooky
Created August 31, 2018 14:26
Show Gist options
  • Save MrMooky/60f0f88ab36833a97de66f5312356e3d to your computer and use it in GitHub Desktop.
Save MrMooky/60f0f88ab36833a97de66f5312356e3d to your computer and use it in GitHub Desktop.
$emailView = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
$extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
$emailView->setTemplateRootPaths($extbaseFrameworkConfiguration['view']['templateRootPaths']);
$emailView->setLayoutRootPaths($extbaseFrameworkConfiguration['view']['layoutRootPaths']);
$emailView->setPartialRootPaths($extbaseFrameworkConfiguration['view']['layoutRootPaths']);
$emailView->setTemplate('Email/MailShop.html');
$emailBody = $emailView->render();
$mail = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Mail\\MailMessage');
$mail->setSubject('Some subject');
$mail->setFrom(array('email@address.com' => 'Yachtcare'));
$mail->setTo($receiverEmail);
$mail->setBody($emailBody, 'text/html', 'utf-8');
$mail->send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment