Download the PHP package nztim/mailchimp without Composer
On this page you can find all versions of the php package nztim/mailchimp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download nztim/mailchimp
More information about nztim/mailchimp
Files in nztim/mailchimp
Download nztim/mailchimp
More information about nztim/mailchimp
Files in nztim/mailchimp
Vendor nztim
Package mailchimp
Short Description Mailchimp API wrapper, includes Laravel 5 support.
License MIT
Package mailchimp
Short Description Mailchimp API wrapper, includes Laravel 5 support.
License MIT
Please rate this library. Is it a good library?
Informations about the package mailchimp
Mailchimp
Basic abstraction with Laravel integration for Mailchimp API v3
Installation
composer require nztim/mailchimp- For Laravel support:
- Laravel 5.5+ will auto-discover the package, for earlier versions you will need to:
- Add the service provider to
config/app.php:NZTim\Mailchimp\MailchimpServiceProvider::class, - Register the facade:
'Mailchimp' => NZTim\Mailchimp\MailchimpFacade::class,
- Add the service provider to
- Add an
.envvalue forMC_KEY(your API key) - Optionally, publish the config file:
php artisan vendor:publish --provider=NZTim\Mailchimp\MailchimpServiceProvider
- Laravel 5.5+ will auto-discover the package, for earlier versions you will need to:
Usage
- Within Laravel 5, use the
Mailchimpfacade or injectNZTim\Mailchimp\Mailchimpusing the container. - Alternatively, instantiate using the API key:
$mc = new NZTim\Mailchimp\Mailchimp($apikey)
For access to all the member properties available in the v3 API, use the Member class to subscribe and update list members:
As with the subscribe() method, double-opt-in is default but existing members will not be asked to re-verify so you can use the same methods for create and update without needing to check.
Errors
- Exceptions are thrown for all errors.
- Networking/communications errors will usually be of the type
ConnectionException. - API errors will be of the base type
NZTim\Mailchimp\MailchimpException, e.g. incorrect API key, list does not exist. NZTim\Mailchimp\Exception\MailchimpBadRequestExceptionincludes aresponse()method that attempts to provide the response body as an array, for automated handling of some error types.- Gotchas with merge fields:
- If you receive an error adding a new subscriber, check for required merge fields.
- Merge fields are case-sensitive.
Mailchimp::addUpdateMemberSkipMergeValidation()is available if needed.
Examples
Upgrading
- To v6.0: PHP 8.4 is required
- To v5.0: PHP 8.1 is required
- To v4.0:
- PHP 7.4 | 8.0 is now required
- Use unsub with archive in order to maximise the use of free accounts.
- To v3.0:
- Exceptions are now thrown for all errors, use try/catch where necessary
- Double-opt-in is now the default, update
Mailchimp::subscribe()as required
All versions of mailchimp with dependencies
PHP Build Version
Package Version
The package nztim/mailchimp contains the following files
Loading the files please wait ...