Drupal and Mailchimp newsletter integration

Connecting Drupal sign-up forms to Mailchimp audiences, mapping subscriber fields and keeping consent records aligned, using the contributed Mailchimp module on a supported Drupal version.

On this page

How a Drupal Mailchimp integration works and where it fits

A Drupal site that collects newsletter sign-ups needs those addresses to land in the right Mailchimp audience with consent intact. The supported way to do this is the contributed Mailchimp module from Drupal.org, which connects Drupal to Mailchimp's API so that form submissions and user records can be pushed to audiences. The module's project page lists its 3.1.5 release as supporting Drupal ^10.1 or ^11, so confirm that your target Drupal version falls within that range before you plan the build. Like Drupal core, the module is licensed under GPL-2.0-or-later, which means no license fee applies to the code itself. Any cost sits in the build, the Mailchimp plan and the people who run it.

The module sits between two systems that each hold their own view of a subscriber. Drupal owns the sign-up form, the user account and any content tied to it, while Mailchimp owns the audience, the subscriber status and the send history. The integration handles the handoff between them, but it does not decide what your consent wording means, which fields belong in your audience model, or how unsubscribes flow back to Drupal. Those are design decisions to make before the build starts. Ask for a written statement of which system is the source of truth for email address, name, interests and opt-in status.

Plan for what the module does not cover. A contributed module does not replace a review of your consent flow, your privacy notice or the Mailchimp account settings that govern double opt-in and data retention. Check with your privacy and legal teams which of those obligations apply in your jurisdictions. Also confirm how the module behaves on your exact Drupal and PHP versions, and whether it needs custom code for field mappings you consider essential, because those mappings are where most drift between the two systems begins.

What you need before connecting Drupal to Mailchimp

Most delays in a Drupal and Mailchimp project come from decisions made before any code is written: which Drupal version runs the site, who owns the Mailchimp account, and how the audience and consent wording are structured. Work through these cards with your marketing, legal and platform teams before the build starts.

Drupal core version and PHP

The Mailchimp module's 3.1.5 release supports Drupal ^10.1 or ^11, so confirm which core version the site runs before choosing a module release. Drupal 10 requires PHP 8.1 or later and Drupal 11 requires PHP 8.3 or later, so check the PHP version on every web node, not only the development server. Drupal 10 reaches end of life on December 9, 2026, so a site started now should plan for Drupal 11 from the outset.

Mailchimp account and API key owner

Decide which person or shared role owns the Mailchimp account and generates the API key, and record that owner in the project plan. Keys tied to a departed employee cause outages when access is removed. Ask Mailchimp which data center your account uses, because the API key format and the endpoint the module calls depend on it. Confirm with Mailchimp what your plan allows for audience count, API usage and automation features.

Outbound HTTPS access to Mailchimp

The Drupal server must make outbound HTTPS requests to the Mailchimp API endpoint for your data center, and cron or queue workers must be able to reach it too. Check firewall rules, egress proxies and container network policies in every environment, including staging. Confirm the exact host names with Mailchimp and your network team before you request firewall changes, rather than copying a host name from an old example.

Target audience structure

Agree how audiences, segments and merge fields map to Drupal content. Decide whether one Drupal site feeds one audience or several, which merge fields carry the subscriber's name, language and preferences, and which fields are read-only in Mailchimp. Choose the unique identifier that links a Drupal user to a Mailchimp contact before importing any existing lists, because changing it later means re-matching records.

Consent wording agreed with legal

Obtain approved consent wording for each sign-up form, including the purpose of the mailing, the sender identity, the unsubscribe commitment and any separate checkbox for marketing versus product updates. Store the exact text version alongside each subscription so you can show what a subscriber agreed to. Legal should also confirm the lawful basis and retention period for consent records, since Drupal and Mailchimp each keep their own copy.

Environments and test audiences

