Created
October 18, 2011 11:50
-
-
Save daKmoR/1295247 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
/** | |
* creates the actual text and sends it via e-mail | |
* | |
* @param $newForm | |
* @validate $newForm Tx_Xform_Domain_Validator_XformValidator | |
* @return void | |
*/ | |
public function createAction(Tx_Xform_Domain_Model_Form $newForm) { | |
$view = t3lib_div::makeInstance('Tx_Fluid_View_StandaloneView'); | |
$view->setTemplatePathAndFilename($this->view->getTemplateRootPath() . 'Email/TipAFriend.html'); | |
$view->assign('templateRootPath', $this->view->getTemplateRootPath()); | |
$view->assign('newForm', $newForm); | |
$body = $view->render(); | |
$mail = t3lib_div::makeInstance('t3lib_mail_Message'); | |
$mail->setFrom(array($newForm->getEmail() => $newForm->getName())); | |
$mail->setTo(array($newForm->getEmailTo() => $newForm->getNameTo())); | |
$mail->setSubject('Tip von ' . $newForm->getName()); | |
$mail->setBody($body, 'text/html'); | |
$mail->send(); | |
$this->view->assign('newForm', $newForm); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment