Hi!
As CF7 says:
Unlike other mail-tags, special mail-tags are independent from form fields or the submitter’s input.
So using [_post_url]
in the message body or mail fields are OK, but our plugin uses the form fields as “template” to get data.
Besides that, [hidden post_url default:get]
will work only if you pass a “post_url” value into URL’s params ($_GET variable). Check docs to more details.
To add data without mail tags, you can create a filter to add data like this:
https://www.ads-software.com/support/topic/special-hidden-fileds-to-zapier/
In your case, you should add this code:
add_filter( 'ctz_get_data_from_contact_form', 'jaime_add_data_to_zapier', 10, 2 );
function jaime_add_data_to_zapier( $data, $contact_form ) {
$submission = WPCF7_Submission::get_instance();
if ( empty( $submission ) ) return $data;
$post_id = (int) $submission->get_meta( 'container_post_id' );
if ( empty( $post_id ) ) return $data;
$post = get_post( $post_id );
$post_url = ( ! empty( $post->ID ) ) ? get_permalink( $post->ID ) : '';
$data['post_url'] = $post_url;
return $data;
}
Thanks for using our plugin.