Thanks David.
I think that the second line, below, is edited correctly because the form I want to use has an ID of 2.
If I only have an email address in my form to send to a third party service I would add this to the functions.php as shown below. I'm only guessing because I don't know how to determine the value I found in the braces example: [1] or the name of the email field (I don't see anywhere in the form that tells me that). Even if I'm right about where to put the path I don't know what to do in the array. I probably don't need the array part since it is one value but lets not worry about that.
I would also like to know what the 10 and 2 stand for in the second line of the code below.
I feel like I'm close to the proper solution I hope you can help. Thanks.
?php
add_action('gform_after_submission_2', 'post_to_third_party', 10, 2);
function post_to_third_party($entry, $form) {
$post_url = 'http://app.streamsend.com/public/SDBo/V8c/subscribe';
$body = array(
'email' => $entry['1']
);
$request = new WP_Http();
$response = $request->post($post_url, array('body' => $body));
}
?>
Posted 11 years ago on Wednesday May 29, 2013 |
Permalink