class MailchimpAutomations in Mailchimp 8
Same name in this branch
- 8 lib/mailchimp-api-php/src/MailchimpAutomations.php \Mailchimp\MailchimpAutomations
- 8 lib/mailchimp-api-php/tests/src/MailchimpAutomations.php \Mailchimp\Tests\MailchimpAutomations
Hierarchy
- class \Mailchimp\Mailchimp
- class \Mailchimp\MailchimpAutomations
Expanded class hierarchy of MailchimpAutomations
File
- lib/
mailchimp-api-php/ src/ MailchimpAutomations.php, line 5
Namespace
MailchimpView source
class MailchimpAutomations extends Mailchimp {
/**
* Gets information about all automations owned by the authenticated account.
*
* @param array $parameters
* Associative array of optional request parameters.
*
* @return object
*
* @see http://developer.mailchimp.com/documentation/mailchimp/reference/automations/#read-get_automations
*/
public function getAutomations($parameters = []) {
return $this
->request('GET', '/automations', NULL, $parameters);
}
/**
* Get information about a specific Automation workflow.
*
* @param string $workflow_id
* The unique id for the Automation workflow.
*
* @return object
*
* @see http://developer.mailchimp.com/documentation/mailchimp/reference/automations/#read-get_automations_workflow_id
*/
public function getWorkflow($workflow_id) {
$tokens = [
'workflow_id' => $workflow_id,
];
return $this
->request('GET', '/automations/{workflow_id}', $tokens);
}
/**
* Gets a list of automated emails in a workflow.
*
* @param string $workflow_id
* The unique id for the Automation workflow.
*
* @return object
*
* @see http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/#read-get_automations_workflow_id_emails
*/
public function getWorkflowEmails($workflow_id) {
$tokens = [
'workflow_id' => $workflow_id,
];
return $this
->request('GET', '/automations/{workflow_id}/emails', $tokens);
}
/**
* Gets information about a specific workflow email.
*
* @param string $workflow_id
* The unique id for the Automation workflow.
* @param string $workflow_email_id
* The unique id for the Automation workflow email.
*
* @return object
*
* @see http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/#read-get_automations_workflow_id_emails
*/
public function getWorkflowEmail($workflow_id, $workflow_email_id) {
$tokens = [
'workflow_id' => $workflow_id,
'workflow_email_id' => $workflow_email_id,
];
return $this
->request('GET', '/automations/{workflow_id}/emails/{workflow_email_id}', $tokens);
}
/**
* Gets queued subscribers from a Mailchimp workflow automation.
*
* @param string $workflow_id
* The unique id for the Automation workflow.
* @param string $workflow_email_id
* The unique id for the Automation workflow email.
*
* @return object
*
* @see http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/queue/#read-get_automations_workflow_id_emails_workflow_email_id_queue
*/
public function getWorkflowEmailSubscribers($workflow_id, $workflow_email_id) {
$tokens = [
'workflow_id' => $workflow_id,
'workflow_email_id' => $workflow_email_id,
];
return $this
->request('GET', '/automations/{workflow_id}/emails/{workflow_email_id}/queue', $tokens);
}
/**
* Gets a subscriber from a Mailchimp workflow automation email queue.
*
* @param string $workflow_id
* The unique id for the Automation workflow.
* @param string $workflow_email_id
* The unique id for the Automation workflow email.
* @param string $email
* The email address of the subscriber.
*
* @return object
*
* @see http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/queue/#read-get_automations_workflow_id_emails_workflow_email_id_queue_subscriber_hash
*/
public function getWorkflowEmailSubscriber($workflow_id, $workflow_email_id, $email) {
$tokens = [
'workflow_id' => $workflow_id,
'workflow_email_id' => $workflow_email_id,
'subscriber_hash' => md5(strtolower($email)),
];
return $this
->request('GET', '/automations/{workflow_id}/emails/{workflow_email_id}/queue/{subscriber_hash}', $tokens);
}
/**
* Adds a subscriber to a Mailchimp workflow automation email queue.
*
* @param string $workflow_id
* The unique id for the Automation workflow.
* @param string $workflow_email_id
* The unique id for the Automation workflow email.
* @param string $email
* The email address of the subscriber.
* @param array $parameters
* Associative array of optional request parameters.
*
* @return object
*
* @see http://developer.mailchimp.com/documentation/mailchimp/reference/automations/emails/queue/#create-post_automations_workflow_id_emails_workflow_email_id_queue
*/
public function addWorkflowEmailSubscriber($workflow_id, $workflow_email_id, $email, $parameters = []) {
$tokens = [
'workflow_id' => $workflow_id,
'workflow_email_id' => $workflow_email_id,
];
$parameters += [
'email_address' => $email,
];
return $this
->request('POST', '/automations/{workflow_id}/emails/{workflow_email_id}/queue', $tokens, $parameters);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Mailchimp:: |
private | property | The Mailchimp API key to authenticate with. | |
Mailchimp:: |
private | property | The Mailchimp API username to authenticate with. | |
Mailchimp:: |
private | property | Array of pending batch operations. | |
Mailchimp:: |
protected | property | The HTTP client. | |
Mailchimp:: |
private | property | A Mailchimp API error code to return with every API response. | |
Mailchimp:: |
protected | property | The REST API endpoint. | |
Mailchimp:: |
public | property | API version. | |
Mailchimp:: |
protected | function | Adds a pending batch operation. | |
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
constant | |||
Mailchimp:: |
public | function | Gets Mailchimp account information for the authenticated account. | |
Mailchimp:: |
public | function | Gets the status of a batch request. | |
Mailchimp:: |
private | function | Gets the ID of the data center associated with an API key. | |
Mailchimp:: |
private | function | Instantiates a default HTTP client based on the local environment. | |
Mailchimp:: |
public | function | Processes all pending batch operations. | |
Mailchimp:: |
public | function | Makes a request to the Mailchimp API. | |
Mailchimp:: |
public | function | Sets a custom HTTP client to be used for all API requests. | |
Mailchimp:: |
public | function | Sets a Mailchimp error code to be returned by all requests. | |
Mailchimp:: |
constant | |||
Mailchimp:: |
public | function | Mailchimp constructor. | 7 |
MailchimpAutomations:: |
public | function | Adds a subscriber to a Mailchimp workflow automation email queue. | |
MailchimpAutomations:: |
public | function | Gets information about all automations owned by the authenticated account. | 1 |
MailchimpAutomations:: |
public | function | Get information about a specific Automation workflow. | 1 |
MailchimpAutomations:: |
public | function | Gets information about a specific workflow email. | 1 |
MailchimpAutomations:: |
public | function | Gets a list of automated emails in a workflow. | 1 |
MailchimpAutomations:: |
public | function | Gets a subscriber from a Mailchimp workflow automation email queue. | 1 |
MailchimpAutomations:: |
public | function | Gets queued subscribers from a Mailchimp workflow automation. | 1 |