Property | Type | Description | |
---|---|---|---|
$api_key | The API key to use | ||
$api_url | The URL to the MailChimp API | ||
$connected | Boolean indicating whether the user is connected with MailChimp | ||
$error_code | The error code of the last API request (if any) | ||
$error_message | The error message of the latest API request (if any) | ||
$last_response | The full response object of the latest API call |
Method | Description | |
---|---|---|
__construct ( string $api_key ) | Constructor | |
add_ecommerce_order ( array $order_data ) : boolean | ||
call ( string $method, array $data = [] ) : object | Calls the MailChimp API | |
delete_ecommerce_order ( string $store_id, string $order_id ) : boolean | ||
get_error_code ( ) : integer | Gets the most recent error code | |
get_error_message ( ) : string | Gets the most recent error message | |
get_last_response ( ) : object | Get the most recent response object | |
get_list_groupings ( integer $list_id ) : array | boolean | Gets the Groupings for a given List | |
get_lists ( array $list_ids = [] ) : boolean | ||
get_lists_for_email ( array | string $email ) : array | Get the lists an email address is subscribed to | |
get_lists_with_merge_vars ( array $list_ids ) : array | boolean | Get lists with their merge_vars for a given array of list id's | |
get_subscriber_info ( string $list_id, array $emails ) : array | Gets the member info for one or multiple emails on a list | |
has_error ( ) : boolean | Checks if an error occured in the most recent request | |
is_connected ( ) : boolean | Pings the MailChimp API to see if we're connected | |
list_has_subscriber ( string $list_id, string $email ) : boolean | Checks if an email address is on a given list | |
subscribe ( string $list_id, string $email, array $merge_vars = [], string $email_type = 'html', boolean $double_optin = true, boolean $update_existing = false, boolean $replace_interests = true, boolean $send_welcome = false ) : boolean | string | Sends a subscription request to the MailChimp API | |
unsubscribe ( string $list_id, array | string $struct, boolean $send_goodbye = true, boolean $send_notification = false, boolean $delete_member = false ) : boolean | Unsubscribes the given email or luid from the given MailChimp list | |
update_subscriber ( string $list_id, array | string $email, array $merge_vars = [], string $email_type = 'html', boolean $replace_interests = false ) : boolean |
Method | Description | |
---|---|---|
empty_last_response ( ) | Empties all data from previous response | |
get_headers ( ) : array | Get the request headers to send to the MailChimp API | |
parse_response ( array | WP_Error $response ) : object | ||
show_connection_error ( $message ) : boolean | ||
show_error ( string $message ) : boolean | Show an error message to administrators |
public add_ecommerce_order ( array $order_data ) : boolean | ||
$order_data | array | |
return | boolean |
public get_error_code ( ) : integer | ||
return | integer |
public get_error_message ( ) : string | ||
return | string |
public get_last_response ( ) : object | ||
return | object |
public is_connected ( ) : boolean | ||
return | boolean |
public subscribe ( string $list_id, string $email, array $merge_vars = [], string $email_type = 'html', boolean $double_optin = true, boolean $update_existing = false, boolean $replace_interests = true, boolean $send_welcome = false ) : boolean | string | ||
$list_id | string | The list id to subscribe to |
string | The email address to subscribe | |
$merge_vars | array | Array of extra merge variables |
$email_type | string | The email type to send to this email address. Possible values are `html` and `text`. |
$double_optin | boolean | Should this email be confirmed via double opt-in? |
$update_existing | boolean | Update information if this email is already on list? |
$replace_interests | boolean | Replace interest groupings, only if update_existing is true. |
$send_welcome | boolean | Send a welcome e-mail, only if double_optin is false. |
return | boolean | string | True if success, 'error' if error |
protected $connected |
protected $error_code |
protected $error_message |