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