Set up a separate Mailchimp audience or account for development and staging so test sign-ups never reach real subscribers. Confirm with Mailchimp whether your plan supports multiple audiences and how test contacts count against plan limits. Agree a naming convention and a sample dataset so every environment can be tested end to end before go-live.

Configuring the Mailchimp module step by step

This sequence takes a Drupal site from a fresh module install to a tested two-way link with one Mailchimp audience. Each step ends with a check you can run before any real subscriber data moves.

  1. Install the Mailchimp module with Composer

    A developer adds the contributed Mailchimp module to the Drupal codebase with Composer, so the version is tracked in composer.json and the lock file like every other dependency. The module's Drupal.org project page lists its supported Drupal versions, and the 3.1.5 release supports Drupal ^10.1 or ^11, so confirm that constraint against your core version before installing. The step is done when the module appears in the Extend screen or in drush pm:list, and the change is committed to version control rather than edited on the live server.

  2. Create a sandbox audience in Mailchimp

    Before connecting anything, the marketing owner creates a separate test audience in the Mailchimp account and, if the account allows it, a separate test account for the rehearsal. Using a sandbox keeps test sign-ups away from the production list, which matters because a bad sync can add or change real contacts. The step is done when the sandbox audience has its own name, its audience ID is written down, and the production audience is not used for any test.

  3. Add the API key and select the audience

    An administrator generates a Mailchimp API key for the sandbox account and enters it on the module's configuration page, with the API key kept in the environment or secrets store instead of exported configuration where your setup allows it. After saving, the module lists the audiences available to that key, and the sandbox audience is selected as the target list. The step is done when the connection test reports success and the selected audience ID matches the one recorded in step two.

  4. Create or map the sign-up form

    The site builder either maps an existing Drupal form, such as a Webform or a custom block, to the Mailchimp audience or creates a dedicated subscription form with an email field and any consent checkbox the business needs. The form should carry the same consent wording used in the privacy notice, since the form is where the opt-in is captured. The step is done when the form renders on a staging page, validates the email address, and shows the expected fields in the module's mapping screen.

  5. Map Drupal fields to Mailchimp merge fields

    The developer and the marketing owner agree which Drupal fields map to which Mailchimp merge fields, such as first name, last name, and language, and which values are sent as tags or groups. Each mapping should have a named owner and a documented source, so a later change in either system has a clear reference. The step is done when a test submission with known values appears in the sandbox audience with every mapped field populated correctly and no unmapped data sent.

  6. Set the sync direction and subscription rules

    The team decides whether Drupal pushes subscriptions to Mailchimp only, or whether Mailchimp unsubscribes and profile changes are pulled back into Drupal, and documents how an unsubscribe in either system is handled. This decision drives the consent record, so it should be signed off by the people who own legal and marketing compliance rather than left to the developer. The step is done when a test unsubscribe made in Mailchimp is reflected according to the agreed rule, and the rule is written in the project's runbook.

  7. Test with the sandbox audience end to end

    The team runs a scripted set of test sign-ups, edits and unsubscribes against the sandbox audience, using test addresses the team controls. For each case they check that the subscriber appears with the expected status, merge fields and tags, and that any errors show up in the Drupal log rather than failing silently. The step is done when every test case passes, the results are recorded, and the team can explain what happens to a duplicate address or a failed API call.

  8. Switch to the production audience with a checklist

    Once the sandbox results are signed off, the administrator points the module at the production audience with the same configuration, repeats a small number of test sign-ups under supervision, and removes the test contacts afterward. The change is made through configuration management so the production setting is traceable, and the rollback path is known before the switch. The step is done when a supervised sign-up reaches the production audience with the right tags and consent state, and the sandbox remains unchanged for future testing.

Choosing one-way or two-way field sync

