Issue #3608515: Add customer-details-sync drush command for historical backfill
Adds a commerce-mautic-connect:customer-details-sync drush command (aliases cmccds, mautic-customer-details-sync) to backfill the Customer Details fields onto Mautic contacts for customers who ordered before the feature was enabled.
Changes:
- New command with
--dry-run,--limitand--states, mirroring the existingcoupon-tags-synccommand. Iterates historical orders, groups by customer email (each customer's most recent order for the latest billing profile), and upserts via the existing CustomerDetailsSyncService. Rate-limited to avoid overwhelming the Mautic API on large backfills. - New public
CustomerDetailsSyncService::previewOrderContact(): shares the gate and payload logic withsyncOrderContact(), so the dry-run output is exactly what the real sync would send, without touching the API. - Unit tests for
previewOrderContact(). - README documentation for the new command.
Tested locally in --dry-run against real order data: the ISO country code to country name conversion was confirmed for PT (Portugal), CH (Switzerland) and ES (Spain).