Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- Class ContactFormAction extends WP_AJAX{
- protected $action = 'contat-form';
- protected function run(){
- WP_Mail::init()
- ->to('anthonybudd@gmail.com')
- ->subject('New contact from enquiry: {{name}}')
- ->template(get_template_directory() .'/emails/contact.html', [
- 'time' => date('Y-m-d H:i:s'),
- 'name' => $this->get('full_name'),
- 'email' => $this->get('email'),
- 'message' => $this->get('message'),
- ])
- ->send();
- }
- }
- ContactFormAction::listen();
Add Comment
Please, Sign In to add comment