Skip to content

Instantly share code, notes, and snippets.

@daKmoR
Created October 18, 2011 11:50
Show Gist options
  • Save daKmoR/1295247 to your computer and use it in GitHub Desktop.
Save daKmoR/1295247 to your computer and use it in GitHub Desktop.
<?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