Hi everyone,
I’m hoping I can find someone to guide on this bug I’m running into. The code below targets a specific where x is a form ID. I created a web form submission goal in the campaign, pulled the action URL from the form and required field names from it. Gravity Forms does post to the campaign and I saw my entry go through but that’s it. Now I’m not sure if it’s a Gravity Forms issue or Infusionsoft. I had a colleague test it out with their email and their information did not go through. I would appreciate any assistance.
add_filter( 'gform_after_submission_x', 'set_post_content', 10, 3 ); //to be replaced with form ID
function set_post_content( $entry, $form ) {
$post_url = 'https://abc.infusionsoft.com/app/form/process/xyz'; //xyz is unique to the form created in infusionsoft
$fields = array(
'inf_field_FirstName'=> rgar( $entry, 'a' ),//a can vary depending on the field ID for firstname
'inf_field_LastName'=> rgar( $entry, 'b' ),//b can vary depending on the field ID for lastname
'inf_field_Email'=> rgar( $entry, 'c' ),//c can vary depending on the field ID for email
'inf_form_xid' => 'xyz',//matches the unique ID in the $post_url string
'infusionsoft_version' => '1.70.0.77019',
'inf_form_name' => 'Web Form submitted'
);
GFCommon::log_debug( 'gform_confirmation: body => ' . print_r( $fields, true ) );
$request = new WP_Http();
$response = $request->post( $post_url, array( 'body' => $fields ) );
GFCommon::log_debug( 'gform_confirmation: response => ' . print_r( $response, true ) );
}