Hi @mariovalney I’m hoping you can assist?
I have adapted the code you shared above and it is working for _url, _user_agent, and _remote_ip — however it is not working for _time, _date, _post_title
Can you please advise on how I can get those special mail tags into my Zapier?
Thank you @mariovalney
<?php
add_filter( 'ctz_get_data_from_contact_form', 'ds_add_data_to_zapier', 10, 2 );
function ds_add_data_to_zapier( $data, $contact_form ) {
$submission = WPCF7_Submission::get_instance();
if ( empty( $submission ) ) return $data;
$post_title = $submission->get_meta( 'post_title' );
$remote_ip = $submission->get_meta( 'remote_ip' );
$url = $submission->get_meta( 'url' );
$user_agent = $submission->get_meta( 'user_agent' );
$date = $submission->get_meta( 'date' );
$time = $submission->get_meta( 'time' );
$data['post_title'] = ( ! empty( $post_title ) ) ? $post_title : '';
$data['ip'] = ( ! empty( $remote_ip ) ) ? $remote_ip : '';
$data['referrer'] = ( ! empty( $url ) ) ? esc_url( $url ) : '';
$data['ua'] = ( ! empty( $user_agent ) ) ? esc_url( $user_agent ) : '';
$data['date'] = ( ! empty( $date ) ) ? esc_url( $date ) : '';
$data['time'] = ( ! empty( $time ) ) ? esc_url( $time ) : '';
return $data;
}
?>