Version Notes
Bugfixing Release
Download this release
Release Info
| Developer | Mathis Klooss |
| Extension | Loewenstark_Newsletter |
| Version | 1.5.0.4 |
| Comparing to | |
| See all releases | |
Code changes from version 1.5.0.3 to 1.5.0.4
app/code/community/Loewenstark/Newsletter/Model/Subscriber.php
CHANGED
|
@@ -18,6 +18,34 @@ class Loewenstark_Newsletter_Model_Subscriber extends Mage_Newsletter_Model_Subs
|
|
| 18 |
/** @var bool $_sendConfirmationRequestEmail check if email already send **/
|
| 19 |
protected $_sendConfirmationRequestEmail = true;
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
/**
|
| 22 |
* Subscribes by email
|
| 23 |
*
|
|
@@ -129,7 +157,8 @@ class Loewenstark_Newsletter_Model_Subscriber extends Mage_Newsletter_Model_Subs
|
|
| 129 |
/**
|
| 130 |
* If subscription status has been changed then send email to the customer
|
| 131 |
*/
|
| 132 |
-
if ($status == self::STATUS_UNCONFIRMED) {
|
|
|
|
| 133 |
$sendInformationEmail = true;
|
| 134 |
}
|
| 135 |
/**
|
| 18 |
/** @var bool $_sendConfirmationRequestEmail check if email already send **/
|
| 19 |
protected $_sendConfirmationRequestEmail = true;
|
| 20 |
|
| 21 |
+
/**
|
| 22 |
+
* Load subscriber info by customer
|
| 23 |
+
*
|
| 24 |
+
* @param Mage_Customer_Model_Customer $customer
|
| 25 |
+
* @return Mage_Newsletter_Model_Subscriber
|
| 26 |
+
*/
|
| 27 |
+
public function loadByCustomer(Mage_Customer_Model_Customer $customer)
|
| 28 |
+
{
|
| 29 |
+
$data = $this->getResource()->loadByCustomer($customer);
|
| 30 |
+
$this->addData($data);
|
| 31 |
+
if (!empty($data) && $customer->getId() && !$this->getCustomerId()) {
|
| 32 |
+
$this->setCustomerId($customer->getId());
|
| 33 |
+
// if code exists use the current code
|
| 34 |
+
$code = $this->getSubscriberConfirmCode();
|
| 35 |
+
if(!$code)
|
| 36 |
+
{
|
| 37 |
+
$code = $this->randomSequence();
|
| 38 |
+
}
|
| 39 |
+
$this->setSubscriberConfirmCode($code);
|
| 40 |
+
if ($this->getStatus()==self::STATUS_NOT_ACTIVE) {
|
| 41 |
+
$this->setStatus($customer->getIsSubscribed() ? self::STATUS_SUBSCRIBED : self::STATUS_UNSUBSCRIBED);
|
| 42 |
+
}
|
| 43 |
+
$this->save();
|
| 44 |
+
}
|
| 45 |
+
return $this;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
|
| 49 |
/**
|
| 50 |
* Subscribes by email
|
| 51 |
*
|
| 157 |
/**
|
| 158 |
* If subscription status has been changed then send email to the customer
|
| 159 |
*/
|
| 160 |
+
if ($status == self::STATUS_UNCONFIRMED || $this->getStatus() == self::STATUS_UNCONFIRMED) {
|
| 161 |
+
$status = self::STATUS_UNCONFIRMED;
|
| 162 |
$sendInformationEmail = true;
|
| 163 |
}
|
| 164 |
/**
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Loewenstark_Newsletter</name>
|
| 4 |
-
<version>1.5.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="https://github.com/mklooss/Loewenstark_Newsletter/blob/master/README.md#licence">GPL-3</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -11,8 +11,8 @@
|
|
| 11 |
<notes>Bugfixing Release</notes>
|
| 12 |
<authors><author><name>Mathis Klooss</name><user>mklooss</user><email>mathis@mage-profis.de</email></author></authors>
|
| 13 |
<date>2015-05-28</date>
|
| 14 |
-
<time>11:
|
| 15 |
-
<contents><target name="magecommunity"><dir name="Loewenstark"><dir name="Newsletter"><dir name="Block"><file name="Resendrequest.php" hash="55df8fe85f36a636b29922df013be7dc"/><file name="Unsubscriber.php" hash="55950d3a63c3b93da9788977d1b27f8a"/></dir><dir name="Helper"><file name="Data.php" hash="8bf03b9b60222ad7d39b28a0b9c6c244"/></dir><dir name="Model"><file name="Subscriber.php" hash="
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.2.12</min><max>7.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Loewenstark_Newsletter</name>
|
| 4 |
+
<version>1.5.0.4</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="https://github.com/mklooss/Loewenstark_Newsletter/blob/master/README.md#licence">GPL-3</license>
|
| 7 |
<channel>community</channel>
|
| 11 |
<notes>Bugfixing Release</notes>
|
| 12 |
<authors><author><name>Mathis Klooss</name><user>mklooss</user><email>mathis@mage-profis.de</email></author></authors>
|
| 13 |
<date>2015-05-28</date>
|
| 14 |
+
<time>11:58:58</time>
|
| 15 |
+
<contents><target name="magecommunity"><dir name="Loewenstark"><dir name="Newsletter"><dir name="Block"><file name="Resendrequest.php" hash="55df8fe85f36a636b29922df013be7dc"/><file name="Unsubscriber.php" hash="55950d3a63c3b93da9788977d1b27f8a"/></dir><dir name="Helper"><file name="Data.php" hash="8bf03b9b60222ad7d39b28a0b9c6c244"/></dir><dir name="Model"><file name="Subscriber.php" hash="0fc1da754314a3c2dbfcbab4bc63d735"/><file name="Unsubscriber.php" hash="8260443fcd10bb81a87f5be72113cf22"/></dir><dir name="controllers"><file name="ManageController.php" hash="aec8e81b3daec859bef2cc497c0af158"/><file name="SubscriberController.php" hash="b7cefefe4c9b9e97135694e8be172a55"/><file name="UnsubscriberController.php" hash="4df867473e0b66c7ca4e737be52741bf"/></dir><dir name="etc"><file name="config.xml" hash="8c72c21bec942ef75a9b021193ace6de"/><file name="system.xml" hash="42d98424453a6163fe8423f30781ec96"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Loewenstark_Newsletter.xml" hash="b1a0188e4caba4de30dfa3d82144bb37"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Loewenstark_Newsletter.csv" hash="0a8a84e326d0cbb6fd8a07892e0f7398"/></dir><dir name="en_US"><file name="Loewenstark_Newsletter.csv" hash="c847bfdc7ab12b9ccb08302482338d4e"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="loewenstark"><file name="newsletter.xml" hash="55163ff7baa8b71647770bc9c9369b38"/></dir></dir><dir name="template"><dir name="newsletter"><file name="unsubscribe.phtml" hash="d0bbd72e2290c1f180b6cbc8c8bef5b2"/><dir name="manage"><file name="resend.phtml" hash="9f658b123e267d4f6f566190bd3cb261"/></dir></dir></dir></dir></dir></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.2.12</min><max>7.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
