silentz/mailchimp
silentz/mailchimp is a Laravel package that provides a convenient wrapper around the Mailchimp API, helping you manage audiences, subscribers, and related account data from your PHP application with simple, expressive methods and Laravel-friendly configuration.
This is a Statamic addon, so the realistic starting point is a Statamic site that already has a form (newsletter signup, gated download, event registration) and wants those submissions landing in a Mailchimp audience automatically.
composer require silentz/mailchimp, then publish the config with php artisan vendor:publish and look for config/mailchimp.php..env (MAILCHIMP_API_KEY, MAILCHIMP_LIST_ID) rather than committed config.-us1, -eu1, etc.) — the key format is <key>-<dc> and the addon derives the API endpoint from it.storage/logs/laravel.log and the Mailchimp audience in parallel — the fastest way to confirm the wiring is a real submission showing up as a new member.If you need programmatic subscription outside a form (a custom controller, a Livewire component, an Artisan command backfilling old signups), resolve the package's service from the container or use whatever facade it exposes and call its subscribe method directly.
Form-driven subscription (the common path). Register the addon as a handler/action on your Statamic form, so every submission is mirrored to Mailchimp. This keeps marketing logic out of your controllers and lets non-developers edit the form in the Control Panel. Map form field handles to Mailchimp merge tags (typically FNAME, LNAME, EMAIL) either in config or in the form definition, depending on how the addon is wired.
Programmatic subscribe in a listener or controller. For cases where the form isn't the source of truth — user registration, checkout completion, a "notify me" modal — call the package directly after your own validation, then treat Mailchimp as a best-effort side effect (see Gotchas). This is the pattern that scales: one small SubscribeToNewsletter action class, injected wherever needed.
Multiple audiences. If you segment by product, region, or lead source, prefer a config map of named audiences (newsletter, customers, waitlist) over hardcoding a single list ID. Most Mailchimp addons let you pass the list ID per call; wrap that in your own service so swapping a list later is a config change, not a grep.
Group and tag assignment. Use Mailchimp interest groups/tags for segmentation instead of maintaining parallel lists. Push the group/tag alongside the subscription so your marketing team can slice audiences without engineering work.
Queue the call. Wrap the subscription in a queued job (or Mailchimp::queue(...) if the addon offers it). Mailchimp round-trips add 100–400ms and you don't want that in a form POST. Pair with retry() and a low tries count so a Mailchimp outage doesn't flood the queue with dead jobs.
Sync existing Statamic users. A scheduled Artisan command that iterates User::all() and upserts members is a common one-off. Batch it in chunks and respect rate limits (see below) — do not foreach thousands of users synchronously.
abc123-us1 means all requests go to us1.api.mailchimp.com. A truncated or copied key without the suffix produces confusing 401s rather than a clear "wrong endpoint" error.list_id. They mean the same thing; the audience ID is a short hex string found in Settings → Audience name and defaults.pending rather than subscribed, look at the audience's "Form settings" in Mailchimp before blaming the addon. This is the single most common "it doesn't work" report.Member Exists title. Decide explicitly whether to treat that as success (idempotent upsert semantics) or to PATCH the existing member — the addon may or may not handle this for you.FNAME when the audience only has FIRSTNAME fails or silently drops data depending on your error handling. Create merge fields in Mailchimp first, then wire them up.usleep() or a rate-limited job — this is where naive integrations fall over..env.testing, and guard against accidentally writing to production by asserting the audience ID in tests.composer.json before assuming it works on the latest Statamic/Laravel. If a form handler misbehaves after an upgrade, the package's service provider and form-action registration are the first places to inspect.Newsletter service. That gives you one place to swap in a queued job, add logging, or replace the dependency entirely if you outgrow it — without touching every call site.How can I help you explore Laravel packages today?