I am having slight difficulty with the Pro API Integration. Everything works EXCEPT it never sends email to the new registrant with their username/password. However, it IS sending email to the site administrator notifying of a new user registration.
What debug methods can I use?
Here’s my S2 PHP hack code (redacted)…
<?php
$op["op"] = "create_user";
$op["api_key"] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$op["data"] = array (/**/
"user_login" => $_REQUEST["FirstName"].$_REQUEST["LastName"],
"user_email" => $_REQUEST["Email"],
"first_name" => $_REQUEST["FirstName"],
"last_name" => $_REQUEST["LastName"],
"custom_fields" => array ("pass_code" => $_REQUEST["IQINPasscode"]),
"s2member_level" => "0",
"s2member_notes" => "From Infusionsoft App",
"opt_in" => "1",
"notification" => "1",
);
$result = trim (file_get_contents ("http://<<mydomain>>/?s2member_pro_remote_op=1", false, stream_context_create (array ("http" => array ("method" => "POST", "header" => "Content-type: application/x-www-form-urlencoded", "content" => "s2member_pro_remote_op=" . urlencode (serialize ($op)))))));
if (!empty ($result) && !preg_match ("/^Error\:/i", $result) && is_array ($user = @unserialize ($result)))
{
echo "Success. New User created with ID: " . $user["ID"];
}
else
{
echo "API error reads: " . $result;
}
?>