[TYPO3-mvc] Locallang for Stand_Alone_View not working

Henjo Hoeksma me at henjohoeksma.nl
Fri Apr 15 11:50:58 CEST 2011


Hi list,

I have created an email method in my base controllor like this:

<code>
    protected function sendEmail(array $sender, array $recipients, 
$subject, $templateName, array $variables) {
	$emailView = $this->objectManager->create('Tx_Fluid_View_StandaloneView');
	$emailView->setFormat('html');
	$extbaseFrameworkConfiguration = 
$this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
	$templateRootPath 

= 
t3lib_div::getFileAbsFileName($extbaseFrameworkConfiguration['view']['templateRootPath']);
	$layoutRootPath 

= 
t3lib_div::getFileAbsFileName($extbaseFrameworkConfiguration['view']['layoutRootPath']);
	$partialRootPath 

= 
t3lib_div::getFileAbsFileName($extbaseFrameworkConfiguration['view']['partialRootPath']);
	$templatePathAndFilename 

= $templateRootPath . 'Email/' .$templateName . '.html';
	$emailView->setTemplatePathAndFilename($templatePathAndFilename);
	$emailView->setLayoutRootPath($layoutRootPath);
	$emailView->setPartialRootPath($partialRootPath);
	$emailView->assignMultiple($variables);
	$emailBody = $emailView->render();
	$mail = t3lib_div::makeInstance('t3lib_mail_Message');
	$mail->setFrom($sender)
	      ->setTo($recipients)
	      ->setSubject($subject)
	      ->setBody($emailBody);

	// Plain text example
	$mail->setBody($emailBody, 'text/plain');

	// HTML Email
	$mail->setBody($emailBody, 'text/html');

	$mail->send();die();
	return $mail->isSent();
    }
</code>

This works perfectly fine. Except my LL labels are not parsed somehow.
Is it missing config?

BTW The die(); is for testing purposes of course ;-)

Thanks,

Henjo



More information about the TYPO3-project-typo3v4mvc mailing list