From e705dc10192782fa3217060c17ff83879a31e5d4 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Thu, 2 May 2024 21:23:35 +0100 Subject: [PATCH] https://github.com/thehcginstitute-com/m1/issues/590 --- .../Ebizmarts/MailChimp/Model/ProcessWebhook.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/code/community/Ebizmarts/MailChimp/Model/ProcessWebhook.php b/app/code/community/Ebizmarts/MailChimp/Model/ProcessWebhook.php index 229375959..b77e91e5b 100644 --- a/app/code/community/Ebizmarts/MailChimp/Model/ProcessWebhook.php +++ b/app/code/community/Ebizmarts/MailChimp/Model/ProcessWebhook.php @@ -13,29 +13,28 @@ function p():void { $collection->addFieldToFilter('processed', array('eq' => 0)); $collection->getSelect()->limit(self::BATCH_LIMIT); foreach ($collection as $webhookRequest) { - $data = hcg_mc_h()->unserialize($webhookRequest->getDataRequest()); - if ($data) { + if ($d = hcg_mc_h()->unserialize($webhookRequest->getDataRequest())) { switch ($webhookRequest->getType()) { case 'profile': $tags = new Tags; - $tags->processMergeFields($data); + $tags->processMergeFields($d); break; case 'subscribe': try { $tags = new Tags; - $tags->processMergeFields($data, true); + $tags->processMergeFields($d, true); } catch (Exception $e) { Mage::logException($e); } break; case 'unsubscribe': - $this->_unsubscribe($data); + $this->_unsubscribe($d); break; case 'cleaned': - $this->_clean($data); + $this->_clean($d); break; case 'upemail': - $this->_updateEmail($data); + $this->_updateEmail($d); } } $this->_saveProcessedWebhook($webhookRequest);