Hi Bob,
simply add to “[_url]” your e-mail-text.
See https://contactform7.com/special-mail-tags/ for further fields, you can add.
Bfn
Michael
Thread Starter
bob
(@dannyotoole)
Ye but when I send the form to zapier using webhooks with this [_url] it doesn’t send anything. I think that’s meant to be used in the mail tab yes? That’s not what im looking for.
I want to send the current page url with all the other form field value in the form submission.
Thread Starter
bob
(@dannyotoole)
just an update:
I found a stackoverflow thread. Below is creating a custom shortcode for cf7 to capture the current page url, and it works. The only problem is the cf7 webhooks dont send the current_url data to zapier, it either doesn’t show up or has no data. Do i need to append it to the form submission? or have i not registered it properly? Where am i going wrong with this?
add_action( 'wpcf7_init', 'wpcf7_add_form_tag_current_url' );
function wpcf7_add_form_tag_current_url() {
// Add shortcode for the form [current_url]
wpcf7_add_form_tag( 'current_url',
'wpcf7_current_url_form_tag_handler',
array(
'name-attr' => true
)
);
}
// Parse the shortcode in the frontend
function wpcf7_current_url_form_tag_handler( $tag ) {
global $wp;
$url = home_url( $wp->request );
return '<input type="hidden" name="current-url" value="'.$url.'" />';
}