emails.php
958 Bytes
<?php
/**
* Understrap emails
*
* @package Understrap
*/
// Exit if accessed directly.
add_filter( 'cf7_2_post_status_wpsl_stores', 'publish_new_wpsl_stores',10,3);
/**
* Function to change the post status of saved/submitted posts.
* @param string $status the post status, default is 'draft'.
* @param string $ckf7_key unique key to identify your form.
* @param array $submitted_data complete set of data submitted in the form as an array of field-name=>value pairs.
* @return string a valid post status ('publish'|'draft'|'pending'|'trash')
*/
function publish_new_wpsl_stores($status, $ckf7_key, $submitted_data){
$email = $submitted_data['your-email'];
$subject = 'Important Registration Information';
$message = file_get_contents('registration-confirmation.html');
$headers_customer = array('Content-Type: text/html; charset=UTF-8');
wp_mail( $email , $subject, $message, $headers_customer);
return 'draft';
}