Problem/Motivation
The Customer Details feature (1.2.0) only syncs forward, on the place and paid transitions. Sites that enable it after they already have orders cannot backfill name, phone and country onto existing Mautic contacts, so pre-existing customers stay without those fields until they order again.
Proposed resolution
Add a drush command commerce-mautic-connect:customer-details-sync (aliases cmccds, mautic-customer-details-sync) that iterates historical orders, groups by customer email (using each customer's most recent order for the latest billing profile), and upserts the Mautic contact via the existing CustomerDetailsSyncService. Mirrors the coupon-tags-sync command.
Options: --dry-run (preview the exact payload without writing), --limit=N, --states. Rate-limited for large backfills. Also adds a public CustomerDetailsSyncService::previewOrderContact() that shares the gate and payload logic with syncOrderContact(), so the dry-run matches the real sync exactly.
Issue fork commerce_mautic_connect-3608515
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
introfini commented