PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Posting data to Pipelinedeals.com

  1. I'm trying to send the form data from a lead generation form over to pipelinedeals.com, using gform_after_submission. Here is the code I've put into the functions.php file for the theme:

    add_action('gform_after_submission_6', 'post_to_third_party', 10, 2);
    function post_to_third_party($entry, $form) {
    
        $post_url = 'https://www.pipelinedeals.com/web_lead';
        $body = array(
    		'w2lid' => 'xxxxxxxxxxxxx',
            'lead[first_name]' => $entry['1.3'],
            'lead[last_name]' => $entry['1.6'],
    		'lead[company_name]' => $entry['2'],
            'lead[email]' => $entry['3'],
    		'lead[website]' => $entry['4'],
    		'lead[phone]' => $entry['5'],
    		'lead[custom_value_1]' => $entry['7'],
    		'lead[custom_value_2]' => $entry['9'],
    		'note_1' => $entry['10']
            );
    
        $request = new WP_Http();
        $response = $request->post($post_url, array('body' => $body));

    So I'm not sure how I can troubleshoot this, I don't get any error messages, the form contents hit the database and get emailed to us as normal, but they don't seem to go over to pipelinedeals as far as I can tell.

    Here's Pipelinedeals' api documents if that matters: https://www.pipelinedeals.com/api/docs/web_to_leads, basically they're looking for a normal form with a POST action pointed at 'https://www.pipelinedeals.com/web_lead', which is the address I set gform_after_submission to post to.

    So, anyone have any advice with this? Thanks!

    Posted 9 years ago on Wednesday October 31, 2012 | Permalink
  2. You are going to have to debug by seeing what is sent to pipelinedeals and then what the response is. Can you var_dump the $entry around line 3 of the above code, to see what it contains (make sure everything is where you think it is, and in the proper format) and then dump the $body and the $response as well. You can check the status of the request at every point along the way in your code.

    Does pipelinedeals have any logging where you can see the status of the request?

    Posted 9 years ago on Thursday November 1, 2012 | Permalink
  3. So after getting completely distracted by other projects, I finally came back to this and after going through the var_dumps, this is the code I've come up with and it works! In case anyone else is trying to do this, here it is. It turns out I was just missing the thank you page address.

    add_action('gform_after_submission_6', 'post_to_third_party', 10, 2);
    function post_to_third_party($entry, $form) {
    
        $post_url = 'https://www.pipelinedeals.com/web_lead';
        $body = array(
    		'w2lid' => 'xxxxxxxxxxxxxxx',
    		'thank_you_page' => 'http://www.thankyoupageaddress.com',
            'lead[first_name]' => $entry['1.3'],
            'lead[last_name]' => $entry['1.6'],
    		'lead[company_name]' => $entry['2'],
            'lead[email]' => $entry['3'],
    		'lead[website]' => $entry['4'],
    		'lead[phone]' => $entry['5'],
    		'lead[custom_value_1]' => $entry['7'],
    		'lead[custom_value_2]' => $entry['9'],
    		'note_1' => $entry['10']
            );
    
        $request = new WP_Http();
        $response = $request->post($post_url, array('body' => $body));
    }
    Posted 9 years ago on Wednesday November 28, 2012 | Permalink
  4. Thank you for posting your updated code.

    Posted 9 years ago on Thursday November 29, 2012 | Permalink

This topic has been resolved and has been closed to new replies.