Guest User

Untitled

a guest
Oct 17th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. if(!$this->Contact->validates()){
  2. $this->validateErrors($this->Contact);
  3. $this->Session->setFlash("Certain champs n'ont pas été remplis correctements",'notif',array('type'=>'error'));
  4. }
  5. else{
  6. $this->Email->to = "contact@*****.fr";
  7. $this->Email->subject = 'Grafikart :: Contact';
  8. $this->Email->replyTo = $this->request->data['Contact']['mail'] . ' <' . $this->request->data['Contact']['mail'] . '>';
  9. $this->Email->from = $this->request->data['Contact']['mail'];
  10. if ($this->Email->send($this->request->data['Contact']['content'])) {
  11. $this->Session->setFlash('Votre mail a bien été envoyé, vous devriez recevoir une réponse bientôt.','notif');
  12. $this->redirect(array('action'=>'index'));
  13. }
  14. else {
  15. $this->Session->setFlash('Erreur lors de l\'envoi du mail, veuillez réessayer plus tard','notif',array('type'=>'error'));
  16. debug($this->Email->smtpError);
  17. }
  18. }
Add Comment
Please, Sign In to add comment