PHP Class MC4WP_API_v3

Exibir arquivo Open project: dannyvankooten/mailchimp-for-wordpress Class Usage Examples

Protected Properties

Property Type Description
$client MC4WP_API_v3_Client
$connected Are we able to talk to the MailChimp API?

Public Methods

Method Description
__construct ( string $api_key ) Constructor
add_ecommerce_store ( array $args ) : object
add_ecommerce_store_cart ( string $store_id, array $args ) : object
add_ecommerce_store_cart_line ( string $store_id, string $cart_id, array $args ) : object
add_ecommerce_store_customer ( $store_id, array $args ) : object Add OR update a store customer
add_ecommerce_store_order ( string $store_id, array $args ) : object
add_ecommerce_store_order_line ( string $store_id, string $order_id, array $args ) : object
add_ecommerce_store_product ( string $store_id, array $args ) : object Add a product to a store
add_ecommerce_store_product_variant ( string $store_id, string $product_id, array $args ) : object Add OR update a product variant.
add_list_member ( string $list_id, array $args ) : object Add or update (!) a member to a MailChimp list.
add_list_members ( string $list_id, array $args ) : object Batch subscribe / unsubscribe list members.
delete_ecommerce_store ( string $store_id ) : boolean
delete_ecommerce_store_cart ( string $store_id, string $cart_id ) : boolean
delete_ecommerce_store_cart_line ( string $store_id, string $cart_id, string $line_id ) : boolean
delete_ecommerce_store_customer ( string $store_id, string $customer_id ) : boolean
delete_ecommerce_store_order ( string $store_id, string $order_id ) : boolean
delete_ecommerce_store_order_line ( string $store_id, string $order_id, string $line_id ) : boolean
delete_ecommerce_store_product ( string $store_id, string $product_id ) : boolean
delete_ecommerce_store_product_variant ( string $store_id, string $product_id, string $variant_id ) : boolean
delete_list_member ( string $list_id, string $email_address ) : boolean
get_ecommerce_store ( string $store_id, array $args = [] ) : object
get_ecommerce_store_cart ( string $store_id, string $cart_id, array $args = [] ) : object
get_ecommerce_store_cart_line ( string $store_id, string $cart_id, string $line_id, array $args = [] ) : object
get_ecommerce_store_cart_lines ( string $store_id, string $cart_id, array $args = [] ) : object
get_ecommerce_store_carts ( string $store_id, array $args = [] ) : object
get_ecommerce_store_customer ( string $store_id, string $customer_id, array $args = [] ) : object
get_ecommerce_store_customers ( string $store_id, array $args = [] ) : object
get_ecommerce_store_order ( string $store_id, string $order_id, array $args = [] ) : object
get_ecommerce_store_order_line ( string $store_id, string $order_id, string $line_id, array $args = [] ) : object
get_ecommerce_store_order_lines ( string $store_id, string $order_id, array $args = [] ) : object
get_ecommerce_store_orders ( string $store_id, array $args = [] ) : object
get_ecommerce_store_product ( string $store_id, string $product_id, array $args = [] ) : object
get_ecommerce_store_product_variant ( string $store_id, string $product_id, string $variant_id, array $args = [] ) : object
get_ecommerce_store_product_variants ( string $store_id, string $product_id, array $args = [] ) : object
get_ecommerce_store_products ( string $store_id, array $args = [] ) : object
get_last_response_body ( ) : string
get_last_response_headers ( ) : array
get_list ( string $list_id, array $args = [] ) : object
get_list_activity ( string $list_id ) : array Get recent daily, aggregated activity stats for a list.
get_list_interest_categories ( string $list_id, array $args = [] ) : array Gets the interest categories for a given List
get_list_interest_category_interests ( string $list_id, string $interest_category_id, array $args = [] ) : array
get_list_member ( string $list_id, string $email_address, array $args = [] ) : object
get_list_merge_fields ( string $list_id, array $args = [] ) : array Get merge vars for a given list
get_lists ( array $args = [] ) : array
get_subscriber_hash ( $email_address ) : string
is_connected ( ) : boolean Pings the MailChimp API to see if we're connected
update_ecommerce_store ( string $store_id, array $args ) : object
update_ecommerce_store_cart ( string $store_id, string $cart_id, array $args ) : object
update_ecommerce_store_cart_line ( string $store_id, string $cart_id, string $line_id, array $args ) : object
update_ecommerce_store_customer ( string $store_id, string $customer_id, array $args ) : object
update_ecommerce_store_order ( string $store_id, string $order_id, array $args ) : object
update_ecommerce_store_order_line ( string $store_id, string $order_id, string $line_id, array $args ) : object
update_ecommerce_store_product_variant ( string $store_id, string $product_id, string $variant_id, array $args ) : object
update_list_member ( $list_id, $email_address, array $args ) : object

