CampaignMonitor::unsubscribe PHP Метод

unsubscribe() публичный Метод

Changes the status of an Active Subscriber to an Unsubscribed Subscriber who will no longer receive campaigns sent to that Subscriber List.
public unsubscribe ( string $email, string[optional] $listId = null ) : string
$email string The emailaddress.
$listId string[optional]
Результат string
    public function unsubscribe($email, $listId = null)
    {
        // stop here if no email was set
        if (!$email) {
            throw new CampaignMonitorException('No e-mail given.');
        }
        // set ID
        $listId = empty($listId) ? $this->getListId() : $listId;
        // set parameters
        $parameters['EmailAddress'] = (string) $email;
        // make the call
        return $this->doCall('subscribers/' . $listId . '/unsubscribe', $parameters, 'POST');
    }