function _campaignmonitor_is_subscribed in Campaign Monitor 5.2
Same name and namespace in other branches
- 5 campaignmonitor.module \_campaignmonitor_is_subscribed()
- 6.3 campaignmonitor.module \_campaignmonitor_is_subscribed()
- 6 campaignmonitor.module \_campaignmonitor_is_subscribed()
- 6.2 campaignmonitor.module \_campaignmonitor_is_subscribed()
2 calls to _campaignmonitor_is_subscribed()
File
- ./
campaignmonitor.module, line 386
Code
function _campaignmonitor_is_subscribed($api_key, $list_id, $email, $show_errors = FALSE) {
$retval = FALSE;
$cm = new CampaignMonitor($api_key, $client_id, $campaign_id, $list_id);
$result = $cm
->subscribersGetIsSubscribed($email, $list_id);
if ($result['anyType']['Code'] != 0) {
watchdog('campaignmonitor', 'Code - ' . $result['anyType']['Code'] . ', Message - ' . $result['anyType']['Message'], WATCHDOG_ERROR);
$retval = FALSE;
if ($show_errors) {
drupal_set_message("There is an error with the newsletter server. Please try again later.", 'error');
}
}
else {
if ($result['anyType'] == 'False') {
$retval = FALSE;
}
else {
if ($result['anyType'] == 'True') {
$retval = TRUE;
}
}
}
return $retval;
}