Last active
March 10, 2018 17:41
-
-
Save anthonybudd/e3173815d82eb619034038de5e92e600 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Class ContactFormAction extends WP_AJAX{ | |
protected $action = 'contat-form'; | |
protected function run(){ | |
WP_Mail::init() | |
->to('[email protected]') | |
->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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment