Admin_FeedbackController::replyAction PHP Метод

replyAction() публичный Метод

Reply action
public replyAction ( )
    public function replyAction()
    {
        $this->getHelper('contextSwitch')->addActionContext('reply', 'json')->initContext();
        $auth = Zend_Auth::getInstance();
        $user = new User($auth->getIdentity());
        $fromEmail = $user->getEmail();
        $feedbackId = $this->getRequest()->getParam('parent');
        $subject = $this->getRequest()->getParam('subject');
        $message = $this->getRequest()->getParam('message');
        $feedback = $this->feedbackRepository->find($feedbackId);
        $user = $feedback->getUser();
        $toEmail = $user->getEmail();
        /*
        $configMail = array( 'auth' => 'login',
                             'username' => '[email protected]',
                             'password' => 'password',
                             'ssl' => 'ssl',
                             'port' => 465
        );
        $mailTransport = new Zend_Mail_Transport_Smtp('smtp.gmail.com',$configMail);
        */
        $mail = new Zend_Mail('utf-8');
        $mail->setSubject($subject);
        $mail->setBodyText($message);
        $mail->setFrom($fromEmail);
        $mail->addTo($toEmail);
        try {
            $mail->send();
            $this->view->status = 200;
            $this->view->message = 'succcesful';
        } catch (Exception $e) {
            $this->view->status = 200;
            $this->view->message = 'succcesful?';
        }
    }