In a one-way design, Drupal is the system of record for subscriber data. Sign-up forms, account pages and administrative tools write to Drupal, and the integration pushes the resulting subscription and field values to Mailchimp. Mailchimp is treated as a delivery channel. Changes made inside Mailchimp, such as a subscriber editing a preference or a marketer adjusting a merge field, are overwritten or ignored on the next push, so the team must agree on that before launch.

  • Simple failure model: a failed push can be retried from Drupal, and the Drupal record remains the reference copy.
  • Predictable audit trail: consent and preference changes originate in one place that your records team can inspect.
  • Fewer conflict rules: no logic is needed to decide which of two edits wins.
  • Marketing limits: staff who edit contacts in Mailchimp will see values that Drupal may replace.
  • Unsubscribes need a path back: if a recipient unsubscribes in Mailchimp, confirm how that status reaches Drupal, because a pure push design may not capture it.

Before committing, confirm with the Mailchimp module documentation which direction each sync option supports in the version you install. Check the list of fields with your marketing and legal owners.

Mapping Drupal fields, consent and status to Mailchimp

This table compares each Drupal source of data with the Mailchimp audience field, status or record it should populate, so teams can see where values are copied and where they must be decided. Read each row as a decision to confirm before the sync goes live, because the Mailchimp side depends on how your audience was configured. The main takeaway is that status and consent need their own rules, since a sign-up form value alone does not prove what a subscriber agreed to.

Drupal sourceMailchimp targetDecision or check
Email address (user or webform)Subscriber email addressUse as the unique match key; confirm how duplicates and case differences are handled.
First and last name fieldsMerge fields such as FNAME and LNAMEConfirm merge tags exist in the audience settings before mapping; missing tags drop data silently.
Preferred language or regionCustom merge field or group interestCreate the field in Mailchimp first; confirm whether segmentation needs it as a tag or group.
Newsletter opt-in checkboxSubscription status (subscribed or pending)Map only after the opt-in is recorded; agree whether double opt-in is required for your audience.
Unsubscribe or withdrawal eventStatus set to unsubscribedConfirm the sync pushes withdrawals back to Drupal and that suppressed contacts are not re-added.
Consent flag and timestampCustom merge field or note on the subscriber recordStore the consent wording version and time in Drupal as the record of truth; confirm what Mailchimp retains for your audience.
Topic or interest selectionsTags or interest groupsDefine tag names once; confirm which tags are added, removed or left alone on each sync.
Account deletion or role changeArchive, delete or tag in MailchimpAgree the rule with legal or privacy owners; confirm deletion requests are propagated to both systems.

Protecting API keys, personal data and consent records

A newsletter integration moves email addresses, names and consent decisions between Drupal and Mailchimp, so the credentials and records behind it need the same care as the rest of the site. The cards below cover where the key lives, who can use it, how data travels, what gets logged and where consent evidence is kept.

Keep the API key out of version control

The Mailchimp API key grants access to your audiences, so it should live in environment variables, a secrets manager or a settings file excluded from Git, never in exported configuration. Drupal's configuration export can capture module settings, so check that the key field is not synced into the active configuration files your team commits. Confirm how your hosting platform injects secrets during deployment and who can read them in each environment.

Scope the Mailchimp account and key

Ask Mailchimp how API keys are issued for your account plan and whether a key can be tied to a specific user rather than an account owner. Restrict the people who can create or rotate keys, and plan a rotation procedure that updates the Drupal secret, clears caches and confirms a test sign-up still succeeds. Review which audiences and lists the integration can reach, so a compromised key cannot touch unrelated marketing data.

Send all traffic over HTTPS

Sign-up forms collect personal data and the module sends it to Mailchimp's API, so every form page, the Drupal callback endpoints and the outbound API calls should use TLS. Enforce HTTPS at the web server, set secure cookie flags and confirm that no staging environment exposes live keys over plain HTTP. Test the full path with a browser and a server-side request, because a page can look secure while an embedded asset or redirect still falls back to HTTP.

Log events without exposing personal data

