Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behavior after editing customer in the backend #422

Closed
wojtekn opened this issue Oct 9, 2018 · 3 comments
Closed

Unexpected behavior after editing customer in the backend #422

wojtekn opened this issue Oct 9, 2018 · 3 comments

Comments

@wojtekn
Copy link
Contributor

wojtekn commented Oct 9, 2018

Preconditions

  1. Magento CE 2.1.15
  2. mc-magento2 1.0.30.

Steps to reproduce

There are multiple use cases which results in re-subscribing or unsubscribing customer when his account is saved by admin in the backend:

Use case 1

Double opt-in is disabled on Magento side, customer is subscribed on Magento and MailChimp side

  • when I save customer in backend, he stays subscribed, does't get any emails

This one works as expected.

Use case 2

Double opt-in is enabled on Magento side, customer is subscribed on Magento and MailChimp side

  • when I save customer in backend, he becomes unsubscribed in Magento, disappears from MailChimp and gets email to confirm subscription

This is not expected.

Use case 3

Double opt-in is enabled on Magento side, customer is subscribed on MailChimp side, but due to disabled two way sync he is not marked as confirmed in Magento

  • when I save customer in backend, het stays as unsubscribed in Magento, gets unsubscribed from MailChimp and gets email informing that we was unsubscribed

This is not expected.

Use case 4

Double opt-in is enabled on Magento side, customer is subscribed on MailChimp side, but his subscription status was not synchronized by two way sync from MailChimp to Magento yet

  • when I save customer in backend, het stays as unsubscribed in Magento, gets unsubscribed from MailChimp and gets email informing that we was unsubscribed

This is not expected.

Actual and Expected result

Expected result:

Customer subscription status on Magento side and MailChimp side is not changed when I save customer in backend without touching subscription checkbox field

Actual result:

Customer is unsubscribed or re-subscribed on his account save.

Additional information

Issue likely starts with the following code in \Magento\Customer\Controller\Adminhtml\Index\Save::execute file:

            if ($isSubscribed !== null) {
                if ($isSubscribed !== '0') {
                    $this->_subscriberFactory->create()->subscribeCustomerById($customerId);
                } else {
                    $this->_subscriberFactory->create()->unsubscribeCustomerById($customerId);
                }
            }

He gets unsubscribed if his subscription status was not synchronized from MailChimp to Magento yet, or he is re-subscribed in \Ebizmarts\MailChimp\Model\Plugin\Subscriber::beforeSubscribeCustomerById when double opt-in is enabled.

@toddvalentine
Copy link

Any thoughts here?

@sduif
Copy link

sduif commented Nov 6, 2018

These 2 Magento core issues might be related:
magento/magento2#17954
magento/magento2#15218

Both have fixes available that'll be included in future releases of the core. For now these also seem to solve the issues that we are having.

@gonzaloebiz
Copy link
Collaborator

Hi @wojtekn

Use case 2
this is the expected behavior.
If a customer has not responded to the opt-in confirmation email, they will not have much visible information in the Mailchimp App. This is because they are set to pending at the /members endpoint. We confirm this behavior with Mailchimp

Use case 3
Use case 4
If you don't enable the two way sync, this is the expected result

Best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants