/** The action that allows people to send in requests via the contact us * form * @access public * @return void */ public function indexAction() { $form = new ContactUsForm(); $form->removeElement('captcha'); $this->view->form = $form; if ($this->getRequest()->isPost()) { if ($form->isValid($this->_request->getPost())) { $messages = new Messages(); $messages->addComplaint($form->getValues()); $cc = array(); $cc[] = array('email' => $form->getvalue('comment_author_email'), 'name' => $form->getValue('comment_author')); $this->_helper->mailer($form->getValues(), 'contactUs', null, $cc, $cc); $this->getFlash()->addMessage('Your enquiry has been submitted to the Scheme'); $this->redirect('about/contactus/'); } else { $this->getFlash()->addMessage('There are problems with your submission'); $form->populate($form->getValues()); } } }
/** Submit complaints action */ public function indexAction() { $form = new ComplaintsForm(); $this->view->form = $form; if ($this->getRequest()->isPost() && $form->isValid($this->_request->getPost())) { if ($form->isValid($form->getValues())) { $insertData = $form->getValues(); $cc = array(); $cc[] = array('email' => $form->getvalue('comment_author_email'), 'name' => $form->getValue('comment_author')); $this->_helper->mailer($insertData, 'complaint', null, $cc, $cc); $messages = new Messages(); $insert = $messages->addComplaint($insertData); $this->_flashMessenger->addMessage('Your complaint has been submitted'); $this->_redirect('getinvolved/complaints/'); } else { $this->_flashMessenger->addMessage('There are problems with your submission'); $form->populate($form->getValues()); } } }