Check out the Replace MyListing’s Contact Form 7 with Elementor Pro guide for more information.
// RECIPIENT MANAGEMENT FOR ELEMENTOR PRO SINGLE LISTING CONTACT FORMS
// If the email field is NOT filled in by the Listing owner, the form will send to the Listing owner.
// If the email field is filled in, the form will send to the email addresses entered.
function contact_form_email_func( $atts ){
$postID = get_the_ID();
$job_email = get_post_meta($postID, '_job_email')[0];
if(!$job_email){
$author_id = get_post_field('post_author', $postID);
$job_email = get_the_author_meta('user_email', $author_id);
}
return $job_email;
}
add_shortcode( 'contact-form-email', 'contact_form_email_func' );