function _campaignmonitor_remove_subscriber in Campaign Monitor 5.2
Same name and namespace in other branches
- 5 campaignmonitor.module \_campaignmonitor_remove_subscriber()
- 6.3 campaignmonitor.module \_campaignmonitor_remove_subscriber()
- 6 campaignmonitor.module \_campaignmonitor_remove_subscriber()
- 6.2 campaignmonitor.module \_campaignmonitor_remove_subscriber()
2 calls to _campaignmonitor_remove_subscriber()
File
- ./
campaignmonitor.module, line 421
Code
function _campaignmonitor_remove_subscriber($api_key, $list_id, $email, $show_errors = FALSE) {
$cm = new CampaignMonitor($api_key, $client_id, $campaign_id, $list_id);
$result = $cm
->subscriberUnsubscribe($email);
if ($result['Result']['Code'] == 0) {
drupal_set_message("You have successfully been unsubscribed.", 'status');
}
else {
watchdog('campaignmonitor', 'Code - ' . $result['anyType']['Code'] . ', Message - ' . $result['anyType']['Message'], WATCHDOG_ERROR);
drupal_set_message("There was an error unsubscribing from newsletter.", 'error');
}
}