1-866-284-2541  |  Registered Users LOGIN 

MailChimp Home Learn More Pricing Resource Center Blog Free Trial

MailChimp API
Back to Documentation Overview

listUnsubscribe

public static listUnsubscribe(string uid, 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:
uid the id for your user account. Get by calling login($user, $pass)
id the list id to connect to
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)

Examples (1)

[1] mcapi_listUnsubscribe.php

  1. <?php
  2. /**
  3. This Example shows how to pull the Info for a Member of a List using the MCAPI.php
  4. class and do some basic error checking.
  5. **/
  6. // Include the MailChimp API code. Do Not Edit This!
  7. include('inc/MCAPI.class.php');
  8. include('inc/config.inc.php'); //contains username & password
  9.  
  10. $acct = new MCAPI($mailChimpUser, $mailChimpPass);
  11.  
  12. $retval = $acct->listUnsubscribe( $listId,$email_to_remove);
  13. if ($retval === true){
  14. //Do something useful!
  15. var_dump($retval);
  16. } else {
  17. echo "Unable to load listSubscribe()!\n";
  18. echo "\tCode=".$acct->errorCode."\n";
  19. echo "\tMsg=".$acct->errorMessage."\n";
  20. }
  21.  
  22. ?>
  23.  
Add New Note User Contributed Notes
listUnsubscribe
No notes, yet... Will you be the first??

Email Marketing Resources  |   Free HTML Email Templates  |   Partners  |  Find an Expert  |   Add-ons  |   API  |   Plugins  |   Blog  |  Demos  |  Surveys  |   Webinars  |   Subscribe to our free Email Marketing Tips Newsletter

New Features:  RSS to Email  |   A/B Split Testing Emails  |   Google Analytics Integration  |   Segmentation

Truste Certified Privacy Click to verify BBB accreditation and to see a BBB report ESPC Members MAAWG Email Experience Council Members HACKER SAFE certified sites prevent over 99.9% of hacker crime.
WebAward Winner W3 Award Webby Award Nominee As featured on MSNBC's Your Business Program