Back to Documentation Overview
listBatchUnsubscribe
public static listBatchUnsubscribe(string apikey, string id, array emails, boolean delete_member, boolean send_goodbye, boolean send_notify)
Unsubscribe a batch of email addresses to a list
- Section:
- List Related
- Parameters:
apikey a valid API Key for your user account. Get by calling Get by visiting your API dashboard id the list id to connect to. Get by calling lists() emails array of email addresses 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 addresses, defaults to true send_notify flag to send the unsubscribe notification email to the address defined in the list email notification settings, defaults to false - Returns:
- struct - Array of result counts and any errors that occurred
- Returned Fields:
integer success_count Number of email addresses that were succesfully added/updated integer error_count Number of email addresses that failed during addition/updating array errors Array of error structs. Each error struct will contain "code", "message", and "email" - <?php
- /**
- This Example shows how to run a Batch Unsubscribe on a List using the MCAPI.php
- class and do some basic error checking or handle the return values.
- **/
- require_once 'inc/MCAPI.class.php';
- require_once 'inc/config.inc.php'; //contains apikey
- $delete = false; //don't completely remove the emails
- $bye = true; // yes, send a goodbye email
- $notify = false; // no, don't tell me I did this
- $vals = $api->listBatchUnsubscribe($listId, $emails, $delete, $bye, $notify);
- if ($api->errorCode){
- // an api error occurred
- } else {
- foreach($vals['errors'] as $val){
- }
- }
- ?>
Examples (1)
download example code[1] mcapi_listBatchUnsubscribe.php
|
Add New Note
User Contributed Notes for
listBatchUnsubscribe |
|---|
| No notes, yet... Will you be the first?? |