Conlabz_CrConnect - Version 3.0.2

Version Notes

Update customer info on CR after customer edit

Download this release

Release Info

Developer Conlabz GmbH
Extension Conlabz_CrConnect
Version 3.0.2
Comparing to
See all releases


Code changes from version 3.0.1 to 3.0.2

app/code/community/Conlabz/CrConnect/Model/Api.php CHANGED
@@ -75,6 +75,34 @@ class Conlabz_CrConnect_Model_Api extends Mage_Core_Model_Abstract {
75
  return false;
76
  }
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  public function unsubscribe($email = false, $groupId = 0) {
79
 
80
  if ($this->isConnected() && $email){
@@ -137,6 +165,20 @@ class Conlabz_CrConnect_Model_Api extends Mage_Core_Model_Abstract {
137
 
138
  }
139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  /*
141
  * Deactivates a given receiver/email
142
  */
75
  return false;
76
  }
77
 
78
+ public function update($customer = false, $groupId = 0){
79
+
80
+ if ($this->isConnected()){
81
+
82
+ if (!$customer) {
83
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
84
+ }
85
+ $crReceiver = $this->_helper->prepareUserdata($customer);
86
+ $updateResult = $this->receiverUpdate($crReceiver, $customer->getGroupId());
87
+ if ($updateResult->status == self::SUCCESS_STATUS) {
88
+
89
+ $this->_helper->log($this->_helper->__("CALL: receiverUpdate - SUCCESS"));
90
+ $this->_helper->log($crReceiver);
91
+ $this->_helper->log("receiverUpdate: GroupId: ".$customer->getGroupId());
92
+
93
+ return true;
94
+ } else {
95
+
96
+ $this->_helper->log($this->_helper->__("CALL: receiverUpdate - FAIL"));
97
+
98
+ }
99
+ return true;
100
+
101
+ }
102
+ return false;
103
+
104
+ }
105
+
106
  public function unsubscribe($email = false, $groupId = 0) {
107
 
108
  if ($this->isConnected() && $email){
165
 
166
  }
167
 
168
+ /*
169
+ * Update simple user
170
+ */
171
+ public function receiverUpdate($customerData, $groupId = 0) {
172
+
173
+ $listId = $this->getGroupKey($groupId);
174
+
175
+ $this->_helper->log("CALL: receiverAdd");
176
+ $this->_helper->log($customerData);
177
+
178
+ return $this->_client->receiverAdd($this->_apiKey, $listId, $customerData);
179
+
180
+ }
181
+
182
  /*
183
  * Deactivates a given receiver/email
184
  */
app/code/community/Conlabz/CrConnect/Model/Observer.php CHANGED
@@ -21,6 +21,9 @@ class Conlabz_CrConnect_Model_Observer{
21
  $customer = $observer->getCustomer();
22
 
23
  $email = $customer->getEmail();
 
 
 
24
  $subscriber = Mage::getModel("newsletter/subscriber")->loadByEmail($email);
25
  $subscriber->setEmail($email);
26
  if (Mage::app()->getStore()->isAdmin()){
21
  $customer = $observer->getCustomer();
22
 
23
  $email = $customer->getEmail();
24
+
25
+ Mage::getModel("crconnect/subscriber")->updateCustomer($customer);
26
+
27
  $subscriber = Mage::getModel("newsletter/subscriber")->loadByEmail($email);
28
  $subscriber->setEmail($email);
29
  if (Mage::app()->getStore()->isAdmin()){
app/code/community/Conlabz/CrConnect/Model/Subscriber.php CHANGED
@@ -29,4 +29,10 @@ class Conlabz_CrConnect_Model_Subscriber extends Mage_Core_Model_Abstract {
29
 
30
  }
31
 
 
 
 
 
 
 
32
  }
29
 
30
  }
31
 
32
+ public function updateCustomer($customer, $groupId = 0){
33
+
34
+ return Mage::getModel("crconnect/api")->update($customer, $groupId);
35
+
36
+ }
37
+
38
  }
app/code/community/Conlabz/CrConnect/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Conlabz_CrConnect>
5
- <version>3.0.1</version>
6
  </Conlabz_CrConnect>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Conlabz_CrConnect>
5
+ <version>3.0.2</version>
6
  </Conlabz_CrConnect>
7
  </modules>
8
  <global>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Conlabz_CrConnect</name>
4
- <version>3.0.1</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License</license>
7
  <channel>community</channel>
@@ -18,11 +18,11 @@ To setup the synchronization, all you need is your CleverReach API key and the r
18
  Once set up, the Extension will handle subscriptions and unsubscribe requests. Users can unsubscribe themselves in Magento or in CleverReach. CleverReach Connect will track users who have followed the links in your email campaign. When a user completes a purchase, the plugin will quietly send the basic details of the order back to your reporting dashboard in the CleverReach tool. Thus you will be able to analyse conversions which originated from your mailings.&#xD;
19
  &#xD;
20
  Please note that subscribers imported form an order won't have the "receive newsletter" flag set to 1.</description>
21
- <notes>Added German translations for new version</notes>
22
  <authors><author><name>conlabz GmbH</name><user>conlabz</user><email>info@conlabz.de</email></author></authors>
23
- <date>2014-08-08</date>
24
- <time>14:53:19</time>
25
- <contents><target name="magecommunity"><dir name="Conlabz"><dir name="CrConnect"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Newsletter.php" hash="0354815224028e6fc90671a61abb2232"/></dir></dir></dir><dir name="Newsletter"><file name="Subscriber.php" hash="9eaf627b6255229e1861208dd1b9a280"/></dir></dir><dir name="Config"><file name="GroupsApis.php" hash="6ecac377484995a89c7718a015f74a89"/><file name="Key.php" hash="42f31c0d35632948a702106540d5e85b"/><file name="Url.php" hash="f330f299b19ed1b266ec6a3eb5d31fa1"/></dir><dir name="Customer"><file name="Newsletter.php" hash="f645682ece7817b4386538026fa580dc"/></dir><file name="Groupsapis.php" hash="cecd60a67b2e72effd2bc7ac1e1fdc58"/></dir><dir name="Helper"><file name="Data.php" hash="293591f9f29cf83d777454c4f0eed40e"/></dir><dir name="Model"><file name="Api.php" hash="081ceb06ae487bdd87976e0c0d256697"/><dir name="Checkout"><file name="Observer.php" hash="cf99d26d4d85c3106d480b035b98287f"/></dir><dir name="Customer"><file name="Observer.php" hash="6dd8ed2fc9c3dd0e5a2771fb1857ec81"/></dir><dir name="Newsletter"><file name="Subscriber.php" hash="51cb181afbd60baaadd5ed4385497763"/></dir><file name="Observer.php" hash="e133718d99e3a1cff0e87ef1014f22ca"/><file name="Search.php" hash="e2bcaa4e316d028141075cbd0c964e67"/><file name="Subscriber.php" hash="8de289c183682e8ca378a9079698b926"/><dir name="System"><dir name="Config"><dir name="Source"><file name="EmptyForms.php" hash="feb6f16d6b26e0cdaedb06bc68ce1c63"/><file name="EmptyList.php" hash="8f3f19184a183b1f5dce98d70608bcb1"/></dir></dir></dir><dir name="Website"><file name="Observer.php" hash="db48be43fed458ed4169771a55cf2288"/></dir></dir><dir name="controllers"><file name="AccountController.php" hash="009b2b88f4d9a5daeb050ce617d677b6"/><dir name="Adminhtml"><file name="ConfigController.php" hash="d5a14810dea4a39e593f963119fca26e"/><file name="CrconnectController.php" hash="07e1950ceb80342fc006ea00db084596"/></dir><file name="HookController.php" hash="3235db4d5ecf422ff9d58771af94fca5"/><file name="ManageController.php" hash="739fdf9934ca2665b9ffdf43edbef733"/><file name="SearchController.php" hash="2f7947cf6774a6874c815f71d3468152"/><file name="SubscriberController.php" hash="9cd8eb59c885b6f0b9133c0a1271bbe9"/><file name="UnsubscribeController.php" hash="357908ed531f29de19b7ddbb549ed4e4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="00bab70876fc5def3883b74cb1da413c"/><file name="config.xml" hash="80648f474108cc4c710d7ebf024a29ca"/><file name="system.xml" hash="9f5c8170faedd86fcc35df4be9dc93b9"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="crconnect"><dir name="config"><file name="header.phtml" hash="727bc6a2a9b67c1e5819faa91c06ffd3"/></dir><dir name="newsletter"><dir name="subscriber"><file name="list.phtml" hash="94952fb1921397c4ad33387d8387c463"/></dir></dir><dir name="system"><dir name="config"><dir name="form"><dir name="field"><file name="array_groups.phtml" hash="ac84db9b1e8b342337a478ecba62e0b1"/><file name="cr_array_groups.phtml" hash="d2f70aa406d8b15f819481acbf0ccbee"/></dir></dir></dir></dir></dir></dir><dir name="layout"><file name="crconnect.xml" hash="1185a92ac6c2117d5e440f709d0eca24"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="crconnect.xml" hash="956fea6e3eb0e98fc6bbcc7241f9123e"/></dir><dir name="template"><dir name="crconnect"><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="a533451e27b90284d3414e391b460231"/></dir></dir><dir name="form"><file name="newsletter.phtml" hash="4a1309d0d6d2587c8534dd4a1ccdf235"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Conlabz_CrConnect.xml" hash="282358cc102bf617b7d5afcaa47ec489"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Conlabz_CleverReach.csv" hash="22f87461d771b644cb0ac3dc2cc78118"/></dir><dir name="en_US"><file name="Conlabz_CleverReach.csv" hash="7d6b2f9b03bcba2abf2c5eacdd2192e1"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="images"><dir name="cleverreach"><file name="cleverreach-logo.png" hash="bff60f831ca9e1dc9bcbdb2e3f5a5805"/></dir></dir><dir name="js"><file name="crconnect.js" hash="72c951b0b46862253c7159255d82b2e0"/></dir></dir></dir></dir></target><target name="mage"><dir name="."><file name="CleverReachDocumentation.docx" hash="571866f1b26b6c1ba5881644b2ecf9db"/><file name="CleverReachDocumentationGerman.docx" hash="ed975c640c6fd92115505f0790ba6231"/></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.13</min><max>5.4.0</max></php></required></dependencies>
28
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Conlabz_CrConnect</name>
4
+ <version>3.0.2</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License</license>
7
  <channel>community</channel>
18
  Once set up, the Extension will handle subscriptions and unsubscribe requests. Users can unsubscribe themselves in Magento or in CleverReach. CleverReach Connect will track users who have followed the links in your email campaign. When a user completes a purchase, the plugin will quietly send the basic details of the order back to your reporting dashboard in the CleverReach tool. Thus you will be able to analyse conversions which originated from your mailings.&#xD;
19
  &#xD;
20
  Please note that subscribers imported form an order won't have the "receive newsletter" flag set to 1.</description>
21
+ <notes>Update customer info on CR after customer edit</notes>
22
  <authors><author><name>conlabz GmbH</name><user>conlabz</user><email>info@conlabz.de</email></author></authors>
23
+ <date>2014-08-15</date>
24
+ <time>15:18:23</time>
25
+ <contents><target name="magecommunity"><dir name="Conlabz"><dir name="CrConnect"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Newsletter.php" hash="0354815224028e6fc90671a61abb2232"/></dir></dir></dir><dir name="Newsletter"><file name="Subscriber.php" hash="9eaf627b6255229e1861208dd1b9a280"/></dir></dir><dir name="Config"><file name="GroupsApis.php" hash="6ecac377484995a89c7718a015f74a89"/><file name="Key.php" hash="42f31c0d35632948a702106540d5e85b"/><file name="Url.php" hash="f330f299b19ed1b266ec6a3eb5d31fa1"/></dir><dir name="Customer"><file name="Newsletter.php" hash="f645682ece7817b4386538026fa580dc"/></dir><file name="Groupsapis.php" hash="cecd60a67b2e72effd2bc7ac1e1fdc58"/></dir><dir name="Helper"><file name="Data.php" hash="293591f9f29cf83d777454c4f0eed40e"/></dir><dir name="Model"><file name="Api.php" hash="1c7e822831cd757a48cbb211855f6cbd"/><dir name="Checkout"><file name="Observer.php" hash="cf99d26d4d85c3106d480b035b98287f"/></dir><dir name="Customer"><file name="Observer.php" hash="6dd8ed2fc9c3dd0e5a2771fb1857ec81"/></dir><dir name="Newsletter"><file name="Subscriber.php" hash="51cb181afbd60baaadd5ed4385497763"/></dir><file name="Observer.php" hash="8b05c8437a4f8ec1d0dfefe9981fc046"/><file name="Search.php" hash="e2bcaa4e316d028141075cbd0c964e67"/><file name="Subscriber.php" hash="932db13369c1f1d9e106b1600531d681"/><dir name="System"><dir name="Config"><dir name="Source"><file name="EmptyForms.php" hash="feb6f16d6b26e0cdaedb06bc68ce1c63"/><file name="EmptyList.php" hash="8f3f19184a183b1f5dce98d70608bcb1"/></dir></dir></dir><dir name="Website"><file name="Observer.php" hash="db48be43fed458ed4169771a55cf2288"/></dir></dir><dir name="controllers"><file name="AccountController.php" hash="009b2b88f4d9a5daeb050ce617d677b6"/><dir name="Adminhtml"><file name="ConfigController.php" hash="d5a14810dea4a39e593f963119fca26e"/><file name="CrconnectController.php" hash="07e1950ceb80342fc006ea00db084596"/></dir><file name="HookController.php" hash="3235db4d5ecf422ff9d58771af94fca5"/><file name="ManageController.php" hash="739fdf9934ca2665b9ffdf43edbef733"/><file name="SearchController.php" hash="2f7947cf6774a6874c815f71d3468152"/><file name="SubscriberController.php" hash="9cd8eb59c885b6f0b9133c0a1271bbe9"/><file name="UnsubscribeController.php" hash="357908ed531f29de19b7ddbb549ed4e4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="00bab70876fc5def3883b74cb1da413c"/><file name="config.xml" hash="6279d7a54f9fb1b12ecc263f97ebe335"/><file name="system.xml" hash="9f5c8170faedd86fcc35df4be9dc93b9"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="crconnect"><dir name="config"><file name="header.phtml" hash="727bc6a2a9b67c1e5819faa91c06ffd3"/></dir><dir name="newsletter"><dir name="subscriber"><file name="list.phtml" hash="94952fb1921397c4ad33387d8387c463"/></dir></dir><dir name="system"><dir name="config"><dir name="form"><dir name="field"><file name="array_groups.phtml" hash="ac84db9b1e8b342337a478ecba62e0b1"/><file name="cr_array_groups.phtml" hash="d2f70aa406d8b15f819481acbf0ccbee"/></dir></dir></dir></dir></dir></dir><dir name="layout"><file name="crconnect.xml" hash="1185a92ac6c2117d5e440f709d0eca24"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="crconnect.xml" hash="956fea6e3eb0e98fc6bbcc7241f9123e"/></dir><dir name="template"><dir name="crconnect"><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="a533451e27b90284d3414e391b460231"/></dir></dir><dir name="form"><file name="newsletter.phtml" hash="4a1309d0d6d2587c8534dd4a1ccdf235"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Conlabz_CrConnect.xml" hash="282358cc102bf617b7d5afcaa47ec489"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Conlabz_CleverReach.csv" hash="22f87461d771b644cb0ac3dc2cc78118"/></dir><dir name="en_US"><file name="Conlabz_CleverReach.csv" hash="7d6b2f9b03bcba2abf2c5eacdd2192e1"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="images"><dir name="cleverreach"><file name="cleverreach-logo.png" hash="bff60f831ca9e1dc9bcbdb2e3f5a5805"/></dir></dir><dir name="js"><file name="crconnect.js" hash="72c951b0b46862253c7159255d82b2e0"/></dir></dir></dir></dir></target><target name="mage"><dir name="."><file name="CleverReachDocumentation.docx" hash="571866f1b26b6c1ba5881644b2ecf9db"/><file name="CleverReachDocumentationGerman.docx" hash="ed975c640c6fd92115505f0790ba6231"/></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.13</min><max>5.4.0</max></php></required></dependencies>
28
  </package>