Git Product home page Git Product logo

Comments (10)

eghanin avatar eghanin commented on September 26, 2024

thank you @yohanespradono
did you experience it with 1.0.12 ?

thanks
Guy

from 3rd-party-integrations-magento-m2.

yohanespradono avatar yohanespradono commented on September 26, 2024

@eghanin yes, i also upgraded to 1.0.13 but still happens. I turned off realtime sync, and processed the particular customer (using like $customerRepo->save($customer)) and everything went through. then i turned on realtime sync, and the problem is still fixed for this customer because the API response $response['data'] is empty now.

I can't find the API response log.
Maybe $response['data']['current_value'] returned 2 and the code set
$statusToBeChanged = \Magento\Newsletter\Model\Subscriber::STATUS_UNSUBSCRIBED;
to 3

That's why $emarsysOptinValue != $magentoOptinValue to return true?

                    if ($emarsysOptinValue == 1) {
                        $statusToBeChanged = \Magento\Newsletter\Model\Subscriber::STATUS_SUBSCRIBED;
                    } elseif ($emarsysOptinValue == 2) {
                        $statusToBeChanged = \Magento\Newsletter\Model\Subscriber::STATUS_UNSUBSCRIBED;
                    } else {
                        $statusToBeChanged = \Magento\Newsletter\Model\Subscriber::STATUS_UNSUBSCRIBED;
                    }

from 3rd-party-integrations-magento-m2.

yohanespradono avatar yohanespradono commented on September 26, 2024

OK i can reproduce this issue.
I made a change for this customer subscription from emarsys dashboard,
and now the API responses:

array(3) {
  ["replyCode"]=>
  int(0)
  ["replyText"]=>
  string(2) "OK"
  ["data"]=>
  array(3) {
    ["old_value"]=>
    string(1) "1"
    ["current_value"]=>
    string(1) "2"
    ["time"]=>
    string(19) "2017-10-30 04:17:13"
  }
}

As i have guessed, because time (2017-10-30 04:17:13) > magento $magentoOptinChangeTime (null)
returns true and current_value (2) != magento value (3) returns true,
this causes the loop

Maybe we need to refactor this part

if ((($EmarsysOptinChangeTime == $magentoOptinChangeTime && self::OPTIN_PRIORITY =='Emarsys') || ($EmarsysOptinChangeTime >= $magentoOptinChangeTime)) && $emarsysOptinValue != $magentoOptinValue) {

from 3rd-party-integrations-magento-m2.

eghanin avatar eghanin commented on September 26, 2024

Thanks so much, we're going to look into this as soon as we can.
SO to summarise what you're experiencing.

If there is a change in emarsys side ( e.g. customer optin value changed, and is picked up by the optin sync back ). and in Magento the time of change is NULL, then the synchronisation is getting to a loop.

Is that a correct description ?

we will keep you posted here. and eventually suggest a patch for it.

from 3rd-party-integrations-magento-m2.

yohanespradono avatar yohanespradono commented on September 26, 2024

@eghanin exactly! i mean, from subscribe (value 1) to unsubscribe (value 2, from emarsys side) while subscribe status on magento is 3

from 3rd-party-integrations-magento-m2.

romastepa avatar romastepa commented on September 26, 2024

hello @yohanespradono, did you save mapping for customer? I've tried to reproduce this, but without luck.

from 3rd-party-integrations-magento-m2.

yohanespradono avatar yohanespradono commented on September 26, 2024

@romastepa i didn't. But i have Unique Field set to Email.

from 3rd-party-integrations-magento-m2.

romastepa avatar romastepa commented on September 26, 2024

@yohanespradono can you, plz, save mapping first (in admin Emarsys->Mappings->Customers for your store Update Schema -> Recommend Mapping) and try one more time.

from 3rd-party-integrations-magento-m2.

yohanespradono avatar yohanespradono commented on September 26, 2024

Hi @romastepa , sorry we already set this up. I just didn't remember it.

image

from 3rd-party-integrations-magento-m2.

peterlembke avatar peterlembke commented on September 26, 2024

We suffer this problem too.
System: Magento 2.2.6 , Emarsys 1.0.12
In Magento 2.1.10 with Emarsys 1.0.12 we do not have this problem.

Every hour three accounts are registered in table newsletter_subscriber.
in Emarsys admin we updated schemas and saved mappings in each store. Then the issue was gone.

I registered a new account and now that account are registered every hour.

I tried to:
update newsletter_subscriber set change_status_at = "2018-05-01 01:01:01" where change_status_at is NULL;
I had 22000 items that was NULL. But that made no difference. The issue still happens for the new account.

We can not go live with Magento 2.2.6 until this issue is fixed.
Any tips what I can do?

from 3rd-party-integrations-magento-m2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.