Skip to content

Commit

Permalink
add control to use magento emails configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaloebiz authored and maximbaibakov committed Oct 11, 2018
1 parent 6c4a6b9 commit 222ff0f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Model/Plugin/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ public function beforeSubscribeCustomerById(
if($this->_helper->getConfigValue(\Ebizmarts\MailChimp\Helper\Data::XML_PATH_ACTIVE,$subscriber->getStoreId())) {
$subscriber->loadByCustomerId($customerId);
if (!$subscriber->isSubscribed()) {
$subscriber->setImportMode(true);
if (!$this->_helper->getConfigValue(\Ebizmarts\MailChimp\Helper\Data::XML_MAGENTO_MAIL,$subscriber->getStoreId())) {
$subscriber->setImportMode(true);
}
$storeId = $subscriber->getStoreId();
if ($this->_helper->isMailChimpEnabled($storeId)) {
$customer = $this->_customer->getById($customerId);
Expand Down Expand Up @@ -110,7 +112,9 @@ public function beforeSubscribe(
$email
) {
if($this->_helper->getConfigValue(\Ebizmarts\MailChimp\Helper\Data::XML_PATH_ACTIVE,$subscriber->getStoreId())) {
$subscriber->setImportMode(true);
if (!$this->_helper->getConfigValue(\Ebizmarts\MailChimp\Helper\Data::XML_MAGENTO_MAIL,$subscriber->getStoreId())) {
$subscriber->setImportMode(true);
}
$storeId = $this->_storeManager->getStore()->getId();

if ($this->_helper->isMailChimpEnabled($storeId)) {
Expand Down

0 comments on commit 222ff0f

Please sign in to comment.