Guest User

Untitled

a guest
Mar 19th, 2018
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <?php
  2.  
  3. Class ContactFormAction extends WP_AJAX{
  4.  
  5. protected $action = 'contat-form';
  6.  
  7. protected function run(){
  8.  
  9. WP_Mail::init()
  10. ->to('anthonybudd@gmail.com')
  11. ->subject('New contact from enquiry: {{name}}')
  12. ->template(get_template_directory() .'/emails/contact.html', [
  13. 'time' => date('Y-m-d H:i:s'),
  14. 'name' => $this->get('full_name'),
  15. 'email' => $this->get('email'),
  16. 'message' => $this->get('message'),
  17. ])
  18. ->send();
  19.  
  20. }
  21. }
  22.  
  23. ContactFormAction::listen();
Add Comment
Please, Sign In to add comment