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!