We are currently overriding the standard GF form action with an external URL, to which our various form fields are posted. This works fine, but as it completely bypasses the GF form processing, it doesn’t save a copy of the form submission and doesn’t send any form notifications. Does anyone know of a way of capturing the form data so it can be sent to an email address after the form action has posted the data (or even just before if that’s easier)?
This is the code we’re currently using:
add_filter( 'gform_form_tag', 'form_tag', 10, 2 );
function form_tag( $form_tag, $form ) {
if ( $form['id'] = 1 ) {
$form_tag = preg_replace( "|action='(.*?)'|", "action='https://analytics-eu.clickdimensions.com/forms/h/xxxxxxxxxxxxxxxxxxx'", $form_tag );
return $form_tag;
}
else {
return $form_tag;
}
}