You are here

function MCAPI::listUnsubscribe in Mailchimp 7

Same name and namespace in other branches
  1. 5.2 MCAPI.class.php \MCAPI::listUnsubscribe()
  2. 5 MCAPI.class.php \MCAPI::listUnsubscribe()
  3. 6.2 MCAPI.class.php \MCAPI::listUnsubscribe()
  4. 6 MCAPI.class.php \MCAPI::listUnsubscribe()

Unsubscribe the given email address from the list

Related

@example mcapi_listUnsubscribe.php @example xml-rpc_listUnsubscribe.php

Parameters

string $id the list id to connect to. Get by calling lists():

string $email_address the email address to unsubscribe:

boolean $delete_member flag to completely delete the member from your list instead of just unsubscribing, default to false:

boolean $send_goodbye flag to send the goodbye email to the email address, defaults to true:

boolean $send_notify flag to send the unsubscribe notification email to the address defined in the list email notification settings, defaults to true:

Return value

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)

File

./MCAPI.class.php, line 1200

Class

MCAPI

Code

function listUnsubscribe($id, $email_address, $delete_member = false, $send_goodbye = true, $send_notify = true) {
  $params = array();
  $params["id"] = $id;
  $params["email_address"] = $email_address;
  $params["delete_member"] = $delete_member;
  $params["send_goodbye"] = $send_goodbye;
  $params["send_notify"] = $send_notify;
  return $this
    ->callServer("listUnsubscribe", $params);
}