Created
August 31, 2018 14:26
-
-
Save MrMooky/60f0f88ab36833a97de66f5312356e3d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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