diff --git a/Block/Adminhtml/System/Config/Form/Field/MailchimpMap.php b/Block/Adminhtml/System/Config/Form/Field/MailchimpMap.php
index c123d9e8..40c474ee 100755
--- a/Block/Adminhtml/System/Config/Form/Field/MailchimpMap.php
+++ b/Block/Adminhtml/System/Config/Form/Field/MailchimpMap.php
@@ -79,7 +79,7 @@ protected function _getMailchimpTags()
$ret[$item['tag']] = $item['tag'] . ' (' . $item['name'] . ' : ' . $item['type'] . ')';
}
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
}
return $ret;
diff --git a/Controller/Adminhtml/Ecommerce/GetInterest.php b/Controller/Adminhtml/Ecommerce/GetInterest.php
index 7850f5e8..5e2c3b96 100644
--- a/Controller/Adminhtml/Ecommerce/GetInterest.php
+++ b/Controller/Adminhtml/Ecommerce/GetInterest.php
@@ -73,7 +73,7 @@ public function execute()
if (is_array($result['categories']) && count($result['categories'])) {
$rc = $result['categories'];
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
$error = 1;
}
diff --git a/Controller/Adminhtml/Ecommerce/Getaccountdetails.php b/Controller/Adminhtml/Ecommerce/Getaccountdetails.php
index b75b451e..73fc66e2 100644
--- a/Controller/Adminhtml/Ecommerce/Getaccountdetails.php
+++ b/Controller/Adminhtml/Ecommerce/Getaccountdetails.php
@@ -86,7 +86,7 @@ public function execute()
$options['nostore'] = ['label' => __('Ecommerce disabled, only subscribers will be synchronized (your orders, products,etc will be not synchronized)'), 'value' => ''];
}
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
$options['error'] = ['label' => 'Error', 'value' => __('--- Invalid API Key ---')];
}
diff --git a/Controller/Adminhtml/Lists/Get.php b/Controller/Adminhtml/Lists/Get.php
index 8d2f73a6..8cbc7c4a 100644
--- a/Controller/Adminhtml/Lists/Get.php
+++ b/Controller/Adminhtml/Lists/Get.php
@@ -44,7 +44,7 @@ public function __construct(
\Ebizmarts\MailChimp\Helper\Data $helper,
\Magento\Framework\Encryption\Encryptor $encryptor
) {
-
+
parent::__construct($context);
$this->_resultFactory = $context->getResultFactory();
$this->_helper = $helper;
@@ -62,7 +62,7 @@ public function execute()
$result['lists'][] = ['id' => $list['id'], 'name' => $list['name']];
}
$result['valid'] = 1;
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$result['valid'] = 0;
$result['errormsg'] = $e->getTitle();
$this->_helper->log($e->getFriendlyMessage());
diff --git a/Controller/Adminhtml/Stores/Delete.php b/Controller/Adminhtml/Stores/Delete.php
index b325b3e1..ec470d21 100644
--- a/Controller/Adminhtml/Stores/Delete.php
+++ b/Controller/Adminhtml/Stores/Delete.php
@@ -27,7 +27,7 @@ public function execute()
$api->ecommerce->stores->delete($storeModel->getStoreid());
$this->messageManager->addSuccess(__('You deleted the store.'));
return $resultRedirect->setPath('mailchimp/stores');
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->messageManager->addError(__('Store could not be deleted.'.$e->getMessage()));
$this->_mhelper->log($e->getFriendlyMessage());
return $resultRedirect->setPath('mailchimp/stores/edit', ['id'=>$storeId]);
diff --git a/Controller/Adminhtml/Stores/Get.php b/Controller/Adminhtml/Stores/Get.php
index 3716546a..e3efa417 100644
--- a/Controller/Adminhtml/Stores/Get.php
+++ b/Controller/Adminhtml/Stores/Get.php
@@ -69,7 +69,7 @@ public function execute()
$result['valid'] = 1;
}
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_mhelper->log($e->getFriendlyMessage());
$result['valid'] = 0;
$result['errormsg'] = $e->getTitle();
diff --git a/Controller/Adminhtml/Stores/Save.php b/Controller/Adminhtml/Stores/Save.php
index 5e67c32c..19cbc803 100644
--- a/Controller/Adminhtml/Stores/Save.php
+++ b/Controller/Adminhtml/Stores/Save.php
@@ -40,7 +40,7 @@ public function execute()
} else {
return $resultRedirect->setPath('mailchimp/stores');
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->messageManager->addErrorMessage(__('Store could not be saved.'.$e->getMessage()));
$this->_mhelper->log($e->getFriendlyMessage());
return $resultRedirect->setPath('mailchimp/stores/edit', ['id'=>$storeId]);
diff --git a/Cron/Ecommerce.php b/Cron/Ecommerce.php
index 7a3b096c..d45fb120 100644
--- a/Cron/Ecommerce.php
+++ b/Cron/Ecommerce.php
@@ -282,7 +282,7 @@ protected function _processStore($storeId, $mailchimpStoreId, $listId)
$this->markWithError($BadOperations, $mailchimpStoreId, $listId);
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
} catch (\Exception $e) {
$this->_helper->log($e->getMessage());
@@ -340,7 +340,7 @@ protected function apiUpdateSyncFlag($storeId, $mailchimpStoreId)
null,
false
);
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log('MailChimp error when updating syncing flag for store ' . $storeId);
$this->_helper->log($e->getFriendlyMessage());
}
@@ -350,7 +350,7 @@ protected function _ping($storeId)
try {
$api = $this->_helper->getApi($storeId);
$api->root->info();
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
return false;
}
diff --git a/Cron/GenerateStatistics.php b/Cron/GenerateStatistics.php
index f0797ace..e34ed1d4 100644
--- a/Cron/GenerateStatistics.php
+++ b/Cron/GenerateStatistics.php
@@ -8,7 +8,6 @@
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory as ProductCollectionFactory;
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory as OrderCollectionFactory;
use Magento\Cron\Model\ResourceModel\Schedule\CollectionFactory as ScheduleCollectionFactory;
-use Ebizmarts\MailChimp\Model\MailchimpNotificationFactory as MailchimpNotificationFactory;
use Magento\Framework\App\ProductMetadataInterface;
use Ebizmarts\MailChimp\Helper\Data;
use Ebizmarts\MailChimp\Model\ResourceModel\MailChimpSyncBatches\CollectionFactory as MailChimpSyncBatchesCollectionFactory;
@@ -16,10 +15,6 @@
class GenerateStatistics
{
- /**
- * @var MailchimpNotificationFactory
- */
- protected $mailchimpNotificationFactory;
/**
* @var Data
*/
@@ -56,13 +51,15 @@ class GenerateStatistics
* @var ModuleVersion
*/
protected $moduleVersion;
+ /**
+ * @var TimezoneInterface
+ */
protected $locale;
protected $deleteAction = [
0 => 'Unsubscribe',
1 => 'Delete',
];
public function __construct(
- MailchimpNotificationFactory $mailchimpNotificationFactory,
Data $helper,
StoreManager $storeManager,
CustomerCollectionFactory $customerCollectionFactory,
@@ -75,7 +72,6 @@ public function __construct(
TimezoneInterface $locale
)
{
- $this->mailchimpNotificationFactory = $mailchimpNotificationFactory;
$this->helper = $helper;
$this->storeManager = $storeManager;
$this->customerCollectionFactory = $customerCollectionFactory;
@@ -104,10 +100,7 @@ public function execute()
}
$data['jobs'] = $this->getJobs();
if (!empty($data)) {
- $mailchimpNotification = $this->mailchimpNotificationFactory->create();
- $mailchimpNotification->setNotificationData(json_encode($data));
- $mailchimpNotification->setProcessed(false);
- $mailchimpNotification->getResource()->save($mailchimpNotification);
+ $this->helper->saveNotification($data);
}
}
private function getMagentoTotals($storeId)
diff --git a/Cron/SyncStatistics.php b/Cron/SyncStatistics.php
index 5e2b306d..a89c69d0 100644
--- a/Cron/SyncStatistics.php
+++ b/Cron/SyncStatistics.php
@@ -69,6 +69,7 @@ private function cleanData()
$connection = $this->mailchimpNotification->getConnection();
$tableName = $this->mailchimpNotification->getMainTable();
$connection->delete($tableName, ['date_add(generated_at , interval 1 week) <= NOW()']);
+ $connection->delete($tableName, ['processed' => 1]);
} catch (\Exception $e) {
$this->helper->log($e->getMessage());
}
diff --git a/Cron/Webhook.php b/Cron/Webhook.php
index d2fe8123..0b5432df 100644
--- a/Cron/Webhook.php
+++ b/Cron/Webhook.php
@@ -258,7 +258,7 @@ protected function _profile($data)
$this->_subscribeMember($subscriber, \Magento\Newsletter\Model\Subscriber::STATUS_UNSUBSCRIBED);
}
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
}
}
diff --git a/Helper/Data.php b/Helper/Data.php
index 4c0d8a3e..3a334427 100755
--- a/Helper/Data.php
+++ b/Helper/Data.php
@@ -15,6 +15,7 @@
use Magento\Framework\Exception\ValidatorException;
use Magento\Store\Model\Store;
use Symfony\Component\Config\Definition\Exception\Exception;
+use Ebizmarts\MailChimp\Model\MailchimpNotificationFactory as MailchimpNotificationFactory;
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
@@ -194,6 +195,11 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
/**
* @var \Magento\Framework\Locale\Resolver
*/
+ /**
+ * @var MailchimpNotificationFactory
+ */
+ protected $mailchimpNotificationFactory;
+
protected $resolver;
private $customerAtt = null;
private $addressAtt = null;
@@ -223,6 +229,7 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
* @param \Magento\Framework\Stdlib\DateTime\DateTime $date
* @param \Magento\Directory\Model\CountryFactory $countryFactory
* @param \Magento\Framework\Locale\Resolver $resolver
+ * @param MailchimpNotificationFactory $mailchimpNotificationFactory
*/
public function __construct(
\Magento\Framework\App\Helper\Context $context,
@@ -247,7 +254,8 @@ public function __construct(
\Magento\Framework\App\DeploymentConfig $deploymentConfig,
\Magento\Framework\Stdlib\DateTime\DateTime $date,
\Magento\Directory\Model\CountryFactory $countryFactory,
- \Magento\Framework\Locale\Resolver $resolver
+ \Magento\Framework\Locale\Resolver $resolver,
+ MailchimpNotificationFactory $mailchimpNotificationFactory
) {
$this->_storeManager = $storeManager;
@@ -274,6 +282,7 @@ public function __construct(
$this->_date = $date;
$this->countryFactory = $countryFactory;
$this->resolver = $resolver;
+ $this->mailchimpNotificationFactory = $mailchimpNotificationFactory;
parent::__construct($context);
}
@@ -321,6 +330,7 @@ public function getApi($store = null, $scope = null)
$apiKey = $this->getApiKey($store, $scope);
$timeOut = $this->getTimeOut($store,$scope);
$this->_api->setApiKey($apiKey);
+ $this->_api->setHelper($this);
$this->_api->setUserAgent('Mailchimp4Magento' . (string)$this->getModuleVersion());
if ($timeOut) {
$this->_api->setTimeOut($timeOut);
@@ -452,6 +462,8 @@ public function getApiByApiKey($apiKey, $encrypted = false)
$this->_api->setApiKey($apiKey);
}
$this->_api->setUserAgent('Mailchimp4Magento' . (string)$this->getModuleVersion());
+ $this->_api->setHelper($this);
+
return $this->_api;
}
@@ -553,7 +565,14 @@ public function log($message, $store = null, $file = null)
$this->_mlogger->mailchimpLog($message, $file);
}
}
+ public function saveNotification($data)
+ {
+ $mailchimpNotification = $this->mailchimpNotificationFactory->create();
+ $mailchimpNotification->setNotificationData(json_encode($data));
+ $mailchimpNotification->setProcessed(false);
+ $mailchimpNotification->getResource()->save($mailchimpNotification);
+ }
/**
* @return string
* @throws \Magento\Framework\Exception\LocalizedException
@@ -573,7 +592,7 @@ public function deleteStore($mailchimpStore)
// $storeId = $this->getConfigValue(self::XML_MAILCHIMP_STORE);
$this->getApi()->ecommerce->stores->delete($mailchimpStore);
$this->cancelAllPendingBatches($mailchimpStore);
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->log($e->getFriendlyMessage());
} catch (Exception $e) {
$this->log($e->getMessage());
@@ -774,7 +793,7 @@ public function getListForMailChimpStore($mailchimpStoreId, $apiKey)
if (isset($store['list_id'])) {
return $store['list_id'];
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->log($e->getFriendlyMessage());
}
return null;
@@ -804,14 +823,13 @@ public function loadStores()
}
$this->_api->setApiKey(trim($apiKey));
$this->_api->setUserAgent('Mailchimp4Magento' . (string)$this->getModuleVersion());
+ $this->_api->setHelper($this);
+
try {
$apiStores = $this->_api->ecommerce->stores->get(null, null, null, self::MAXSTORES);
- } catch (\Mailchimp_Error $mailchimpError) {
- $this->log($mailchimpError->getFriendlyMessage());
- continue;
- } catch (\Mailchimp_HttpError $mailchimpError) {
- $this->log($mailchimpError->getMessage());
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
+ $this->log($e->getFriendlyMessage());
continue;
}
@@ -857,7 +875,7 @@ public function loadStores()
$mstore->setMcAccountName($mcUserName[$apiKey]);
$mstore->getResource()->save($mstore);
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->log($e->getFriendlyMessage());
}
}
@@ -881,7 +899,7 @@ public function saveJsUrl($storeId, $scope = null, $mailChimpStoreId = null)
$storeId
);
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->log($e->getFriendlyMessage());
}
}
@@ -904,7 +922,7 @@ public function getJsUrl($storeId)
$storeId
);
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->log($e->getFriendlyMessage());
}
}
@@ -944,7 +962,7 @@ public function createWebHook($apikey, $listId, $scope=null, $scopeId=null)
'_secure' => true]);
// the urlencode of the hookUrl not work
$ret = $api->lists->webhooks->add($listId, $hookUrl, $events, $sources);
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->log($e->getFriendlyMessage());
$ret ['message']= $e->getMessage();
}
@@ -968,7 +986,7 @@ public function deleteWebHook($apikey, $listId)
}
}
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->log($e->getFriendlyMessage());
}
}
@@ -1075,7 +1093,7 @@ public function getInterest($storeId)
$this->log(__('Error retrieving interest groups for store ').$storeId);
$rc = [];
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->log($e->getFriendlyMessage());
}
return $rc;
diff --git a/Model/Api/PromoRules.php b/Model/Api/PromoRules.php
index 72ebf0e6..e0b2e5af 100644
--- a/Model/Api/PromoRules.php
+++ b/Model/Api/PromoRules.php
@@ -121,7 +121,7 @@ protected function _getDeletedPromoRules($mailchimpStoreId, $magentoStoreId)
$batchArray[$count]['path'] = "/ecommerce/stores/$mailchimpStoreId/promo-rules/$ruleId";
$batchArray[$count]['operation_id'] = $this->_batchId . '_' . $ruleId;
$count++;
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
}
$this->syncHelper->ecommerceDeleteAllByIdType(
diff --git a/Model/Api/Result.php b/Model/Api/Result.php
index 77f92d61..299826b1 100644
--- a/Model/Api/Result.php
+++ b/Model/Api/Result.php
@@ -176,7 +176,7 @@ public function getBatchResponse($batchId, $storeId = null)
self::MAILCHIMP_TEMP_DIR . DIRECTORY_SEPARATOR . $batchId . '/' . $batchId . '.tar');
$this->_driver->deleteFile($fileName . '.tar.gz');
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
return false;
} catch (\Exception $e) {
diff --git a/Model/Api/Subscriber.php b/Model/Api/Subscriber.php
index 530335fd..aed30fcb 100644
--- a/Model/Api/Subscriber.php
+++ b/Model/Api/Subscriber.php
@@ -186,7 +186,7 @@ public function deleteSubscriber(\Magento\Newsletter\Model\Subscriber $subscribe
try {
$md5HashEmail = hash('md5', strtolower($subscriber->getSubscriberEmail()));
$api->lists->members->update($listId, $md5HashEmail, null, 'cleaned');
- } catch (\MailChimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage(), $storeId);
$this->_message->addErrorMessage($e->getMessage());
} catch (\Exception $e) {
diff --git a/Model/Config/Backend/MonkeyStore.php b/Model/Config/Backend/MonkeyStore.php
index a185729f..a2bd8368 100644
--- a/Model/Config/Backend/MonkeyStore.php
+++ b/Model/Config/Backend/MonkeyStore.php
@@ -155,7 +155,7 @@ private function getStore($apiKey, $store)
$api = $this->_helper->getApiByApiKey($apiKey);
$store = $api->ecommerce->stores->get($store);
return $store['list_id'];
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
}
return null;
diff --git a/Model/Config/Source/Details.php b/Model/Config/Source/Details.php
index e7e0273f..832a807d 100644
--- a/Model/Config/Source/Details.php
+++ b/Model/Config/Source/Details.php
@@ -99,7 +99,7 @@ public function __construct(
} else {
$this->_options['store_exists'] = false;
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
$this->_error = $e->getMessage();
$this->_options['store_exists'] = false;
diff --git a/Model/Config/Source/Interest.php b/Model/Config/Source/Interest.php
index 92c603d8..b39193d0 100644
--- a/Model/Config/Source/Interest.php
+++ b/Model/Config/Source/Interest.php
@@ -26,7 +26,7 @@ public function __construct(
\Ebizmarts\MailChimp\Helper\Data $helper,
\Magento\Framework\App\RequestInterface $request
) {
-
+
$storeId = (int) $request->getParam("store", 0);
if ($request->getParam('website', 0)) {
$scope = 'website';
@@ -45,7 +45,7 @@ public function __construct(
null,
200
);
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$helper->log($e->getFriendlyMessage());
}
}
diff --git a/Model/Config/Source/MonkeyList.php b/Model/Config/Source/MonkeyList.php
index 08798e0f..d709bdfe 100644
--- a/Model/Config/Source/MonkeyList.php
+++ b/Model/Config/Source/MonkeyList.php
@@ -42,7 +42,7 @@ public function __construct(
$this->options = $helper->getApi($storeId, $scope)->lists->getLists(
$helper->getConfigValue(\Ebizmarts\MailChimp\Helper\Data::XML_PATH_LIST, $storeId, $scope)
);
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$helper->log($e->getFriendlyMessage());
}
}
diff --git a/Model/Config/Source/MonkeyStore.php b/Model/Config/Source/MonkeyStore.php
index 2a77ab1c..a1920816 100644
--- a/Model/Config/Source/MonkeyStore.php
+++ b/Model/Config/Source/MonkeyStore.php
@@ -44,7 +44,7 @@ public function __construct(
null,
\Ebizmarts\MailChimp\Helper\Data::MAXSTORES
);
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$helper->log($e->getFriendlyMessage());
}
}
diff --git a/Model/Plugin/Subscriber.php b/Model/Plugin/Subscriber.php
index a8f2c7b1..60024204 100644
--- a/Model/Plugin/Subscriber.php
+++ b/Model/Plugin/Subscriber.php
@@ -33,7 +33,7 @@ public function __construct(
\Ebizmarts\MailChimp\Helper\Data $helper,
\Magento\Store\Model\StoreManagerInterface $storeManager
) {
-
+
$this->_helper = $helper;
$this->_storeManager = $storeManager;
}
@@ -63,7 +63,7 @@ public function afterDelete(
} else {
$api->lists->members->delete($this->_helper->getDefaultList($storeId), $md5HashEmail);
}
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
}
}
@@ -103,7 +103,7 @@ public function afterLoadBySubscriberEmail(\Magento\Newsletter\Model\Subscriber
return $subscriber;
}
-
+
/**
* @param \Magento\Newsletter\Model\Subscriber $subscriber
* @param $customerId
diff --git a/Model/Plugin/SubscriptionManager.php b/Model/Plugin/SubscriptionManager.php
index 21825f50..374ff648 100644
--- a/Model/Plugin/SubscriptionManager.php
+++ b/Model/Plugin/SubscriptionManager.php
@@ -84,7 +84,7 @@ public function beforeUnsubscribeCustomer(
null,
'unsubscribed'
);
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
}
}
@@ -136,7 +136,7 @@ public function beforeSubscribeCustomer(
$email,
$status
);
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
}
}
@@ -185,7 +185,7 @@ public function beforeSubscribe(
$email,
$status
);
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
}
}
@@ -214,7 +214,7 @@ public function beforeUnsubscribe(
null,
'unsubscribed'
);
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
}
}
diff --git a/Observer/Subscriber/SaveAfter.php b/Observer/Subscriber/SaveAfter.php
index c0b29452..9eecd32c 100644
--- a/Observer/Subscriber/SaveAfter.php
+++ b/Observer/Subscriber/SaveAfter.php
@@ -92,7 +92,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
$subscriberOld->getEmail(),
$status
);
- } catch (\Mailchimp_Error $e) {
+ } catch (\Mailchimp_Error | \Mailchimp_HttpError $e) {
$this->_helper->log($e->getFriendlyMessage());
}
diff --git a/etc/crontab.xml b/etc/crontab.xml
index 7bdad94a..67d78f7c 100644
--- a/etc/crontab.xml
+++ b/etc/crontab.xml
@@ -30,7 +30,7 @@
0 * * * *
- */5 * * * *
+ * */12 * * *
0 */6 * * *