This is the code that I use to send emails
and it works great on 1.7.2
If you need access I will send you through the Priority Support
acf_form(array(
‘post_id’ => ‘new_post’,
‘post_title’ => false,
‘post_content’ => false,
‘new_post’ => array(
‘post_type’ => ‘vacation_place’,
‘post_status’ => ‘publish’
),
‘return’ => ‘https://www.gig-jockey.com/travel-sent’,
‘submit_value’ => ‘Send’
));
$current_user_id = get_current_user_id();
$current_user_country = get_user_meta( $current_user_id, ‘user_country’, true);
?>
<span style=”display:none;” data-current-user-country=”<?php echo $current_user_country; ?>”></span>
<script>
jQuery(function( $ ) {
var current_user_country = $(“span[data-current-user-country]”).data(‘current-user-country’);
var country_field = $(‘#acf-field_5929c1718c65c’);
$(‘#acf-form’).on(‘submit’, function() {
$(‘.country-err-msg’).remove();
if(country_field.val() === current_user_country) {
country_field.after(‘<div class=”acf-error-message country-err-msg”><p>You can not choose your own country</p></div>’);
return false;
}
});
});
</script>