Closed mbabker closed 3 years ago
I think this is caused because the subscribtion handler is called in the pre_update event instead of the post_update event. You can temporary fix this by redefining the following service and change 'sylius.customer.pre_update' to 'sylius.customer.post_update'
bitbag_sylius_mailchimp_plugin.event_listener.customer_listener:
class: BitBag\SyliusMailChimpPlugin\EventListener\CustomerNewsletterListener
public: true
arguments:
- "@bitbag_sylius_mailchimp_plugin.handler.newsletter_subscription_handler"
tags:
- { name: "kernel.event_listener", event: "sylius.customer.post_register", method: customerCreateEvent }
- { name: "kernel.event_listener", event: "sylius.customer.pre_update", method: customerUpdateEvent }
See #36
Thank You for this report, changing sylius.customer.pre_update' to 'sylius.customer.post_update' is just a part of the solution as the old email has to be removed from Mailchimp audience itself. The fix for this is in progress at the moment.
If editing a customer's email address through the admin interface and the customer is subscribed to the newsletter, the
NewsletterSubscriptionHandler
performs changes that results in a unique constraint violation because it is trying to create a new customer record with the updated email address.