Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Marketing Laravel Package

mailchimp/marketing

The official PHP client library for the Mailchimp Marketing API. Install via Composer (mailchimp/marketing), configure with an API key or OAuth2 token plus server prefix, then call endpoints like ping, audiences, and campaigns through a fluent client. Requires PHP 7.2+.

View on GitHub
Deep Wiki
Context7

The official PHP client library for the Mailchimp Marketing API

Frequently asked questions about Marketing
How do I install the Mailchimp Marketing PHP client in Laravel?
Install it with Composer using composer require mailchimp/marketing. It is a standard Packagist package, so Laravel's autoloading picks it up without manual require statements. You then instantiate MailchimpMarketing\ApiClient in your own service or factory class.
Does mailchimp/marketing include a Laravel service provider or facade?
No. It is an official, generated transport SDK for the Mailchimp Marketing API, not a Laravel framework package. There is no service provider, facade, config publication, or container binding, so you should create your own Laravel service wrapper and bind it in a provider.
How do I configure mailchimp/marketing with an API key and server prefix in Laravel?
Create a first-party MailchimpService or MailchimpClientFactory that instantiates ApiClient and calls setConfig with apiKey and server. Source those values from config/services.php, which reads from .env, rather than hard-coding credentials. The server prefix, such as us19, is required so the client can determine the correct host URL.
Can I use OAuth2 with mailchimp/marketing in a Laravel app?
Yes. The client supports either Basic Auth with an API key or OAuth2 by passing accessToken plus the server prefix in setConfig. In Laravel, store and load the OAuth token through your config and service layer rather than scattering token handling through controllers. You are responsible for token refresh and lifecycle management around the SDK.
What PHP and Laravel versions does mailchimp/marketing support?
The SDK requires PHP 7.2 or above, which is satisfied by any currently supported Laravel version. Laravel version compatibility is mainly a dependency-resolution question, especially around Guzzle and PSR-7 versions already locked by your application. Test installation alongside your existing lockfile before adopting it.
How should I structure Mailchimp API calls in Laravel?
Wrap the generated client behind your own MailchimpService with intent-named methods such as subscribeToList, upsertContact, and getCampaignStats. Bind that service in a service provider so controllers, jobs, and listeners depend on your interface rather than the vendor class. Do not create new ApiClient instances throughout the codebase.
How do I test Mailchimp API integration in Laravel without hitting the live API?
Mock your own MailchimpService interface in application tests rather than trying to mock the generated vendor client directly. Use a Mailchimp test account and sandbox proof of concept for end-to-end checks of ping, one read endpoint, and one write endpoint. Route mutating calls through queued jobs so tests and production traffic are easier to control.
Does mailchimp/marketing handle rate limits, retries, and batch requests?
The SDK is a thin API transport client, not a Laravel hardening layer. You should add retry-with-backoff for 429 and 5xx responses, centralize error mapping for auth, validation, and rate-limit failures, and inspect Mailchimp's rate-limit headers in your wrapper. Verify batch endpoint coverage against the generated client and Mailchimp API documentation before relying on it.
What are the license and production risks of using mailchimp/marketing?
The license is reported as NOASSERTION, so legal review is required to confirm the actual terms before production adoption. The package has relatively low community scrutiny, so plan to own production hardening yourself. Pin the package version explicitly instead of using the README's wildcard example, and scan the dependency tree.
Is mailchimp/marketing actively maintained, and should I use it or an alternative Laravel package?
The client is autogenerated from Mailchimp's codegen repository, and issues or PRs should be submitted there rather than to this repo. Its API surface tracks Mailchimp's specification, so expect occasional regressions or lag when endpoints change. You can use it behind your own Laravel service, or evaluate community Laravel wrappers, but verify their maintenance, license, and dependency compatibility first.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource