Integrating Gravity Forms with a 3rd Party (Eloqua)

864 views Asked by At

I wondering if you guys could help. I am trying to integrate Gravity forms with Eloqua CRM. I've tried both '3rd Party Integration' plugin and I have also tried adding the gf after submission function in my functions.php file. However, I have not been able to get this to work. My code is below. I entered the url of my form in 'eloqua' (https://s1913652004.t.eloqua.com/e/f2) There is also a form id, but I don't see anywhere to put that.

add_action( 'gform_after_submission_1', 'post_to_third_party', 10, 2 ); function post_to_third_party( $entry, $form ) {

$post_url = 'https://s1913652004.t.eloqua.com/e/f2';
$body = array(
    'first_name' => rgar( $entry, '1.3' ), 
    'last_name' => rgar( $entry, '1.6' ), 
    'email' => rgar( $entry, '2' ),
    'country' => rgar( $entry, '3' ),
    );
GFCommon::log_debug( 'gform_after_submission_1: body => ' . print_r( $body, true ) );

$request = new WP_Http();`enter code here`
$response = $request->post( $post_url, array( 'body' => $body ) );
GFCommon::log_debug( 'gform_after_submission_1: response => ' . print_r( $response, true ) );
1

There are 1 answers

0
Naomi On

Use the Gravity Forms Eloqua Add-On. It's actively maintained.