Skip to content

Commit a5ad64b

Browse files
authored
Merge pull request #2168 from namluu/develop-2.4
Add config checking
2 parents f7f9f3a + f20951b commit a5ad64b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Model/Plugin/Subscriber.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,17 @@ public function afterLoadBySubscriberEmail(\Magento\Newsletter\Model\Subscriber
112112
*/
113113
public function afterLoadByCustomer(\Magento\Newsletter\Model\Subscriber $subscriber, $customerId, $websiteId)
114114
{
115-
try {
116-
if (!$this->_helper->getConfigValue(
117-
\Ebizmarts\MailChimp\Helper\Data::XML_MAGENTO_MAIL,
118-
$subscriber->getStoreId()
119-
)) {
120-
$subscriber->setImportMode(true);
115+
if ($this->_helper->isMailChimpEnabled($subscriber->getStoreId())) {
116+
try {
117+
if (!$this->_helper->getConfigValue(
118+
\Ebizmarts\MailChimp\Helper\Data::XML_MAGENTO_MAIL,
119+
$subscriber->getStoreId()
120+
)) {
121+
$subscriber->setImportMode(true);
122+
}
123+
} catch (\Exception $exception) {
124+
$this->_helper->log($exception->getMessage());
121125
}
122-
} catch (\Exception $exception) {
123-
$this->_helper->log($exception->getMessage());
124126
}
125127

126128
return $subscriber;

0 commit comments

Comments
 (0)