Lists - marcocusano/mailchimp-php GitHub Wiki

Your Mailchimp list, also known as your audience, is where you store and manage all of your contacts. Learn how to get started.

create

Create a new list in your Mailchimp account.

$params = array(
    "name" => "The name of the list.",
    "contact" => { ... },
    "permission_reminder" => "The permission reminder for the list.",
    "use_archive_bar" => "Whether campaigns for this list use the Archive Bar in archives by default.",
    "campaign_defaults" => { ... },
    "notify_on_subscribe" => "[email protected]",
    "notify_on_unsubscribe" => "[email protected]",
    "email_type_option" => ""
    ...
);
$mailchimp->lists->create($params);

subscribe

Add a new member to the list. (Also called createMember)

$params = array(
    "email_address" => "[email protected]",
    "email_type" => "html/text",
    "status" => "subscribed/unsubscribed/cleaned/pending",
    ...
);
$mailchimp->lists->subscribe("LIST_ID", $params);

delete

Delete a list from your Mailchimp account. If you delete a list, you’ll lose the list history—including subscriber activity, unsubscribes, complaints, and bounces. You’ll also lose subscribers’ email addresses, unless you exported and backed up your list.

$mailchimp->lists->delete("LIST_ID");

unsubscribe

Delete a member from a list.

$mailchimp->lists->unsubscribe("LIST_ID", "MEMBER_ID");

edit

Update the settings for a specific list.

$params = array( ... );
$mailchimp->lists->edit("LIST_ID", $params);

get

Get information about all lists in the account: Get information about all lists or get information about a specific list.

// Send LIST_ID if you are looking for a specific list instead of the all lists.
$mailchimp->lists->get("LIST_ID");