Post to third party after submit

<?php

//Post Form
function post_form($entry,$form){
$post_url = 'http://mydomain.com/mypage';
$body = array(
'firstName' => $entry[1],
'lastName' => $entry[2],
'email' => $entry[3]
);
send_form($post_url,$body);
}

//Send Form
function send_form($post_url,$body){
$request = new WP_Http();
$response = $request->post($post_url, array('body' => $body));
}

//Form Actions
add_action('gform_after_submission', 'post_form', 10, 2);

?>

0 Comments

You must be logged in to post a comment.