Is there a way to specify which "gform after submission hook" to perform based on which form is used?
For example:
Form A > Submits to URL A
Form B > Submits to URL B
The problem I am running into, is that gform after submission hook submits the same values no matter what form is used. This is a problem because different forms have different $entry numbers and values.
($entry 1 may be the first name on Form A, but may be an email address on Form B).
Here is my gform after submission (which works perfectly BTW, when only using ONE FORM. The problem starts when I create multiple gravity forms).
// Post to SAGE CRM
add_action('gform_after_submission', 'post_to_third_party', 10, 2);
function post_to_third_party($entry, $form) {
$post_url = 'http://sage.cpssecurity.com/cpssage/eware.dll/SubmitLead?RuleID=';
$body = array(
'lead_personfirstname' => $entry['1.3'],
'lead_personlastname' => $entry['1.6'],
'lead_companyname' => $entry['2'],
'lead_description' => $entry['2'],
'lead_personemail' => $entry['3'],
'lead_personphonenumber' => $entry['4'],
'lead_servicetype' => $entry['10'],
'lead_cprojvalue' => $entry['11'],
'lead_details' => $entry['5'],
'lead_decisiontimeframe' => $entry['16'],
'lead_subid' => $entry['12'],
'lead_campaign' => $entry['13'],
'lead_source' => $entry['14'],
'lead_companystate' => $entry['15']
);
$request = new WP_Http();
$response = $request->post($post_url, array('body' => $body));
}