You are here

function CampaignMonitor::subscriberUnsubscribe in Campaign Monitor 6.3

Same name and namespace in other branches
  1. 6.2 lib/CMBase.php \CampaignMonitor::subscriberUnsubscribe()

*

Parameters

string $email Email address.: * @param int $list_id (Optional) A valid List ID to check against. If not given, the default class property is used. * @param boolean $check_subscribed If true, does the Subscribers.GetIsSubscribed API method instead. * @return mixed A parsed response from the server, or null if something failed. * @see http://www.campaignmonitor.com/api/Subscriber.Unsubscribe.aspx

1 call to CampaignMonitor::subscriberUnsubscribe()
CampaignMonitor::subscribersGetIsSubscribed in lib/CMBase.php
*

File

lib/CMBase.php, line 745

Class

CampaignMonitor
The new CampaignMonitor class that now extends from CMBase. This should be backwards compatible with the original (PHP5) version.

Code

function subscriberUnsubscribe($email, $list_id = null, $check_subscribed = false) {
  if (!$list_id) {
    $list_id = $this->list_id;
  }
  $action = 'Subscriber.Unsubscribe';
  if ($check_subscribed) {
    $action = 'Subscribers.GetIsSubscribed';
  }
  return $this
    ->makeCall($action, array(
    'params' => array(
      'ListID' => $list_id,
      'Email' => $email,
    ),
  ));
}