• Thanks Greg!

    Is there any way to have the file send to a 3rd party? We send all our Gravity fields to Luxsci.com (with the attached code) for processing and sending, but file uploads are not included. I wonder if your plugin can handle this.

    Thanks, GT

    /* ------------------------------------
    :: luxsci Custom Referral Form
    ------------------------------------ */
    
    add_action("gform_after_submission_3", "post_to_third_party_2", 10, 2);
    function post_to_third_party_2($entry, $form) { 
    
        $post_url = "https://secureform.luxsci.com/perl/post/1.....";
        $body = array();
        $labels = array(); 
    
    foreach($form["fields"] as &$field)
    {
    //see if this is a multi-field, like name or address
    if (is_array($field["inputs"]))
    {
    //loop through inputs
    foreach($field["inputs"] as &$input)
    {
    $label = $input["label"];
    $value = $entry[strval($input["id"])]; 
    
           $labels[$label] = $labels[$label] + 1;
                                            $label = ($labels[$label] == 1) ? $label : $label . "[" . $labels[$label] . "]";
                                             $body[ $label ] = $value; 
    
    }
    }
    else
    {
    $label = $field["label"];
    $value = $entry[$field["id"]]; 
    
    $labels[$label] = $labels[$label] + 1;
                                  $label = ($labels[$label] == 1) ? $label : $label . "[" . $labels[$label] . "]";
                                  $body[ $label ] = $value;
    }
    } 
    
        $request = new WP_Http();
        $response = $request->post($post_url, array('body' => $body)); 
    
    }

    https://www.ads-software.com/plugins/gf-upload-to-email-attachment/

Viewing 1 replies (of 1 total)
  • Plugin Author WP CMS Ninja

    (@billiardgreg)

    My plugin just adds the attachment to the outbound notification from the form. Do not think it handles posting the data to a remote server. But I do not see you not being able to first grab the contents of the file in a variable and send it via POST.

    So the programing would need to get the file location on the server, read all its contents. Set a post variable to that. Then on the receiving end take the content of the post variable and save it to a file.

Viewing 1 replies (of 1 total)
  • The topic ‘3rd Party Integration?’ is closed to new replies.