HELP
Aan/af melden via uw eigen site (php)
Een betere en mooiere oplossing om uw contactpersonen aan- of af te melden is de php curl oplossing. Dit kan met de onderstaande code.
<?php
/**
* This function sends a request to the mailmoment server to add an e-mail adress
* @param String Hashcode, provided by Blueprint-Software
* @param String E-mail adress of the mailmoment user where we are connecting to
* @param Array Various data (naam, aanhef, email, group_id, mail_done_1, mail_done_2, mail_error_1, mail_error_2)
*/
function mailmoment($hash, $email, $data)
{
$fields = array(
'pass_hash' => urlencode($hash),
'username' => urlencode($email),
'name' => urlencode($data['naam']),
'mail_aanhef' => urlencode($data['aanhef']),
'mail' => urlencode($data['email']),
'mail_group_id' => urlencode($data['group_id']),
'ip' => urlencode($_SERVER['REMOTE_ADDR']),
'type' => urlencode($data['type']), // 0 = subscribe | 1 = unsubscribe
'mail_done_1' => urlencode($data['mail_done_1']), // Response bericht: Het aanmelden is gelukt
'mail_done_2' => urlencode($data['mail_done_2']), // Response bericht: Het afmelden is gelukt
'mail_error_1' => urlencode($data['mail_error_1']), // Response bericht: E-mail adres niet volledig
'mail_error_2' => urlencode($data['mail_error_2']) // Response bericht: E-mail adres bestaat reeds
);
$fields = array_filter($fields); // filter empty records
$parameters = array();
foreach($fields AS $key => $value) // Create array of parmeters to be imploded for the curl request
{
$parameters[] = $key .'='. $value;
}
$ch = curl_init('http://www.mailmoment.eu/curl.php?'. implode("&", $parameters));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec ($ch);
curl_close ($ch);
}
?>
Voor het gebruik van deze methode is een hash code nodig. Deze kunt u aanvragen via ons contact formulier
Terug naar het overzicht