Skip to content

Commit

Permalink
https://github.com/thehcginstitute-com/m1/issues/590
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed May 2, 2024
1 parent ef634e5 commit e705dc1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions app/code/community/Ebizmarts/MailChimp/Model/ProcessWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e705dc1

Please sign in to comment.