src/XQueue/Maileon/API/Contacts/ContactsService.php
function unsubscribeContactByEmail($email, $mailingId = "", $reasons = null)
    {
        $queryParameters = array();
        if (!empty($mailingId)) {
            $queryParameters['mailingId'] = $mailingId;
        }

        if (!empty($reasons)) {
            if (is_array($reasons)) {
                $queryParameters = $this->appendArrayFields($queryParameters, 'reason', $reasons);
            } else {
                $queryParameters['reason'] = urlencode($reasons);
            }
        }

        $encodedEmail = utf8_encode($email);
        return $this->delete("contacts/email/${encodedEmail}/unsubscribe", $queryParameters);
    }
function unsubscribeContactByEmail($email, $mailingId = "", $reasons = null)
    {
        $queryParameters = array();
        if (!empty($mailingId)) {
            $queryParameters['mailingId'] = $mailingId;
        }

        if (!empty($reasons)) {
            if (is_array($reasons)) {
                $queryParameters = $this->appendArrayFields($queryParameters, 'reason', $reasons);
            } else {
                $queryParameters['reason'] = urlencode($reasons);
            }
        }

        $encodedEmail = utf8_encode($email);
        return $this->delete("contacts/email/${encodedEmail}/unsubscribe", $queryParameters);
    }
This method unsubscribes a contact from Maileon using the contact's email adress.

@param string $email The email address of the contact.
@param long $mailingId The ID of the mailing to assign the unsubscribe to. the mailing must have been sent, i.e. be sealed.
@param array $reasons an array of reasons or a single reason (string). Unsubscription reasons have two layers
of information, see http://dev.maileon.com/api/rest-api-1-0/contacts/unsubscribe-contacts-by-email for more details about the format.
The parameter(s) will be url-encoded by the client, you do not need to provide urlencoded strings.
@return \em com_maileon_api_MaileonAPIResult
the result object of the API call
@throws com_maileon_api_MaileonAPIException
if there was a connection problem or a server error occurred