Greetings,
I am attempting to use the gform_after_submission to post the results of a form to a 3rd party site. I have followed the examples from http://www.gravityhelp.com/documentation/page/Gform_after_submission and combined it with some outside support on the topic that I found here http://www.0to5blog.com/creative/gravity-forms-submitting-forms-to-3rd-party-applications/. And of course I am having trouble.
I have been able to verify that I can post to the 3rd party site and submit the data to their forms using a command-line "http-ping" tool passing the same parameters as the gform_after_submission should be passing. So the 3rd party site appears to be ready.
I used this same function to have the system email me the form IDs so that I would have them accurately. Here were my results of the Form IDs
Array
(
[1] => dan
[2] => feeley
[3] => dan(at)extremefitnessmartialarts.com
[4] => (203)555-1212
[5] => Mon
[6] => 10AM
[8] => 1403
[9] => redirectpagehere
[10] => 0
[7] =>
)
I then created these functions and added them to my functions.php file as suggested in the working examples of http://www.gravityhelp.com/documentation/page/Gform_after_submission
Here are my functions:
add_action('gform_after_submission_23', 'post_to_third_party', 10, 2);
function post_to_third_party($entry, $form) {
$post_url = 'https://addmembers.com/RainMaker/process/';
$body = array(
"SID" => $entry["8"],
"EMail" => $entry["3"],
"ReturnURL" => $entry["9"],
"formID" => $entry["10"],
"FName" => $entry["1"],
"LName" => $entry["2"],
"Phone" => $entry["4"]
);
$request = new WP_Http();
$response = $request->post($post_url, array('body' => $body));
}
I limited it to happen on Gform 23, and also without the specific form ID number. Either way I do not get a post to the 3rd party system. So I am stumped. I am not a developer by any means, but I can certainly follow good instructions which these examples have. Can you spot anything obvious with this?
Is there a way to have Gforms go into a debug mode, or log what its doing to better troubleshoot?
Any assistance here is greatly appreciated!