1-866-284-2541  |  Registered Users LOGIN 

MailChimp Home Learn More Pricing Resource Center Blog Free Trial

MailChimp API
Back to Documentation Overview

listUpdateMember

public static listUpdateMember(string uid, string id, string email_address, array merge_vars, string email_type, boolean replace_interests)

Edit the email address, merge fields, and interest groups for a list member


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 current email address of the member to update
merge_vars array of new field values to update the member with. Use "EMAIL" to update the email address and "INTERESTS" to update the interest groups
email_type change the email type preference for the member ("html" or "text"). Leave blank to keep the existing preference (optional)
replace_interests flag to determine whether we replace the interest groups with the updated groups provided, or we add the provided groups to the member's interest groups (optional, 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

Examples (1)

[1] mcapi_listUpdateMember.php

  1. <?php
  2. /**
  3. This Example shows how to update a List Member's information 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('config.inc'); //username & pass
  9.  
  10. // Connect to the MailChimp server with the user's credentials.
  11. $acct = new MCAPI($mailChimpUser, $mailChimpPass);
  12.  
  13. $arrMergVars = array("FNAME"=>'Richard', "LNAME"=>'Wright');
  14. $email = "richard@wright.com";
  15.  
  16. $retval = $acct->listUpdateMember($listId, $email, $arrMergVars,'html', false);
  17. if (!$retval){
  18. echo "Unable to update member info!\n";
  19. echo "\tCode=".$acct->errorCode."\n";
  20. echo "\tMsg=".$acct->errorMessage."\n";
  21. } else {
  22. //do something useful!
  23. var_dump($retval);
  24. }
  25. ?>
  26.  
Add New Note User Contributed Notes
listUpdateMember
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