Support

Account

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);