Subscribing to the Healing Revolution…

$email,
“fields” => array(
“first_name” => $first_name,
“last_name” => $last_name
),
“group_ids” => $groups
);

// Set URL
$url = “https://api.e2ma.net/”.$account_id.”/members/add”;

// Open connection
$ch = curl_init();

// Set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_USERPWD, $public_api_key . “:” . $private_api_key);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($member_data));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($member_data));
curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘Content-type: application/json’));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$head = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

//execute post
if($http_code > 200) {
$app_message = “Error sending subscription request”;
print_r($head);
} else {
print_r($head);
$app_message = “Success!”;
}

echo $app_message;
?>

Receive the latest news

Sign up for the Dr. King's Newsletter

Stay connected with Dr. King’s Natural Medicine. Receive expert homeopathic insights, wellness education, exclusive updates, and the latest articles delivered directly to your inbox.