class MailChimp in Mailchimp 7.2
Hierarchy
Expanded class hierarchy of MailChimp
5 string references to 'MailChimp'
- mailchimp_get_api_object in ./
mailchimp.module - Get a Mailchimp API object for communication with the mailchimp server.
- mailchimp_lists_list_form in modules/
mailchimp_lists/ includes/ mailchimp_lists.admin.inc - Return a form for adding/editing a mailchimp list.
- mailchimp_lists_overview_page in modules/
mailchimp_lists/ includes/ mailchimp_lists.admin.inc - Administrative display showing existing lists and allowing edits/adds.
- mailchimp_menu in ./
mailchimp.module - Implements hook_menu().
- mailchimp_requirements in ./
mailchimp.install - Implements hook_requirements().
File
- includes/
mailchimp.inc, line 3
View source
class MailChimp extends MCAPI {
/**
* Override MCAPI::callServer() to leverage Drupal's core HTTP handling.
*/
public function callServer($method, $params) {
$dc = "us1";
if (strstr($this->api_key, "-")) {
list($key, $dc) = explode("-", $this->api_key, 2);
if (!$dc) {
$dc = "us1";
}
}
$host = $dc . "." . $this->apiUrl["host"];
$protocol = $this->secure ? 'https://' : 'http://';
$params["apikey"] = $this->api_key;
$this->errorMessage = "";
$this->errorCode = "";
$post_vars = http_build_query($params, NULL, '&');
$response = drupal_http_request($protocol . $host . $this->apiUrl["path"] . '?method=' . $method, array(
'method' => 'POST',
'data' => $post_vars,
'headers' => array(
'Content-type' => 'application/x-www-form-urlencoded',
'Host' => $host,
'Accept-Language' => language_default()->language,
'User-Agent' => 'MCAPI/' . $this->version,
),
'timeout' => $this
->getTimeout(),
));
if (!empty($response->error)) {
$this->errorMessage = $response->error;
$this->errorCode = $response->code;
return FALSE;
}
foreach ($response->headers as $h) {
if (substr($h, 0, 26) === "X-MailChimp-API-Error-Code") {
$this->errorMessage = "No error message was found";
$this->errorCode = trim(substr($h, 27));
return FALSE;
}
}
$return = drupal_json_decode($response->data);
if ($return === FALSE) {
$this->errorMessage = "Bad Response. Got This: " . $response->data;
$this->errorCode = -99;
return FALSE;
}
if (isset($return['error']) && is_array($return)) {
$this->errorMessage = $return['error'];
$this->errorCode = $return['code'];
return FALSE;
}
return $return;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MailChimp:: |
public | function |
Override MCAPI::callServer() to leverage Drupal's core HTTP handling. Overrides MCAPI:: |
|
MCAPI:: |
property | Cache the information on the API location on the server | ||
MCAPI:: |
property | Cache the user api_key so we only have to log in once per client instantiation | ||
MCAPI:: |
property | Default to a 8K chunk size | ||
MCAPI:: |
property | |||
MCAPI:: |
property | |||
MCAPI:: |
property | Cache the user api_key so we only have to log in once per client instantiation | ||
MCAPI:: |
property | Default to a 300 second timeout on server calls | ||
MCAPI:: |
property | |||
MCAPI:: |
function | Add an API Key to your account. We will generate a new key for you and return it. | ||
MCAPI:: |
function | Expire a Specific API Key. Note that if you expire all of your keys, a new, valid one will be created and returned next time you call login(). If you are trying to shut off access to your account for an old developer, change your MailChimp password,… | ||
MCAPI:: |
function | Retrieve a list of all MailChimp API Keys for this User | ||
MCAPI:: |
function | Internal function - proxy method for certain XML-RPC calls | DO NOT CALL | ||
MCAPI:: |
function | Get all email addresses that complained about a given campaign | ||
MCAPI:: |
function | Retrieve the text presented in our app for how a campaign performed and any advice we may have for you - best suited for display in customized reports pages. Note: some messages will contain HTML - clean tags as necessary | ||
MCAPI:: |
function | Retrieve the Google Analytics data we've collected for this campaign. Note, requires Google Analytics Add-on to be installed and configured. | ||
MCAPI:: |
function | Retrieve the full bounce messages for the given campaign. Note that this can return very large amounts of data depending on how large the campaign was and how much cruft the bounce provider returned. Also, message over 30 days old are subject to being… | ||
MCAPI:: |
function | Return the list of email addresses that clicked on a given url, and how many times they clicked | ||
MCAPI:: |
function | Get an array of the urls being tracked, and their click counts for a given campaign | ||
MCAPI:: |
function | Get the content (both html and text) for a campaign either as it would appear in the campaign archive or as the raw, original content | ||
MCAPI:: |
function | Create a new draft campaign to send | ||
MCAPI:: |
function | Delete a campaign. Seriously, "poof, gone!" - be careful! | ||
MCAPI:: |
function | Attach Ecommerce Order Information to a Campaign. This will generall be used by ecommerce package plugins <a href="/plugins/ecomm360.phtml">that we provide</a> or by 3rd part system developers. | ||
MCAPI:: |
function | Retrieve the Ecommerce Orders tracked by campaignEcommAddOrder() | ||
MCAPI:: |
function | Get the top 5 performing email domains for this campaign. Users want more than 5 should use campaign campaignEmailStatsAIM() or campaignEmailStatsAIMAll() and generate any additional stats they require. | ||
MCAPI:: |
function | Given a campaign and email address, return the entire click and open history with timestamps, ordered by time | ||
MCAPI:: |
function | Given a campaign and correct paging limits, return the entire click and open history with timestamps, ordered by time, for every user a campaign was delivered to. | ||
MCAPI:: |
function | List all the folders for a user account | ||
MCAPI:: |
function | Get all email addresses with Hard Bounces for a given campaign | ||
MCAPI:: |
function | Retrieve the list of email addresses that did not open a given campaign | ||
MCAPI:: |
function | Retrieve the list of email addresses that opened a given campaign with how many times they opened - note: this AIM function is free and does not actually require the AIM module to be installed | ||
MCAPI:: |
function | Pause an AutoResponder orRSS campaign from sending | ||
MCAPI:: |
function | Replicate a campaign. | ||
MCAPI:: |
function | Resume sending an AutoResponder or RSS campaign | ||
MCAPI:: |
function | Get the list of campaigns and their details matching the specified filters | ||
MCAPI:: |
function | Schedule a campaign to be sent in the future | ||
MCAPI:: |
function | Allows one to test their segmentation rules before creating a campaign using them | ||
MCAPI:: |
function | Send a given campaign immediately | ||
MCAPI:: |
function | Send a test of this campaign to the provided email address | ||
MCAPI:: |
function | Get the URL to a customized VIP Report for the specified campaign and optionally send an email to someone with links to it. Note subsequent calls will overwrite anything already set for the same campign (eg, the password) | ||
MCAPI:: |
function | Get all email addresses with Soft Bounces for a given campaign | ||
MCAPI:: |
function | Given a list and a campaign, get all the relevant campaign statistics (opens, bounces, clicks, etc.) | ||
MCAPI:: |
function | Retrieve all templates defined for your user account | ||
MCAPI:: |
function | Unschedule a campaign that is scheduled to be sent in the future | ||
MCAPI:: |
function | Get all unsubscribed email addresses for a given campaign | ||
MCAPI:: |
function | Update just about any setting for a campaign that has <em>not</em> been sent. See campaignCreate() for details | ||
MCAPI:: |
function | Create a new folder to file campaigns in | ||
MCAPI:: |
function | Have HTML content auto-converted to a text-only format. You can send: plain HTML, an array of Template content, an existing Campaign Id, or an existing Template Id. Note that this will <b>not</b> save anything to or update any of your… | ||
MCAPI:: |
function | Retrieve lots of account information including payments made, plan info, some account stats, installed modules, contact info, and more. No private information like Credit Card numbers is available. | ||
MCAPI:: |
function | <strong>DEPRECATED:</strong> Retrieve your User Unique Id and your Affiliate link to display/use for <a href="/monkeyrewards/" target="_blank">Monkey Rewards</a>. While we don't use the User Id for any… | ||
MCAPI:: |
function | |||
MCAPI:: |
function | Re-implement http_build_query for systems that do not already have it | ||
MCAPI:: |
function | Send your HTML content to have the CSS inlined and optionally remove the original styles. | ||
MCAPI:: |
function | Get all email addresses that complained about a given campaign | ||
MCAPI:: |
function | Subscribe a batch of email addresses to a list at once | ||
MCAPI:: |
function | Unsubscribe a batch of email addresses to a list | ||
MCAPI:: |
function | Access the Growth History by Month for a given list. | ||
MCAPI:: |
function | Add a single Interest Group - if interest groups for the List are not yet enabled, adding the first group will automatically turn them on. | ||
MCAPI:: |
function | Delete a single Interest Group - if the last group for a list is deleted, this will also turn groups for the list off. | ||
MCAPI:: |
function | Get the list of interest groups for a given list, including the label and form information | ||
MCAPI:: |
function | Change the name of an Interest Group | ||
MCAPI:: |
function | Get all the information for a particular member of a list | ||
MCAPI:: |
function | Get all of the list members for a list that are of a particular status | ||
MCAPI:: |
function | Add a new merge tag to a given list | ||
MCAPI:: |
function | Delete a merge tag from a given list and all its members. Seriously - the data is removed from all members as well! Note that on large lists this method may seem a bit slower than calls you typically make. | ||
MCAPI:: |
function | Get the list of merge tags for a given list, including their name, tag, and required setting | ||
MCAPI:: |
function | Update most parameters for a merge tag on a given list. You cannot currently change the merge type | ||
MCAPI:: |
function | Retrieve all of the lists defined for your user account | ||
MCAPI:: |
function | Subscribe the provided email to a list. By default this sends a confirmation email - you will not see new members until the link contained in it is clicked! | ||
MCAPI:: |
function | Unsubscribe the given email address from the list | ||
MCAPI:: |
function | Edit the email address, merge fields, and interest groups for a list member | ||
MCAPI:: |
function | Add a new Webhook URL for the given list | ||
MCAPI:: |
function | Delete an existing Webhook URL from a given list | ||
MCAPI:: |
function | Return the Webhooks configured for the given list | ||
MCAPI:: |
function | Connect to the MailChimp API for a given list. All MCAPI calls require login before functioning | ||
MCAPI:: |
function | "Ping" the MailChimp API - a simple method you can call that will return a constant value as long as everything is good. Note than unlike most all of our methods, we don't throw an Exception if we are having issues. You will simply… | ||
MCAPI:: |
function | |||
MCAPI:: |
function |