Home › Forums › Front-end Issues › Front End Form send email › Reply To: Front End Form send email
Hmm..
I don’t think that’s an issue.
But really you could just use the regular save_post hook from WP core and check $_POST for ‘acf’..
function my_acf_save_post($post_id) {
if( !isset($_POST['acf']) )
return;
if(get_post_type($post_id) == 'my_custom_post_type') {
$post = get_post($post_id);
$custom = get_post_custom($post_id);
$toEmail = get_bloginfo('admin_email');
$subject = 'Example Subject';
$email_body = 'Example Body Content';
$was_email_sent = wp_mail($toEmail, $subject, $email_body);
}
}
add_action('save_post', array($this, 'my_acf_save_post'), 20);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.