Back to Documentation Overview
listBatchUnsubscribe
public static listBatchUnsubscribe(string uid, 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:
uid the id for your user account. Get by calling login($user, $pass) id the list id to connect to 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.
- **/
- // Include the MailChimp API code. Do Not Edit This!
- include('inc/MCAPI.class.php');
- include('config.inc'); //username & pass
- // Connect to the MailChimp server with the user's credentials.
- $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($id, $emails, $delete, $bye, $notify);
- if (!$vals){
- // 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?? |