Back to Documentation Overview
listUnsubscribe
public static listUnsubscribe(string apikey, string id, string email_address, boolean delete_member, boolean send_goodbye, boolean send_notify)
Unsubscribe the given email address from the list
- Section:
- List Related
- Parameters:
apikey a valid API Key for your user account. Get by calling login() id the list id to connect to. Get by calling lists() email_address the email address to unsubscribe delete_member flag to completely delete the member from your list instead of just unsubscribing, default to false send_goodbye flag to send the goodbye email to the email address, defaults to true send_notify flag to send the unsubscribe notification email to the address defined in the list email notification settings, defaults to true - Returns:
- boolean - true on success, false on failure. When using MCAPI.class.php, the value can be tested and error messages pulled from the MCAPI object (see below)
- <?php
- /**
- This Example shows how to pull the Info for a Member of a List using the MCAPI.php
- class and do some basic error checking.
- **/
- require_once 'inc/MCAPI.class.php';
- require_once 'inc/config.inc.php'; //contains apikey
- $retval = $api->listUnsubscribe( $listId,$my_email);
- if ($api->errorCode){
- } else {
- }
- <?php
- /**
- This Example shows how to Unsubscribe a member from a List using XML-RPC.
- Note that we are using the PEAR XML-RPC client and recommend others do as well.
- **/
- require_once 'XML/RPC2/Client.php';
- require_once 'inc/config.inc.php';
- try {
- $result = $client->listUnsubscribe($apikey, $listId, $my_email,false, false, false);
- } catch (XML_RPC2_FaultException $e){
- }
- ?>
Examples (2)
download example code[1] mcapi_listUnsubscribe.php
[2] xml-rpc_listUnsubscribe.php
|
Add New Note
User Contributed Notes for
listUnsubscribe |
|---|
| No notes, yet... Will you be the first?? |