public function CampaignMonitorSubscriptionManager::userUnsubscribe in Campaign Monitor 8.2
Unsubscribes a member from a CampaignMonitor list.
See also
CampaignMonitor_Lists::unsubscribe()
File
- src/
CampaignMonitorSubscriptionManager.php, line 570
Class
- CampaignMonitorSubscriptionManager
- Manager for Campaignmonitor subscriptions.
Namespace
Drupal\campaignmonitorCode
public function userUnsubscribe($list_id, $email, $delete = FALSE, $goodbye = FALSE, $notify = FALSE) {
$result = FALSE;
if ($this->campaignMonitorManager
->isSubscribed($list_id, $email)) {
if ($this->config
->get('cron')) {
$result = campaignmonitor_addto_queue('campaignmonitor_unsubscribe_process', [
'list_id' => $list_id,
'email' => $email,
'delete' => $delete,
'goodbye' => $goodbye,
'notify' => $notify,
]);
}
else {
$result = $this
->unsubscribeProcess($list_id, $email, $delete, $goodbye, $notify);
}
}
return $result;
}