Mailigen_Synchronizer - Version 1.0.1

Version Notes

- Automatic synchronization between your Magento email subscriber list and one of your Mailigen email lists. When users subscribe to the newsletter in Magento, they will be added to the selected Mailigen contact list.
- Two-way synchronization when it comes to subscriber status change. When users unsubscribe from your Magento list, they will be removed also from your Mailigen list. And vice versa, users will be removed from your Magento list when unsubscribed from your Mailigen list.

Download this release

Release Info

Developer Thomas Nelson
Extension Mailigen_Synchronizer
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/Mailigen/Synchronizer/Model/Mailigen.php CHANGED
@@ -9,7 +9,46 @@ class Mailigen_Synchronizer_Model_Mailigen extends Mage_Core_Model_Abstract {
9
 
10
  require_once( $mgapi );
11
  $api = new MGAPI($apikey);
12
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  $collection = Mage::getResourceSingleton('newsletter/subscriber_collection');
14
  $collection->showCustomerInfo(true)->addSubscriberTypeField()->showStoreInfo();
15
 
9
 
10
  require_once( $mgapi );
11
  $api = new MGAPI($apikey);
12
+
13
+ //First we pull all unsubscribers from Mailigen
14
+ $unsubscribers = $api->listMembers($listid, "unsubscribed", 0, 500);
15
+
16
+ foreach ($unsubscribers as $unsubscriber) {
17
+
18
+ $email = $unsubscriber['email'];
19
+
20
+
21
+ // create new subscriber without send an confirmation email
22
+ Mage::getModel('newsletter/subscriber')->setImportMode(true)->subscribe( $email );
23
+
24
+ // get just generated subscriber
25
+ $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
26
+
27
+ // change status to "unsubscribed" and save
28
+ $subscriber->setStatus(Mage_Newsletter_Model_Subscriber::STATUS_UNSUBSCRIBED);
29
+ $subscriber->save();
30
+ }
31
+
32
+ //Second we pull all subscribers from Mailigen
33
+ $subscribers = $api->listMembers($listid, "subscribed", 0, 500);
34
+
35
+ foreach ($subscribers as $subscriber) {
36
+
37
+ $email = $subscriber['email'];
38
+
39
+
40
+ // create new subscriber without send an confirmation email
41
+ Mage::getModel('newsletter/subscriber')->setImportMode(true)->subscribe( $email );
42
+
43
+ // get just generated subscriber
44
+ $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
45
+
46
+ // change status to "unsubscribed" and save
47
+ $subscriber->setStatus(Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED);
48
+ $subscriber->save();
49
+ }
50
+
51
+ //and finally we push our list to mailigen
52
  $collection = Mage::getResourceSingleton('newsletter/subscriber_collection');
53
  $collection->showCustomerInfo(true)->addSubscriberTypeField()->showStoreInfo();
54
 
app/code/community/Mailigen/Synchronizer/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Mailigen_Synchronizer>
5
- <version>1.0.0</version>
6
  </Mailigen_Synchronizer>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Mailigen_Synchronizer>
5
+ <version>1.0.1</version>
6
  </Mailigen_Synchronizer>
7
  </modules>
8
  <global>
package.xml CHANGED
@@ -1,13 +1,13 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mailigen_Synchronizer</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Two-way sync between Magento email newsletter subscriber list and Mailigen email list</summary>
10
- <description>"This extension enables a two-way synchronization between your Magento email newsletter subscriber list and your Mailigen email list. It is easy and quick to install and configure, no complex actions or knowledge of programming needed.&#xD;
11
  &#xD;
12
  Feature-rich synchronization&#xD;
13
  &#xD;
@@ -16,13 +16,13 @@ Feature-rich synchronization&#xD;
16
  &#xD;
17
  For more detailed information, instructions and usage of this extension, please visit Mailigen Integrations page or contact our support team.&#xD;
18
  &#xD;
19
- Mailigen provides email and integrated marketing services covering full email automation. See a full integration list in Mailigen Integrations page."</description>
20
  <notes>- Automatic synchronization between your Magento email subscriber list and one of your Mailigen email lists. When users subscribe to the newsletter in Magento, they will be added to the selected Mailigen contact list.&#xD;
21
  - Two-way synchronization when it comes to subscriber status change. When users unsubscribe from your Magento list, they will be removed also from your Mailigen list. And vice versa, users will be removed from your Magento list when unsubscribed from your Mailigen list.</notes>
22
  <authors><author><name>Thomas Nelson</name><user>mailigen</user><email>info@mailigen.com</email></author></authors>
23
- <date>2014-09-19</date>
24
- <time>12:15:00</time>
25
- <contents><target name="magecommunity"><dir name="Mailigen"><dir name="Synchronizer"><dir name="Block"><dir name="Newsletter"><dir name="Subscriber"><file name="Grid.php" hash="0806d62b81980578a09e5c6210530337"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="45ff744e45e50f035bfcc81534f96dad"/></dir><dir name="Model"><file name="List.php" hash="1f17c0f455adc4024140f22ebe5d6554"/><file name="Mailigen.php" hash="dd83acdfd3a428d2ba5efb1debfdba8d"/><dir name="Newsletter"><file name="Subscriber.php" hash="31cd322f6d00250b672b3e4929559e75"/></dir><file name="Observer.php" hash="fdeaaf4e3a6af3b632de65968e077a41"/></dir><dir name="api"><file name="MGAPI.class.php" hash="904de870b0896a4ffd5c5c144b76d6bb"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MailigenController.php" hash="2ecc61ae8c037d48a810cc9802b5a507"/></dir></dir><dir name="etc"><file name="config.xml" hash="c86211a929e6ec832a82197bf6d14ca4"/><file name="system.xml" hash="ba6c34ba2c4256e9cad3f34fe483beff"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mailigen_Synchronizer.xml" hash="6a07537f8d139cba241548e9e11c3e8b"/></dir></target></contents>
26
  <compatible/>
27
- <dependencies><required><php><min>5.4.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.7</min><max>1.9</max></package></required></dependencies>
28
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mailigen_Synchronizer</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Two-way sync between Magento email newsletter subscriber list and Mailigen email list</summary>
10
+ <description>This extension enables a two-way synchronization between your Magento email newsletter subscriber list and your Mailigen email list. It is easy and quick to install and configure, no complex actions or knowledge of programming needed.&#xD;
11
  &#xD;
12
  Feature-rich synchronization&#xD;
13
  &#xD;
16
  &#xD;
17
  For more detailed information, instructions and usage of this extension, please visit Mailigen Integrations page or contact our support team.&#xD;
18
  &#xD;
19
+ Mailigen provides email and integrated marketing services covering full email automation. See a full integration list in Mailigen Integrations page.</description>
20
  <notes>- Automatic synchronization between your Magento email subscriber list and one of your Mailigen email lists. When users subscribe to the newsletter in Magento, they will be added to the selected Mailigen contact list.&#xD;
21
  - Two-way synchronization when it comes to subscriber status change. When users unsubscribe from your Magento list, they will be removed also from your Mailigen list. And vice versa, users will be removed from your Magento list when unsubscribed from your Mailigen list.</notes>
22
  <authors><author><name>Thomas Nelson</name><user>mailigen</user><email>info@mailigen.com</email></author></authors>
23
+ <date>2014-11-27</date>
24
+ <time>19:21:24</time>
25
+ <contents><target name="magecommunity"><dir name="Mailigen"><dir name="Synchronizer"><dir name="Block"><dir name="Newsletter"><dir name="Subscriber"><file name="Grid.php" hash="0806d62b81980578a09e5c6210530337"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="45ff744e45e50f035bfcc81534f96dad"/></dir><dir name="Model"><file name="List.php" hash="1f17c0f455adc4024140f22ebe5d6554"/><file name="Mailigen.php" hash="56b6c239c2863384756fc41e3617f804"/><dir name="Newsletter"><file name="Subscriber.php" hash="31cd322f6d00250b672b3e4929559e75"/></dir><file name="Observer.php" hash="fdeaaf4e3a6af3b632de65968e077a41"/></dir><dir name="api"><file name="MGAPI.class.php" hash="904de870b0896a4ffd5c5c144b76d6bb"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MailigenController.php" hash="2ecc61ae8c037d48a810cc9802b5a507"/></dir></dir><dir name="etc"><file name="config.xml" hash="a90af7455f1c48dc07e53f7be2e5ceee"/><file name="system.xml" hash="ba6c34ba2c4256e9cad3f34fe483beff"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mailigen_Synchronizer.xml" hash="6a07537f8d139cba241548e9e11c3e8b"/></dir></target></contents>
26
  <compatible/>
27
+ <dependencies><required><php><min>5.4.0</min><max>6.0.0</max></php></required></dependencies>
28
  </package>