Ejemplo n.º 1
0
 /**
  * Send form action handler
  */
 public function sendAction()
 {
     $res = new stdClass();
     $form = new Application_Form_Contact();
     if ($form->isValid($_POST)) {
         $res->success = true;
         $lang = Zend_Registry::get('Zend_Translate');
         $subject = $lang->translate($form->type->getValue());
         $message = $form->message->getValue();
         $fromName = $form->name->getValue();
         $fromEmail = $form->email->getValue();
         $this->sendMail($subject, $message, $fromName, $fromEmail);
         // Send email
     } else {
         $res->errors = array_keys($form->getMessages());
     }
     $this->_helper->json->sendJson($res);
 }