Version Notes
- Added State/Province field for customer synchronization
Download this release
Release Info
Developer | Thomas Nelson |
Extension | Mailigen_Synchronizer |
Version | 1.2.8 |
Comparing to | |
See all releases |
Code changes from version 1.2.7 to 1.2.8
- app/code/community/Mailigen/Synchronizer/Helper/Customer.php +30 -2
- app/code/community/Mailigen/Synchronizer/Model/Customer.php +1 -0
- app/code/community/Mailigen/Synchronizer/Model/Customer/Merge/Field.php +5 -0
- app/code/community/Mailigen/Synchronizer/Model/Mailigen.php +1 -0
- app/code/community/Mailigen/Synchronizer/etc/config.xml +1 -1
- package.xml +5 -5
app/code/community/Mailigen/Synchronizer/Helper/Customer.php
CHANGED
@@ -34,6 +34,11 @@ class Mailigen_Synchronizer_Helper_Customer extends Mage_Core_Helper_Abstract
|
|
34 |
*/
|
35 |
protected $_countries = null;
|
36 |
|
|
|
|
|
|
|
|
|
|
|
37 |
/**
|
38 |
* @var array
|
39 |
*/
|
@@ -155,7 +160,7 @@ class Mailigen_Synchronizer_Helper_Customer extends Mage_Core_Helper_Abstract
|
|
155 |
*/
|
156 |
public function getCountries()
|
157 |
{
|
158 |
-
if (
|
159 |
$countries = Mage::getResourceModel('directory/country_collection')->loadData()->toOptionArray(false);
|
160 |
foreach ($countries as $country) {
|
161 |
$this->_countries[$country['value']] = $country['label'];
|
@@ -163,6 +168,19 @@ class Mailigen_Synchronizer_Helper_Customer extends Mage_Core_Helper_Abstract
|
|
163 |
}
|
164 |
return $this->_countries;
|
165 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
/**
|
168 |
* @param $country
|
@@ -174,13 +192,23 @@ class Mailigen_Synchronizer_Helper_Customer extends Mage_Core_Helper_Abstract
|
|
174 |
return isset($countries[$country]) ? $countries[$country] : '';
|
175 |
}
|
176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
/**
|
178 |
* @param $isSubscribed
|
179 |
* @return string
|
180 |
*/
|
181 |
public function getFormattedIsSubscribed($isSubscribed)
|
182 |
{
|
183 |
-
if (
|
184 |
return $this->customerIsSubscribed[0];
|
185 |
} elseif (isset($this->customerIsSubscribed[$isSubscribed])) {
|
186 |
return $this->customerIsSubscribed[$isSubscribed];
|
34 |
*/
|
35 |
protected $_countries = null;
|
36 |
|
37 |
+
/**
|
38 |
+
* @var null
|
39 |
+
*/
|
40 |
+
protected $_regions = null;
|
41 |
+
|
42 |
/**
|
43 |
* @var array
|
44 |
*/
|
160 |
*/
|
161 |
public function getCountries()
|
162 |
{
|
163 |
+
if ($this->_countries === null) {
|
164 |
$countries = Mage::getResourceModel('directory/country_collection')->loadData()->toOptionArray(false);
|
165 |
foreach ($countries as $country) {
|
166 |
$this->_countries[$country['value']] = $country['label'];
|
168 |
}
|
169 |
return $this->_countries;
|
170 |
}
|
171 |
+
/**
|
172 |
+
* @return array
|
173 |
+
*/
|
174 |
+
public function getRegions()
|
175 |
+
{
|
176 |
+
if ($this->_regions === null) {
|
177 |
+
$regionCollection = Mage::getModel('directory/region')->getCollection()->getData();
|
178 |
+
foreach ($regionCollection as $region) {
|
179 |
+
$this->_regions[$region['region_id']] = $region['name'];
|
180 |
+
}
|
181 |
+
}
|
182 |
+
return $this->_regions;
|
183 |
+
}
|
184 |
|
185 |
/**
|
186 |
* @param $country
|
192 |
return isset($countries[$country]) ? $countries[$country] : '';
|
193 |
}
|
194 |
|
195 |
+
/**
|
196 |
+
* @param $regionId
|
197 |
+
* @return string
|
198 |
+
*/
|
199 |
+
public function getFormattedRegion($regionId)
|
200 |
+
{
|
201 |
+
$regions = $this->getRegions();
|
202 |
+
return isset($regions[$regionId]) ? $regions[$regionId] : '';
|
203 |
+
}
|
204 |
+
|
205 |
/**
|
206 |
* @param $isSubscribed
|
207 |
* @return string
|
208 |
*/
|
209 |
public function getFormattedIsSubscribed($isSubscribed)
|
210 |
{
|
211 |
+
if ($isSubscribed === null) {
|
212 |
return $this->customerIsSubscribed[0];
|
213 |
} elseif (isset($this->customerIsSubscribed[$isSubscribed])) {
|
214 |
return $this->customerIsSubscribed[$isSubscribed];
|
app/code/community/Mailigen/Synchronizer/Model/Customer.php
CHANGED
@@ -135,6 +135,7 @@ class Mailigen_Synchronizer_Model_Customer extends Mage_Core_Model_Abstract
|
|
135 |
*/
|
136 |
$customers->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
|
137 |
->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
|
|
|
138 |
->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');
|
139 |
|
140 |
/**
|
135 |
*/
|
136 |
$customers->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
|
137 |
->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
|
138 |
+
->joinAttribute('billing_region_id', 'customer_address/region_id', 'default_billing', null, 'left')
|
139 |
->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');
|
140 |
|
141 |
/**
|
app/code/community/Mailigen/Synchronizer/Model/Customer/Merge/Field.php
CHANGED
@@ -85,6 +85,11 @@ class Mailigen_Synchronizer_Model_Customer_Merge_Field extends Mage_Core_Model_A
|
|
85 |
'field_type' => 'text',
|
86 |
'req' => false
|
87 |
),
|
|
|
|
|
|
|
|
|
|
|
88 |
'DATEOFBIRTH' => array(
|
89 |
'title' => 'Date of birth',
|
90 |
'field_type' => 'date',
|
85 |
'field_type' => 'text',
|
86 |
'req' => false
|
87 |
),
|
88 |
+
'REGION' => array(
|
89 |
+
'title' => 'State/Province',
|
90 |
+
'field_type' => 'text',
|
91 |
+
'req' => false
|
92 |
+
),
|
93 |
'DATEOFBIRTH' => array(
|
94 |
'title' => 'Date of birth',
|
95 |
'field_type' => 'date',
|
app/code/community/Mailigen/Synchronizer/Model/Mailigen.php
CHANGED
@@ -396,6 +396,7 @@ class Mailigen_Synchronizer_Model_Mailigen extends Mage_Core_Model_Abstract
|
|
396 |
'REGISTRATIONDATE' => $helper->getFormattedDate($customer->getCreatedAtTimestamp()),
|
397 |
'COUNTRY' => $helper->getFormattedCountry($customer->getBillingCountryId()),
|
398 |
'CITY' => $customer->getBillingCity(),
|
|
|
399 |
'DATEOFBIRTH' => $helper->getFormattedDate($customer->getDob()),
|
400 |
'GENDER' => $helper->getFormattedGender($customer->getGender()),
|
401 |
'LASTLOGIN' => $helper->getFormattedDate($customer->getLastLoginAt()),
|
396 |
'REGISTRATIONDATE' => $helper->getFormattedDate($customer->getCreatedAtTimestamp()),
|
397 |
'COUNTRY' => $helper->getFormattedCountry($customer->getBillingCountryId()),
|
398 |
'CITY' => $customer->getBillingCity(),
|
399 |
+
'REGION' => $helper->getFormattedRegion($customer->getBillingRegionId()),
|
400 |
'DATEOFBIRTH' => $helper->getFormattedDate($customer->getDob()),
|
401 |
'GENDER' => $helper->getFormattedGender($customer->getGender()),
|
402 |
'LASTLOGIN' => $helper->getFormattedDate($customer->getLastLoginAt()),
|
app/code/community/Mailigen/Synchronizer/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Mailigen_Synchronizer>
|
5 |
-
<version>1.2.
|
6 |
</Mailigen_Synchronizer>
|
7 |
</modules>
|
8 |
<global>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Mailigen_Synchronizer>
|
5 |
+
<version>1.2.8</version>
|
6 |
</Mailigen_Synchronizer>
|
7 |
</modules>
|
8 |
<global>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Mailigen_Synchronizer</name>
|
4 |
-
<version>1.2.
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
@@ -19,11 +19,11 @@
|
|
19 |
For more detailed information, instructions and usage of this extension, please visit Mailigen Integrations page or contact our support team.
|
20 |

|
21 |
Mailigen provides email and integrated marketing services covering full email automation. See a full integration list in Mailigen Integrations page.</description>
|
22 |
-
<notes>-
|
23 |
<authors><author><name>Thomas Nelson</name><user>mailigen</user><email>info@mailigen.com</email></author></authors>
|
24 |
-
<date>2016-
|
25 |
-
<time>
|
26 |
-
<contents><target name="magecommunity"><dir name="Mailigen"><dir name="Synchronizer"><dir name="Block"><dir name="Adminhtml"><dir name="Newsletter"><file name="Secretkey.php" hash="d7bd712b8851c592f5f2261046e051db"/><file name="Webhooks.php" hash="d6abad73f516741131b4be64dc487cb7"/></dir><dir name="Sync"><file name="Information.php" hash="8a56f97404bad86c899294bffe6832af"/></dir></dir><dir name="Newsletter"><dir name="Subscriber"><file name="Grid.php" hash="1a975840b9f1704644cb8228468ad743"/></dir></dir></dir><dir name="Helper"><file name="Customer.php" hash="
|
27 |
<compatible/>
|
28 |
<dependencies><required><php><min>5.4.0</min><max>6.0.0</max></php></required></dependencies>
|
29 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Mailigen_Synchronizer</name>
|
4 |
+
<version>1.2.8</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
19 |
For more detailed information, instructions and usage of this extension, please visit Mailigen Integrations page or contact our support team.
|
20 |

|
21 |
Mailigen provides email and integrated marketing services covering full email automation. See a full integration list in Mailigen Integrations page.</description>
|
22 |
+
<notes>- Added State/Province field for customer synchronization</notes>
|
23 |
<authors><author><name>Thomas Nelson</name><user>mailigen</user><email>info@mailigen.com</email></author></authors>
|
24 |
+
<date>2016-06-16</date>
|
25 |
+
<time>14:31:42</time>
|
26 |
+
<contents><target name="magecommunity"><dir name="Mailigen"><dir name="Synchronizer"><dir name="Block"><dir name="Adminhtml"><dir name="Newsletter"><file name="Secretkey.php" hash="d7bd712b8851c592f5f2261046e051db"/><file name="Webhooks.php" hash="d6abad73f516741131b4be64dc487cb7"/></dir><dir name="Sync"><file name="Information.php" hash="8a56f97404bad86c899294bffe6832af"/></dir></dir><dir name="Newsletter"><dir name="Subscriber"><file name="Grid.php" hash="1a975840b9f1704644cb8228468ad743"/></dir></dir></dir><dir name="Helper"><file name="Customer.php" hash="c95a56264606edaf9f5ed8d94c99e390"/><file name="Data.php" hash="69c905b568ea180ae89900f9dba84eb8"/><file name="Log.php" hash="7cff7048604c0f75be38cbd42e9dc8e3"/></dir><dir name="Model"><dir name="Customer"><dir name="Merge"><file name="Field.php" hash="0830c74ec17abbd77810f66fcb659950"/></dir></dir><file name="Customer.php" hash="8ea0b357eae527b557a3a4ef4a5a1269"/><file name="List.php" hash="87d1a6520a69eb73d1d14b056511e7c1"/><file name="Mailigen.php" hash="ee0963540349369cc27bdc478d577c8c"/><dir name="Newsletter"><dir name="Merge"><file name="Field.php" hash="55e42de3620d9e171f7933038c56800c"/></dir><file name="Subscriber.php" hash="0be821ef351f8c9ed9811c1b0054b3a2"/></dir><file name="Newsletter.php" hash="864672a8ce7686376a35eab5979f3c0b"/><file name="Observer.php" hash="c6f0c0f779a3e8ce21d24a232e0776b4"/><dir name="Resource"><dir name="Customer"><file name="Collection.php" hash="6007eee7490f2a70f13142ea7b1c58ad"/></dir><file name="Customer.php" hash="bb95830ef5e95b4a361a858d081ff4f8"/><dir name="Iterator"><file name="Batched.php" hash="0ee09a467db4ea633b2742d278217fa6"/></dir><dir name="Subscriber"><file name="Collection.php" hash="89339714c27c422957097e2f6f88023a"/></dir></dir><file name="Schedule.php" hash="6486dc9375bae5555c0e0a9c7a156be5"/><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Customer"><file name="List.php" hash="5370ca37cb8d4f0a268e3ef2e9f4c673"/></dir><dir name="Newsletter"><file name="List.php" hash="eed1702b0b39ca66069a6514537892c9"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="MailigenController.php" hash="64f131ec5cfa94268681c17806e3c6ca"/></dir><file name="WebhookController.php" hash="214283e3f1db6e93cead345f3394b264"/></dir><dir name="data"><dir name="mailigen_synchronizer_setup"><file name="data-install-1.1.0.php" hash="30f1fdb649862fcbbd943aeb7ce65c7f"/></dir></dir><dir name="etc"><file name="config.xml" hash="f3f19be9dafd90b9c043fa379b49c67e"/><file name="system.xml" hash="78f7385b1230243fda3d41eadca1db9a"/></dir><dir name="sql"><dir name="mailigen_synchronizer_setup"><file name="install-1.1.0.php" hash="57ee87c647fca4c728f9ee988be84231"/><file name="mysql4-upgrade-1.1.4-1.2.0.php" hash="3a0b0fe8b19066f2f3788fa8a37af493"/><file name="mysql4-upgrade-1.2.1-1.2.2.php" hash="51293851b4ad49102baee6be2e3f4ed4"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mailigen_Synchronizer.xml" hash="4c1560ac5f7042f57bfcf13a0e49bc00"/></dir></target><target name="magelib"><dir name="mailigen"><file name="MGAPI.class.php" hash="53a59df05f337b920ef5ba4d52ecdfde"/></dir></target><target name="mageskin"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="mailigen_synchronizer"><file name="Mailigen_webhooks_setup_instruction.jpg" hash="27dcb35d607a919b2f3e95e2fdb96757"/></dir></dir></dir></dir></dir></target></contents>
|
27 |
<compatible/>
|
28 |
<dependencies><required><php><min>5.4.0</min><max>6.0.0</max></php></required></dependencies>
|
29 |
</package>
|