Created
May 18, 2011 19:12
-
-
Save ppadron/979296 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
<?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