Drupal's logs and the Mailchimp module's error messages can capture email addresses and merge fields when a sync fails. Decide which events are logged (sign-up accepted, API error, rate limit) and mask or omit the address itself. Restrict access to the Recent log messages report, and check that your error tracking tool does not capture full request bodies from form submissions.

Keep consent evidence on the Drupal side

Mailchimp records consent state for each contact, but your own record of how and when a person opted in is what you will need during a complaint or audit. Store the consent text shown, the form version, the timestamp and the source page in Drupal, keyed to the submission. Confirm with your legal or privacy team how long these records are retained and how a withdrawal is recorded in both systems.

Review module security advisories

The Drupal Security Team publishes advisories with CVE identifiers and risk scores for core and contributed projects, and it issues security releases on the third Wednesday of the month. Subscribe to advisories for the Mailchimp module, keep it on a supported release line, and include it in your routine update testing. Record who reviews each advisory, how quickly a patch is applied and how you confirm the fix in staging before production.

Why subscribers go missing or consent drifts

This table lists the failures we most often see when Drupal and Mailchimp fall out of step, with the cause and fix for each. Read it as a checklist to run during build and again after every form or audience change. The main takeaway is that most drift comes from mismatched keys, mapping and consent logic rather than from Mailchimp itself.

FailureLikely causeFix
API key rejected or sync silently failsThe key lacks scope for audiences or lists, belongs to another account, or was rotated without updating the Drupal configurationCreate a key for the integration account, confirm it can read and write the target audience, store it outside exported config, and test a single sign-up after every change
Duplicate contacts for one personEmail addresses with different letter case are treated as separate records in the sync logic or in the Drupal user tableNormalize email to lowercase before sending, check for existing members by hashed email, and merge duplicates in Mailchimp before go-live
New form fields never reach MailchimpMerge fields were not mapped after the Webform or user field changed, so the new value is dropped without an errorAdd a mapping review to every form change request, list each field against its Mailchimp merge tag, and run a test submission that checks the stored audience record
Unsubscribe in Mailchimp not reflected in DrupalDrupal only pushes data outward, so status changes made in Mailchimp never return to the siteConfigure webhooks or a scheduled pull for unsubscribe and cleaned events, then block re-subscription from Drupal until the status is updated
Double opt-in not enforcedThe audience was set to single opt-in, or the form posts subscribe requests as already confirmedConfirm the audience setting, send pending status for new sign-ups, and record the confirmation timestamp only when Mailchimp confirms the address
Sign-ups delayed or lost during queue runsDrupal cron or the queue worker runs infrequently, fails silently on timeouts, or the mail or API calls are retried without limitsRun the queue with a dedicated worker or scheduled job, monitor failed items, and set alerts on queue backlog and API error responses
Consent records disagree between systemsConsent is stored only as a checkbox value in Drupal, with no timestamp, form version or sourceStore consent text version, time and source in Drupal, pass the same values to Mailchimp as merge fields or notes, and reconcile both systems on a fixed schedule

Questions teams ask before connecting Drupal to Mailchimp

What does a Drupal to Mailchimp integration cost, and who pays for what?

The Mailchimp module for Drupal is free software, so the cost sits in the work around it: configuration, field mapping, testing and consent design. Licensing is not the line item. Effort is paid to whoever builds and tests the connection, which may be your in-house team or a partner working from a written scope. Some costs are one-time, such as the initial build, mapping and test passes. Others recur, such as reviewing the module after Drupal updates and checking that sign-up forms still sync. Ask any quote to split these out, and to state which Drupal and Mailchimp settings are in scope.

How long does the integration take?

Duration depends mainly on how many fields you sync and which direction the data flows. A sign-up form that only creates subscribers in one audience is a small job. Two-way sync, merge fields pulled back from Mailchimp, tags, multiple audiences and consent preferences add mapping and test cases quickly. Testing is the step teams underestimate, because each field needs checks for new sign-ups, updates, unsubscribes and failed API calls. Ask for the timeline to be tied to a named field list and sync direction, so the schedule can be checked against scope.

