mailchimp / transactional
Requires
- php: >=7.2
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.4 || ^7.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^7
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2024-12-10 02:58:46 UTC
README
Mailchimp Transactional — PHP
The official PHP client library for the Mailchimp Transactional API (v1)
Installation
Option 1: Install via Packagist
composer require mailchimp/transactional
Or add the following to composer.json
{
"require": {
"mailchimp/transactional": "*"
}
}
Install all composer dependencies using:
composer install
Option 2: Install Manually
Clone the repo
git clone git@github.com:mailchimp/mailchimp-transactional-php.git
In the project root, install all dependencies
composer install
Manually include vendor/autoload.php
in your implementation
require_once('/path/to/MailchimpTransactional/vendor/autoload.php');
Quick Start
Note that this SDK requires PHP 7.2 or above.
require_once('/path/to/MailchimpTransactional/vendor/autoload.php'); $mailchimp = new MailchimpTransactional\ApiClient(); $mailchimp->setApiKey('YOUR_API_KEY'); $response = $mailchimp->users->ping(); print_r($response);
Sending Requests
All requests are sent via POST and accept a single argument as the request body parameter.
$mailchimp->templates->publish([ 'name' => 'My Template']);
Output Formats
Optionally, you can set the default response format for all requests to one of the following:
json
(default)xml
php
yaml
$mailchimp->setDefaultOutputFormat('xml');
You can also set the response format for a single request by passing in a special outputFormat
param to the request body.
$mailchimp->senders->list([ 'outputFormat' => 'php']);
PRs and Issues
This repo is autogenerated from https://github.com/mailchimp/mailchimp-client-lib-codegen -- please submit PRs or issues there!
API Endpoints
All URIs are relative to https://mandrillapp.com/api/1.0
Additional Libraries
Mailchimp Transactional libraries are available in the following languages: