Cannot send url to citrix api webinar host
-
I have set up my Gravity forms, on WP 4.0, Avada theme (all compatible) to submit users who want to register for a Citrix Webinar put on by my client fedinsider.com. I am currently in the testing phase of our new site which resides at fedinsidernews.com (private at this point), anyways I have been using the tech support for Gravity Forms and the API support team from Citrix, but we cannot seem to come to any result, and any help would be greatly appreciated.
At first we had a php snippet as follows when not using your plugin, to allow the form to submit to a third party url string, the toughest part of this is we have a drop down menu field to list all of our events, which a user could then choose from and multi-select the webinars they wanted to sign up for. Hence creating one form for all our events (didn’t work):
add_action( ‘gform_after_submission’, ‘post_to_third_party’, 10, 2 );
function post_to_third_party( $entry, $form ) {$body = array(
‘fname’ => $entry[‘1.3’],
‘lname’ => $entry[‘1.6’],
‘company’ => $entry[‘9’],
‘title’ => $entry[‘4’],
‘address1’ => $entry[‘6.1’],
‘address2’ => $entry[‘6.2’],
‘city’ => $entry[‘6.3’],
‘state’ => $entry[‘6.4’],
‘country’ => $entry[‘6.6’],
‘postalcode’ => $entry[‘6.5’],
‘phone’ => $entry[‘3’],
’email’ => $entry[‘2’],
‘custom_question1′ => $entry[’10’],);
// mutliselect field values are stored in a comma separated string so we split that into an array
$webinars = explode( ‘,’, $entry[13] );// loop through the array of selected webinars
foreach ( $webinars as $webinar ) {$body[‘ei’] = $webinar;
GFCommon::log_debug( “post_to_third_party(): body => ” . print_r( $body, true ) );
$request = new WP_Http();
$response = $request->post( $post_url, array( ‘body’ => $body ) );
GFCommon::log_debug( “post_to_third_party(): response => ” . print_r( $response, true ) );}
However after reviewing you plugin, install instructions, and setting up your plugin per your notes, I set the following snippet yet (still doesn’t work) any help would be greatly appreciated. Thanks in advance:
add_action(“ggah_submission_{ei}”, “your_function_hook_name_here_{ei}”, 10, 3);
function your_function_hook_name_here_{ei} ($data, $form, $api)
{
$api_failed = false;add_action(“ggah_submission_{fname}”, “your_function_hook_name_here_{fname}”, 10, 3);
function your_function_hook_name_here_{fname} ($data, $form, $api)
{
$api_failed = false;add_action(“ggah_submission_{lname}”, “your_function_hook_name_here_{lname}”, 10, 3);
function your_function_hook_name_here_{lname} ($data, $form, $api)
{
$api_failed = false;add_action(“ggah_submission_{company}”, “your_function_hook_name_here_{company}”, 10, 3);
function your_function_hook_name_here_{company} ($data, $form, $api)
{
$api_failed = false;add_action(“ggah_submission_{title}”, “your_function_hook_name_here_{title}”, 10, 3);
function your_function_hook_name_here_{title} ($data, $form, $api)
{
$api_failed = false;add_action(“ggah_submission_{address1}”, “your_function_hook_name_here_{address1}”, 10, 3);
function your_function_hook_name_here_{address1} ($data, $form, $api)
{
$api_failed = false;add_action(“ggah_submission_{address2}”, “your_function_hook_name_here_{address2}”, 10, 3);
function your_function_hook_name_here_{address2} ($data, $form, $api)
{
$api_failed = false;add_action(“ggah_submission_{city}”, “your_function_hook_name_here_{city}”, 10, 3);
function your_function_hook_name_here_{city} ($data, $form, $api)
{
$api_failed = false;add_action(“ggah_submission_{state}”, “your_function_hook_name_here_{state}”, 10, 3);
function your_function_hook_name_here_{state} ($data, $form, $api)
{
$api_failed = false;add_action(“ggah_submission_{country}”, “your_function_hook_name_here_{country}”, 10, 3);
function your_function_hook_name_here_{country} ($data, $form, $api)
{
$api_failed = false;add_action(“ggah_submission_{postalcode}”, “your_function_hook_name_here_{postalcode}”, 10, 3);
function your_function_hook_name_here_{postalcode} ($data, $form, $api)
{
$api_failed = false;add_action(“ggah_submission_{phone}”, “your_function_hook_name_here_{phone}”, 10, 3);
function your_function_hook_name_here_{phone} ($data, $form, $api)
{
$api_failed = false;add_action(“ggah_submission_{email}”, “your_function_hook_name_here_{email}”, 10, 3);
function your_function_hook_name_here_{email} ($data, $form, $api)
{
$api_failed = false;add_action(“ggah_submission_{custom_question1}”, “your_function_hook_name_here_{custom_question1}”, 10, 3);
function your_function_hook_name_here_{custom_question1} ($data, $form, $api)
{
$api_failed = false;// Send $data to API Here
add_action( ‘gform_after_submission’, ‘post_to_third_party’, 10, 2 );
function post_to_third_party( $entry, $form ) {$body = array(
‘fname’ => $entry[‘1.3’],
‘lname’ => $entry[‘1.6’],
‘company’ => $entry[‘9’],
‘title’ => $entry[‘4’],
‘address1’ => $entry[‘6.1’],
‘address2’ => $entry[‘6.2’],
‘city’ => $entry[‘6.3’],
‘state’ => $entry[‘6.4’],
‘country’ => $entry[‘6.6’],
‘postalcode’ => $entry[‘6.5’],
‘phone’ => $entry[‘3’],
’email’ => $entry[‘2’],
‘custom_question1′ => $entry[’10’],);
// mutliselect field values are stored in a comma separated string so we split that into an array
$webinars = explode( ‘,’, $entry[13] );// loop through the array of selected webinars
foreach ( $webinars as $webinar ) {$body[‘ei’] = $webinar;
GFCommon::log_debug( “post_to_third_party(): body => ” . print_r( $body, true ) );
$request = new WP_Http();
$response = $request->post( $post_url, array( ‘body’ => $body ) );
GFCommon::log_debug( “post_to_third_party(): response => ” . print_r( $response, true ) );}
// If Api Failed then set $api_failed = true;
// This will send a Simple Email to the Admin to notify them of the error.
if($api_failed)
{
if(function_exists(‘ggah_error_notification’))
{
$email = ‘tmorgan@dreamfaction.com’; // leave blank to use Admin Email
$subject = ”; // leave blank to use Default
$message = ”; // leave blank to use Defaultggah_error_notification($email, $api, $subject, $message);
}
}
}
The topic ‘Cannot send url to citrix api webinar host’ is closed to new replies.