Method Details

__construct() public method

Constructor
public __construct ( string $api_key )
$api_key string

add_ecommerce_store_customer() public method

Add OR update a store customer
public add_ecommerce_store_customer ( $store_id, array $args ) : object
$store_id
$args array
return object

add_ecommerce_store_product() public method

Add a product to a store
public add_ecommerce_store_product ( string $store_id, array $args ) : object
$store_id string
$args array
return object

add_ecommerce_store_product_variant() public method

Add OR update a product variant.
public add_ecommerce_store_product_variant ( string $store_id, string $product_id, array $args ) : object
$store_id string
$product_id string
$args array
return object

add_list_member() public method

Add or update (!) a member to a MailChimp list.
public add_list_member ( string $list_id, array $args ) : object
$list_id string
$args array
return object

add_list_members() public method

Batch subscribe / unsubscribe list members.
public add_list_members ( string $list_id, array $args ) : object
$list_id string
$args array
return object

delete_list_member() public method

public delete_list_member ( string $list_id, string $email_address ) : boolean
$list_id string
$email_address string
return boolean

get_ecommerce_store_cart_line() public method

public get_ecommerce_store_cart_line ( string $store_id, string $cart_id, string $line_id, array $args = [] ) : object
$store_id string
$cart_id string
$line_id string
$args array
return object

get_ecommerce_store_customer() public method

public get_ecommerce_store_customer ( string $store_id, string $customer_id, array $args = [] ) : object
$store_id string
$customer_id string
$args array
return object

get_ecommerce_store_order_line() public method

public get_ecommerce_store_order_line ( string $store_id, string $order_id, string $line_id, array $args = [] ) : object
$store_id string
$order_id string
$line_id string
$args array
return object

get_ecommerce_store_product() public method

public get_ecommerce_store_product ( string $store_id, string $product_id, array $args = [] ) : object
$store_id string
$product_id string
$args array
return object

get_ecommerce_store_product_variant() public method

public get_ecommerce_store_product_variant ( string $store_id, string $product_id, string $variant_id, array $args = [] ) : object
$store_id string
$product_id string
$variant_id string
$args array
return object

get_last_response_body() public method

public get_last_response_body ( ) : string
return string

get_last_response_headers() public method

public get_last_response_headers ( ) : array
return array

get_list() public method

public get_list ( string $list_id, array $args = [] ) : object
$list_id string
$args array
return object

get_list_activity() public method

Get recent daily, aggregated activity stats for a list.
public get_list_activity ( string $list_id ) : array
$list_id string
return array

get_list_interest_categories() public method

Gets the interest categories for a given List
public get_list_interest_categories ( string $list_id, array $args = [] ) : array
$list_id string
$args array
return array

get_list_interest_category_interests() public method

public get_list_interest_category_interests ( string $list_id, string $interest_category_id, array $args = [] ) : array
$list_id string
$interest_category_id string
$args array
return array

get_list_member() public method

public get_list_member ( string $list_id, string $email_address, array $args = [] ) : object
$list_id string
$email_address string
$args array
return object

get_list_merge_fields() public method

Get merge vars for a given list
public get_list_merge_fields ( string $list_id, array $args = [] ) : array
$list_id string
$args array
return array

get_lists() public method

public get_lists ( array $args = [] ) : array
$args array
return array

get_subscriber_hash() public method

public get_subscriber_hash ( $email_address ) : string
$email_address
return string

is_connected() public method

The result is cached to ensure a maximum of 1 API call per page load
public is_connected ( ) : boolean
return boolean

update_list_member() public method

public update_list_member ( $list_id, $email_address, array $args ) : object
$list_id
$email_address
$args array
return object

Property Details

$client protected_oe property

protected MC4WP_API_v3_Client $client
return MC4WP_API_v3_Client

$connected protected_oe property

Are we able to talk to the MailChimp API?
protected $connected