What does our team need to supply before work starts?

Three inputs decide most of the early work. First, the audience structure: how many audiences exist, which fields each one uses and who owns them. Second, the consent wording that appears on each form, along with the lawful basis your legal or privacy team has approved. Third, a Mailchimp administrator who can create API credentials, confirm audience settings and approve test data. Without these, the build stalls on guesses about what a subscriber has agreed to. Collect them before the scope is signed.

Can our in-house team build this without a partner?

Yes, if you have a Drupal developer who can install and configure contributed modules, write or review custom code for field mapping, and set up a staging site for testing. The harder parts are consent design and reliable sync behavior, not the installation itself. A team with no experience of Drupal forms, Mailchimp audiences or privacy requirements usually needs more testing time. Decide which parts you will own, such as day-to-day operation and content changes, and which need review from someone who has built this before.

Does the integration keep consent records consistent between Drupal and Mailchimp?

It can, but only when the consent model is designed before the build. Decide where the consent decision is recorded, which system is the source of truth when they disagree, and how unsubscribes flow back to Drupal. Check that a subscriber who opts out in Mailchimp is not re-added by a later form submission. Document the mapping so that an auditor or privacy lead can trace each consent to a form, a date and the wording shown at the time. This is an engineering and process task that your compliance team reviews. It is not a certification.

How do Drupal upgrades affect the Mailchimp module?

The module must support the Drupal version you run. The current Mailchimp release, 3.1.5, supports Drupal ^10.1 or ^11, so a site on Drupal 10 or 11 can use it today. Drupal 10 reaches end of life on December 9, 2026, and Drupal 12 is scheduled for the week of December 7, 2026, so plan a check of module compatibility before each major move. Drupal 12 requires PHP 8.5 or later. Bugfix releases arrive on the first Wednesday of each month and security releases on the third Wednesday, so budget time for routine updates. Confirm module support against the project page before any upgrade.

Does DeployOpen handle the Mailchimp work for us, and what does it cover?

DeployOpen plans, configures, integrates and tests self-hosted open-source platforms in your own infrastructure. For this topic, that means scoping the sign-up forms, audiences, field mapping and consent handling, then building and testing the connection in a staging environment before release. Most engagements are fixed-scope, with deliverables and timelines agreed in writing first. DeployOpen does not issue compliance attestations; your auditors and certification bodies do that. Ongoing support and upgrades are available as retainers if you want them.

How DeployOpen scopes and delivers the Mailchimp integration

DeployOpen plans and builds the Drupal and Mailchimp connection inside infrastructure you control, starting from a written scope that names the sign-up forms, audiences, fields and consent rules involved. Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts, and ongoing support is available as a retainer.

How we scope

  • Map each sign-up form, Mailchimp audience and merge field that the integration will read or write.
  • Agree in writing how consent wording, opt-in type and consent timestamps are captured and stored on the Drupal side.
  • Record which system is the source of truth for each subscriber field and how conflicts are resolved.

How we build

  • Install and configure the contributed Mailchimp module on a Drupal version and PHP release confirmed against its project page.
  • Build field mappings and sign-up flows as configuration, with custom code only where the scope requires it.
  • Test subscribe, update, unsubscribe and resubscribe paths on a non-production site before any live audience is touched.

How we hand over

  • Deliver a written field mapping, consent record model and runbook describing how sync errors are found and corrected.
  • Walk your team through the configuration, the test results and the known limits of the integration.
  • Document the upgrade points where the Mailchimp module, Drupal core and PHP versions must be checked together.

How we support

  • Review module releases and Drupal core schedule changes against the agreed integration before they reach production.
  • Check sync logs and consent records after upgrades, hosting changes or Mailchimp account changes.
  • Offer ongoing support, upgrades and testing as a retainer, priced from the written scope rather than a fixed list.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.