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: Infusionsoft Gravity Forms Add-on – WordPress plugin | WordPress.org

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 Gravity Forms Infusionsoft Feed – WordPress plugin | WordPress.org

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

You can use MailOptin as a bridge to connect Gravity Forms to Infusionsoft.

You can map custom fields and specify tags too.

Here is the documentation => Connect Gravity Forms to Mailchimp, AWeber, Sendinblue, MailerLite Etc

And it is free => Popup, Optin Form & Email Newsletters for Mailchimp, HubSpot, AWeber – MailOptin – WordPress plugin | WordPress.org