• I’m looking to use Gravity Forms “After Submission” hook to send the inputted data to a third party server.

    Is there a way target the Entry Object Field Values?

    add_action( 'gform_after_submission', 'post_to_third_party', 10, 2 );
    function post_to_third_party( $entry, $form ) {
        
        $post_url = 'https://thirdparty.com';
        $body = array(
            'first_name' => rgar( $entry, '1.3' ), 
            'last_name' => rgar( $entry, '1.6' ), 
            'message' => rgar( $entry, '3' ),
            );
        GFCommon::log_debug( 'gform_after_submission: body => ' . print_r( $body, true ) );
    
        $request = new WP_Http();
        $response = $request->post( $post_url, array( 'body' => $body ) );
        GFCommon::log_debug( 'gform_after_submission: response => ' . print_r( $response, true ) );
    }
  • The topic ‘Targeting form inputs’ is closed to new replies.