Subject: Mailchimp integration seems to miss status_if_new:"subscribed" on PUT; bulk sync leaves most members not subscribed / not in group.
Environment
What we expect
What actually happens
Key evidence from today’s sync
Why we believe this is the root cause
I can provide full logs and payload samples if needed (or run any additional diagnostics you suggest).
Thanks a lot for your help!
Environment
- EspoCRM: 9.1.8
- Mailchimp Integration for Espo: 1.2.3
- Mailchimp Audience: TESTMARCO03 (us19)
- Mailchimp account region: us19
- PHP: 8.2
- DB: MySQL/MariaDB (phpMyAdmin used for read-only inspection)
What we expect
- When we click “MailChimp List Sync → Sync now” on the Espo target list UNIMED NEWSLETTER, all recipients in that list (≈7,221 deduplicated valid emails) should be present in Mailchimp, subscribed, and assigned to the interest group “Liste da Espo → Newsletter.”
What actually happens
- Espo reports “sync scheduled” and we see many batch items in the mail_chimp_queue (status moving from Pending/Running to Success).
- However, in Mailchimp the corresponding group Newsletter ends up with ~4,036 contacts, not ~7,221.
- A quick CSV import into Mailchimp (Update existing, Status = Subscribed, set interest Newsletter) immediately brings the audience to the expected size, which suggests the API sync is not setting the subscription/interest flags as needed.
Key evidence from today’s sync
- Espo job log excerpt (timestamps UTC+2):
[2025-09-03 16:07:04] DEBUG: MailChimp: processQueueItemsUpdateList [2025-09-03 16:07:04] DEBUG: MailChimp: processQueueItemsUpdateList item 68b867a85877a47d2 [2025-09-03 16:07:18] DEBUG: MailChimp: ...fetched recipient list, count: 7222
→ The integration sees 7,222 recipients in the target list. - Queue shows many PUT operations to /lists/{listId}/members/{hash} like:
{"path": "lists/e3f56c1e80/members/Vxxxxxxxxxxxxxxxx", "method": "PUT", ...}
but no occurrence of "status_if_new":"subscribed" in the payloads. - SQL checks (read-only) against mail_chimp_queue for today:
- How many PUT? → 204
- How many PATCH? → 0
- How many PUT include "status_if_new":"subscribed"? → 0
- Last 5 PUT payload previews confirm no status_if_new is present.
- One 400 error we did capture (unrelated to the count gap, but included for completeness):
[2025-09-03 16:14:23] DEBUG: MailChimp: Error in batch item: Array ( [entityType] => Contact [entityId] => dfcff611e0f047569 [operationType] => subscribe [detail] => Please provide a valid email address. [code] => 400 )
- Mailchimp Single opt-in is enabled (Singolo opt-in).
- Espo → Integrations → Mailchimp mapping includes custom merge tags for:
- LISTE (Lista di Destinazione), CLUSTERS, NAZIONI, CNAME (all present in Mailchimp under Audience fields & merge tags).
- We tested with a brand new audience as well, and repeated the sync; behavior is consistent.
Why we believe this is the root cause
- According to Mailchimp’s API, PUT /lists/{list_id}/members/{subscriber_hash} requires either status for new members, or status_if_new to set the initial status.
- The payloads the integration is sending do not include status_if_new, and we don’t see a status field either.
- Result: large portions of the list are not created as “subscribed” (and the interest/group assignment also doesn’t reflect the full target list).
- A manual CSV import (Update existing, Status=Subscribed, set interest) fixes the audience immediately, which strongly suggests the API payload from the integration is missing the subscription status for new members.
- In EspoCRM, open target list UNIMED NEWSLETTER (contains ≈7,221 valid emails).
- Click MailChimp List Sync → Sync now (green notice: “sync scheduled”).
- Observe mail_chimp_queue: many PUT items to /lists/{list_id}/members/{hash}; most go to Success.
- After completion, in Mailchimp open Audience → Groups → Liste da Espo → Newsletter → count is ~4,036, not ~7,221.
- SQL search in mail_chimp_queue shows zero payloads include "status_if_new":"subscribed".
- CSV import into Mailchimp with Status=Subscribed and Newsletter interest immediately brings the group close to the expected size.
- Could you please confirm whether the Espo Mailchimp Integration 1.2.3 is supposed to send status_if_new:"subscribed" (or status:"subscribed") on PUT when a member does not yet exist in Mailchimp?
- If yes, this looks like a bug: the current payloads never include status_if_new, causing new members not to be subscribed and/or not counted in the target interest group.
- If the expected behavior has changed, what is the recommended way (via the integration settings or code) to ensure all new contacts are created as “subscribed” and assigned to the correct group during a target-list sync?
- Export recipients from the Espo target list and import into Mailchimp (Update existing + Status=Subscribed + set group), which immediately aligns Mailchimp with Espo.
- This is safe but manual; we’d prefer the integration to handle it automatically.
I can provide full logs and payload samples if needed (or run any additional diagnostics you suggest).
Thanks a lot for your help!
Comment