Skip to content

Instantly share code, notes, and snippets.

@ppadron
Created May 18, 2011 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ppadron/979296 to your computer and use it in GitHub Desktop.
Save ppadron/979296 to your computer and use it in GitHub Desktop.
<?php
/**
* PHP version 5
*
* @package konstati
* @author Pedro Padron <ppadron@w3p.com.br>
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
*/
class ContactUsController extends Zend_Controller_Action
{
public function sendAction()
{
if (!$this->getRequest()->isPost()) {
$this->_redirect('/contact-us');
exit;
}
$params = $this->getRequest()->getParams();
if (!$this->form->isValid($params)) {
$this->_redirect('/contact-us');
return;
}
$test = $this->view->render('email-templates/contact-us.phtml');
$mailer = new Zend_Mail();
$mailer->addTo('ppadron@w3p.com.br')
->setFrom('contato@w3p.com.br', 'Konstati')
->setReplyTo($params['email'])
->setSubject('[Konstati] Contato Via Site')
->setBodyHtml($this->view->partial('email-templates/contact-us.phtml', $params));
$mailer->send();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment