Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!$this->Contact->validates()){
- $this->validateErrors($this->Contact);
- $this->Session->setFlash("Certain champs n'ont pas été remplis correctements",'notif',array('type'=>'error'));
- }
- else{
- $this->Email->to = "contact@*****.fr";
- $this->Email->subject = 'Grafikart :: Contact';
- $this->Email->replyTo = $this->request->data['Contact']['mail'] . ' <' . $this->request->data['Contact']['mail'] . '>';
- $this->Email->from = $this->request->data['Contact']['mail'];
- if ($this->Email->send($this->request->data['Contact']['content'])) {
- $this->Session->setFlash('Votre mail a bien été envoyé, vous devriez recevoir une réponse bientôt.','notif');
- $this->redirect(array('action'=>'index'));
- }
- else {
- $this->Session->setFlash('Erreur lors de l\'envoi du mail, veuillez réessayer plus tard','notif',array('type'=>'error'));
- debug($this->Email->smtpError);
- }
- }
Add Comment
Please, Sign In to add comment