\MailChimp
Synopsis
class MailChimp
{
- // constants
- const MEMBER_STATUS_SUBSCRIBED = 'subscribed';
- const MEMBER_STATUS_UNSUBSCRIBED = 'unsubscribed';
- const MEMBER_STATUS_CLEANED = 'cleaned';
- const MEMBER_STATUS_PENDING = 'pending';
- const MEMBER_EMAILTYPE_HTML = 'html';
- const MEMBER_EMAILTYPE_TEXT = 'text';
- // members
- protected static string $base_url = '.api.mailchimp.com/3.0';
- protected $endPoint;
- protected $apiKey;
- protected $handle;
- // methods
- public static MailChimp create()
- public void __construct()
- public mixed getLists()
- public mixed subscribe()
- public mixed unsubscribe()
- protected mixed get()
- protected mixed post()
- protected mixed delete()
- protected mixed perform()
Tasks
Line | Task |
---|---|
227 | error handling |
Constants
Name | Value |
---|---|
MEMBER_STATUS_SUBSCRIBED | 'subscribed' |
MEMBER_STATUS_UNSUBSCRIBED | 'unsubscribed' |
MEMBER_STATUS_CLEANED | 'cleaned' |
MEMBER_STATUS_PENDING | 'pending' |
MEMBER_EMAILTYPE_HTML | 'html' |
MEMBER_EMAILTYPE_TEXT | 'text' |
Members
protected
- $apiKey
—
string
API key - $base_url
—
string
Base url to MailChimp API v3 - $endPoint
—
string
Selected end-point of the API - $handle
—
resource
cURL handle
Methods
protected
- delete() — Send a delete request to the API
- get() — Send a get request to the API
- perform() — Perform a cURL request
- post() — Send a post request to the API
public
- __construct() — MailChimp constructor.
- create() — Create a new MailChimp client
- getLists() — Get the lists for this user
- subscribe() — Subscribe an emailaddress
- unsubscribe() — Unsubscribe a subscriber