public function showAction()
 {
     $form = Mail_Model_Mail::getMailForm($this->view->docid);
     if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getParams())) {
         try {
             Mail_Model_Mail::sendMail($this->view->docid, $this->getRequest()->getParams());
             $this->view->message = 'Sent successfully';
         } catch (Zend_Exception $e) {
             $this->view->message = 'Error: ' . $e->getMessage();
         }
     } else {
         $this->view->form = $form;
         $this->view->content = Uman_Utils::getXhtml($this->view->docid);
     }
 }
 /**
  * Forget password action
  *
  * 2-steps password restore:
  *
  * 1: confirm on password restoration sents to users' email
  * 2: if confirmed, new password generated and sends to user email
  * (forgetPwdConfirmAction)
  */
 public function forgetPasswordAction()
 {
     $form = new Users_Form_Auth_Forget();
     if ($this->_request->isPost()) {
         if ($form->isValid($this->_getAllParams())) {
             $user = $this->_manager->forgetPassword($form->getValue('email'));
             if ($user) {
                 // send email
                 Mail_Model_Mail::forgetPassword($user);
                 $message = 'The confirmation email to reset your ' . 'password is sent. Please check your email ';
                 $this->_flashMessenger->addMessage($message);
                 $this->_helper->redirector->gotoRoute(array(), 'login');
             }
         } else {
             // show errors
             $errors = $form->getErrors();
             foreach ($errors as $fn => $error) {
                 if (empty($error)) {
                     continue;
                 }
                 $el = $form->getElement($fn);
                 $dec = $el->getDecorator('HtmlTag');
                 $cls = $dec->getOption('class');
                 $dec->setOption('class', $cls . ' error');
             }
         }
     }
     $this->view->form = $form;
 }