Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module option that enables/disables Magento stock newsletter emails #16

Merged
9 commits merged into from
Jan 28, 2021
Prev Previous commit
Next Next commit
Check module status when overwriting Subscriber
  • Loading branch information
tomkabel committed Jan 26, 2021
commit bcb105f5a72d7781edbfe44ad099b64f0df38a98
20 changes: 10 additions & 10 deletions app/code/community/Sendsmaily/Sync/Model/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ class Sendsmaily_Sync_Model_Subscriber extends Mage_Newsletter_Model_Subscriber
{
public function sendConfirmationSuccessEmail()
kaittodesk marked this conversation as resolved.
Show resolved Hide resolved
{
// Send subscription email via Magento.
if (Mage::helper('sync')->magentoNewsletterEmailEnabled()) {
return parent::sendConfirmationSuccessEmail();
}
// Do not send.
return $this;
if ((bool) Mage::getStoreConfig('newsletter/sendsmaily/active') === true && !Mage::helper('sync')->magentoNewsletterEmailEnabled()) {
return $this;
}
// Send subscription email via Magento.
return parent::sendConfirmationSuccessEmail();
}

public function sendUnsubscriptionEmail()
{
// Send unsubscription email via Magento.
if (Mage::helper('sync')->magentoNewsletterEmailEnabled()) {
return parent::sendUnsubscriptionEmail();
}
// Do not send.
return $this;
if ((bool) Mage::getStoreConfig('newsletter/sendsmaily/active') === true && !Mage::helper('sync')->magentoNewsletterEmailEnabled()) {
return $this;
}
// Send unsubscription email via Magento.
return parent::sendUnsubscriptionEmail();
}
}