You are here

class MailchimpCampaigns in Mailchimp 8

Same name in this branch
  1. 8 lib/mailchimp-api-php/src/MailchimpCampaigns.php \Mailchimp\MailchimpCampaigns
  2. 8 lib/mailchimp-api-php/tests/src/MailchimpCampaigns.php \Mailchimp\Tests\MailchimpCampaigns

Mailchimp Campaigns library test cases.

@package Mailchimp\Tests

Hierarchy

Expanded class hierarchy of MailchimpCampaigns

5 string references to 'MailchimpCampaigns'
mailchimp_campaign_delete_campaign in modules/mailchimp_campaign/mailchimp_campaign.module
Delete a Mailchimp campaign and the local entity.
mailchimp_campaign_get_campaigns in modules/mailchimp_campaign/mailchimp_campaign.module
Get Mailchimp campaigns.
mailchimp_campaign_save_campaign in modules/mailchimp_campaign/mailchimp_campaign.module
Save a campaign in Mailchimp and as a Drupal entity.
mailchimp_campaign_send_campaign in modules/mailchimp_campaign/mailchimp_campaign.module
Sends a Mailchimp campaign.
mailchimp_get_campaign_data in ./mailchimp.module
Wrapper function to return data for a given campaign.

File

lib/mailchimp-api-php/tests/src/MailchimpCampaigns.php, line 10

Namespace

Mailchimp\Tests
View source
class MailchimpCampaigns extends \Mailchimp\MailchimpCampaigns {

  /**
   * @inheritdoc
   */
  public function __construct($api_key = 'apikey', $api_user = 'apikey', $http_options = []) {
    $this->client = new MailchimpTestHttpClient();
  }
  public function getClient() {
    return $this->client;
  }
  public function getEndpoint() {
    return $this->endpoint;
  }

  /**
   * @inheritdoc
   */
  public function getCampaign($campaign_id, $parameters = []) {
    parent::getCampaign($campaign_id, $parameters);
    $response = (object) [
      'id' => $campaign_id,
      'type' => 'regular',
      'recipients' => (object) [
        'list_id' => '57afe96172',
      ],
      'settings' => (object) [
        'subject_line' => 'Test Campaign',
      ],
      'tracking' => (object) [
        'html_clicks' => TRUE,
        'text_clicks' => FALSE,
      ],
    ];
    return $response;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Mailchimp::$api_key private property The Mailchimp API key to authenticate with.
Mailchimp::$api_user private property The Mailchimp API username to authenticate with.
Mailchimp::$batch_operations private property Array of pending batch operations.
Mailchimp::$client protected property The HTTP client.
Mailchimp::$debug_error_code private property A Mailchimp API error code to return with every API response.
Mailchimp::$endpoint protected property The REST API endpoint.
Mailchimp::$version public property API version.
Mailchimp::addBatchOperation protected function Adds a pending batch operation.
Mailchimp::DEFAULT_DATA_CENTER constant
Mailchimp::ERROR_CODE_API_KEY_INVALID constant
Mailchimp::ERROR_CODE_API_KEY_MISSING constant
Mailchimp::ERROR_CODE_BAD_REQUEST constant
Mailchimp::ERROR_CODE_COMPLIANCE_RELATED constant
Mailchimp::ERROR_CODE_FORBIDDEN constant
Mailchimp::ERROR_CODE_INTERNAL_SERVER_ERROR constant
Mailchimp::ERROR_CODE_INVALID_ACTION constant
Mailchimp::ERROR_CODE_INVALID_METHOD_OVERRIDE constant
Mailchimp::ERROR_CODE_INVALID_RESOURCE constant
Mailchimp::ERROR_CODE_JSON_PARSE_ERROR constant
Mailchimp::ERROR_CODE_METHOD_NOT_ALLOWED constant
Mailchimp::ERROR_CODE_REQUESTED_FIELDS_INVALID constant
Mailchimp::ERROR_CODE_RESOURCE_NESTING_TOO_DEEP constant
Mailchimp::ERROR_CODE_RESOURCE_NOT_FOUND constant
Mailchimp::ERROR_CODE_TOO_MANY_REQUESTS constant
Mailchimp::ERROR_CODE_USER_DISABLED constant
Mailchimp::ERROR_CODE_WRONG_DATACENTER constant
Mailchimp::getAccount public function Gets Mailchimp account information for the authenticated account.
Mailchimp::getBatchOperation public function Gets the status of a batch request.
Mailchimp::getDataCenter private function Gets the ID of the data center associated with an API key.
Mailchimp::getDefaultHttpClient private function Instantiates a default HTTP client based on the local environment.
Mailchimp::processBatchOperations public function Processes all pending batch operations.
Mailchimp::request public function Makes a request to the Mailchimp API.
Mailchimp::setClient public function Sets a custom HTTP client to be used for all API requests.
Mailchimp::setDebugErrorCode public function Sets a Mailchimp error code to be returned by all requests.
Mailchimp::VERSION constant
MailchimpCampaigns::addCampaign public function Adds a new campaign to the authenticated account.
MailchimpCampaigns::CAMPAIGN_TYPE_ABSPLIT constant
MailchimpCampaigns::CAMPAIGN_TYPE_PLAINTEXT constant
MailchimpCampaigns::CAMPAIGN_TYPE_REGULAR constant
MailchimpCampaigns::CAMPAIGN_TYPE_RSS constant
MailchimpCampaigns::CAMPAIGN_TYPE_VARIATE constant
MailchimpCampaigns::delete public function Deletes a Mailchimp campaign.
MailchimpCampaigns::EMAIL_TYPE_HTML constant
MailchimpCampaigns::EMAIL_TYPE_PLAIN_TEXT constant
MailchimpCampaigns::getCampaign public function @inheritdoc Overrides MailchimpCampaigns::getCampaign
MailchimpCampaigns::getCampaignContent public function Gets the HTML, plain-text, and template content for a Mailchimp campaign.
MailchimpCampaigns::getCampaigns public function Gets information about all campaigns owned by the authenticated account.
MailchimpCampaigns::getClient public function
MailchimpCampaigns::getEndpoint public function
MailchimpCampaigns::getSendChecklist public function Get the send checklist for a Mailchimp campaign.
MailchimpCampaigns::schedule public function Schedule a Mailchimp campaign.
MailchimpCampaigns::send public function Send a Mailchimp campaign.
MailchimpCampaigns::sendTest public function Sends a test email.
MailchimpCampaigns::setCampaignContent public function Sets the HTML, plain-text, and template content for a Mailchimp campaign.
MailchimpCampaigns::unschedule public function Unschedule a Mailchimp campaign.
MailchimpCampaigns::updateCampaign public function Updates a campaign.
MailchimpCampaigns::__construct public function @inheritdoc Overrides Mailchimp::__construct