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.

Gform after submission issue

  1. I am trying to add the gform after submission code to the functions.php. I am not a coder, but it seems pretty straightforward and I have set up other forms to pass data to this same third party form. I have looked through the forum and google, but did not see a post that would take care of my issue.

    This is the code I inserted:

    add_action('gform_after_submission_1', 'post_to_third_party', 10, 2);
    
    function post_to_third_party($entry, $form) {
    
        $post_url = 'http://www.webaddress.com/formcentral.php';
    
        $body = array(
    
    "contact_name" => $entry["1"],
    "email" => $entry["2"],
    "cphone1" => $entry["7"],
    "comment" => $entry["4"],
    "site" => $entry["5"],
    "id" => $entry["6"],
    
            );
    
        $request = new WP_Http();
    
        $response = $request->post($post_url, array('body' => $body));

    I added the _1 so only the data from form 1 will pass to the third party form. I have mapped all the data to the appropriate field, but still no go. Do you have any suggestions? If you need me to post a link or something, let me know where I can send it and you are free to look.

    Posted 13 years ago on Monday September 17, 2012 | Permalink
  2. You mentioned what you did but did not mention what happens. What happens right now? Is your hook being executed? What does $response return at the end? What does $request hold? HOw about the $body array? Basically you need to work your way backward to find out where it's failing. If you would like to send a link to me, you can send it to chris@rocketgenius.com - Please include a WordPress administrator login. Thank you.

    Posted 13 years ago on Tuesday September 18, 2012 | Permalink
  3. I sent you an email. I realize I should have posted this to the priority support since I have developer license. I appreciate you looking at this and apologize for not having some of the info you needed.

    Posted 13 years ago on Wednesday September 19, 2012 | Permalink