WordPress Gravity Forms HTTP Post

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 ) );
}

I tried this approach some time ago. GF seems to interfer somehow. My solution was to post parameters under confirmations to a php script I wrote to complete the connection to IS.

As far as I know you can no longer post to Infusionsoft forms at all. Regardless of whether you have the google recaptcha enabled or not, you get blocked by the recaptcha if its just a POST and not a “visitor”

Is it a cURL script by any chance?

Hmm well that’s a bummer. The plugin we relied on is unfortunately outdated: https://wordpress.org/plugins/infusionsoft/

So I’m hoping I can find a quick solution in the meantime

You would only be able to use cURL with REST and that would require a system to keep the access token refreshed. So likely not. I normally use PHP.

@Forthea_Development you can use this new GF plugin https://wordpress.org/plugins/systasis-gf-infusionsoft-feed/

Or switch to something like FormLift. https://formlift.net