Got it. I am working on integrating WP eMember member registration with GF User registration. eMember has a API that can accept Post or Get HTTP requests and create a member. I have followed their code exactly but it still doesn't work. I am hoping that you can give my code a rundown to see if I am doing something wrong from the GF standpoint. I know the form id's are correct. This code is in my functions.php file. The form id is 11.
// Add For Gravity Forms Post Submission
function gf_register_add_ons($user_id, $config, $entry, $user_pass)
{
//Check which gravity form was submitted and then execute the corresponding code if needed.
/* Only Execute the following code block for Gravity Form 1 (each Gravity Form your create has an ID so replace this number with the actual ID) */
/* TODO - Change 1 with the actual form ID */
if ($entry['form_id'] == 11)
{
$secret_key = "removed for security";
$first_name= $entry["13"];
$last_name= $entry["14"];
$email= $entry["15"];
$membership_level_id= "4";
$username= $entry["16"];
$password= $user_pass;
$prepared_data = "?secret_key=".$secret_key."&first_name=".$first_name."&last_name=". $last_name."&email=".$email."&membership_level_id=".$membership_level_id."&username=".$username."&password=".$password;
$get_url = "http://www.paylaterproducts.com/wp-content/plugins/wp-eMember/api/create.php".$prepared_data;
// Execute this GET Request
file_get_contents($get_url);
}
}
add_action("gform_user_registered", "gf_register_add_ons", 10, 3);
Thanks for your advice in advance.
Posted 12 years ago on Monday December 12, 2011 |
Permalink