Guest User

mailfunction in croogo

a guest
Mar 11th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. <---contact.ctp--->/Vendor/croogo/croogo/Nodesview/contact.ctp
  2. <?php
  3.  
  4. echo $this->Session->flash();
  5.  
  6. echo $this->Form->create('Post');
  7. echo $this->Form->input('name',array('required'=>'required'));
  8. echo $this->Form->input('email',array('required'=>'required','type'=>'email'));
  9. echo $this->Form->input('phone',array('required'=>'required'));
  10. echo $this->Form->input('subject',array('required'=>'required'));
  11. echo $this->Form->input('message',array('required'=>'required', 'type' => 'textarea')).'<br>' ;
  12. echo $this->Form->end('SEND');
  13.  
  14. ?>
  15.  
  16. <---NodesController.php--->
  17. public function contact() {
  18. // var_dump($this->request->data);
  19. if (!empty($this->request->data)) {
  20.  
  21. if ($this->Post->save($this->request->data)) {
  22. //
  23. // App::uses('CakeEmail', 'Network/Email');
  24. // $Email = new CakeEmail();
  25. // $Email->from(array($this->request->data['Post']['email'] => $this->request->data['Post']['name']));
  26. // $Email->to('[email protected]');
  27. // $Email->subject($this->request->data['Post']['subject']);
  28. //// var_dump($Email->subject());
  29. //// exit();
  30. // $Email->send($this->request->data['Post']['message']);
  31. //
  32. //
  33. // $this->Session->setFlash('Email sent.');
  34.  
  35. $this->redirect(array('action' => 'contact'));
  36. }
  37. }
  38. $this->set('posts', $this->Post->find('all'));
  39. }
Advertisement
Add Comment
Please, Sign In to add comment