I got a plugin (kind of sign up form), that offers developers some actions/hooks to add their own stuff. Inside the plugin the function is called like this:
// Allow devs to hook in do_action( 'after_record_action', $result, $data, $format );
I guess that
$data is an array storing the form data. After a visitor uses the signup form I want to send a mail containing
How can I execute the following script using
after_record_action? Do I need to add this inside my
// get data from $data array $data['email'] = $email; $data['key'] = $key; // use $data to create a personalized mail $to = $email; $subject = "Wordpress Test"; $content = "Hi, this us your key:" . $key . "Enjoy using it!"; // send mail using wp_mail $status = wp_mail($to, $subject, $content);
I appreciate any help in combining these, as I am not too experienced using php.