MailUp - Version 2.6.0

Version Notes


  • Custom customer attribute mapping

  • Recipient fields are automatically mapped for new installations

  • MailUp recipient fields sync as soon as login details are saved

  • Select which statuses are used to find orders for filters and totals

  • Sync offset in hours for cron

  • Displays accurate pending message in customer dashboard if double opt-in used

  • Bug Fix: Filter by category returns all matching customers

Download this release

Release Info

Developer MailUp
Extension MailUp
Version 2.6.0
Comparing to
See all releases


Code changes from version 2.5.0 to 2.6.0

Files changed (24) hide show
  1. app/code/local/SevenLike/MailUp/.DS_Store +0 -0
  2. app/code/local/SevenLike/MailUp/Block/Adminhtml/System/Config/Form/Field/Timezone.php +20 -0
  3. app/code/local/SevenLike/MailUp/Helper/Customer.php +70 -0
  4. app/code/local/SevenLike/MailUp/Helper/Data.php +65 -35
  5. app/code/local/SevenLike/MailUp/Helper/Order.php +32 -0
  6. app/code/local/SevenLike/MailUp/Model/.DS_Store +0 -0
  7. app/code/local/SevenLike/MailUp/Model/Adminhtml/.DS_Store +0 -0
  8. app/code/local/SevenLike/MailUp/Model/Adminhtml/System/.DS_Store +0 -0
  9. app/code/local/SevenLike/MailUp/Model/Adminhtml/System/Clone/Mappings/Custom.php +32 -0
  10. app/code/local/SevenLike/MailUp/Model/Adminhtml/System/Source/Cron/Frequency.php +25 -0
  11. app/code/local/SevenLike/MailUp/Model/Adminhtml/System/Source/Fields.php +48 -15
  12. app/code/local/SevenLike/MailUp/Model/Config.php +42 -3
  13. app/code/local/SevenLike/MailUp/Model/Lists.php +72 -37
  14. app/code/local/SevenLike/MailUp/Model/MailUpWsImport.php +30 -35
  15. app/code/local/SevenLike/MailUp/Model/Observer.php +71 -20
  16. app/code/local/SevenLike/MailUp/Model/Wssend.php +6 -4
  17. app/code/local/SevenLike/MailUp/etc/config.xml +41 -1
  18. app/code/local/SevenLike/MailUp/etc/system.xml +59 -6
  19. app/design/adminhtml/default/default/template/sevenlike/mailup/confirm.phtml +4 -0
  20. app/design/frontend/base/default/layout/mailup.xml +10 -2
  21. app/design/frontend/base/default/template/mailup/customer/account/dashboard/info.phtml +43 -0
  22. app/design/frontend/enterprise/default/layout/mailup.xml +8 -0
  23. app/design/frontend/enterprise/default/template/mailup/customer/account/dashboard/info.phtml +33 -0
  24. package.xml +11 -8
app/code/local/SevenLike/MailUp/.DS_Store ADDED
Binary file
app/code/local/SevenLike/MailUp/Block/Adminhtml/System/Config/Form/Field/Timezone.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class SevenLike_MailUp_Block_Adminhtml_System_Config_Form_Field_Timezone
4
+ extends Mage_Adminhtml_Block_System_Config_Form_Field
5
+ {
6
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
7
+ {
8
+ $timezoneList = Mage::app()->getLocale()->getTranslationList('windowstotimezone');
9
+
10
+ // Select only current timezone
11
+ $timezone = date_default_timezone_get();
12
+
13
+ $timezoneStr = $timezone;
14
+ if (isset($timezoneList[$timezone])) {
15
+ $timezoneStr = "{$timezoneList[$timezone]} ({$timezone})";
16
+ }
17
+
18
+ return "<span>{$timezoneStr}</span>";
19
+ }
20
+ }
app/code/local/SevenLike/MailUp/Helper/Customer.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Customer helper methods for MailUp
4
+ */
5
+ class SevenLike_MailUp_Helper_Customer extends Mage_Core_Helper_Abstract
6
+ {
7
+ /**
8
+ * Check whether customer attribute is on ignore list
9
+ *
10
+ * @param $attr string $attr Name of attribute
11
+ * @return bool
12
+ */
13
+ public function isAttrIgnored($attr)
14
+ {
15
+ $attrs = self::_getAttrsIgnored();
16
+
17
+ return isset($attrs[$attr]);
18
+ }
19
+
20
+ /**
21
+ * All standard attributes as a hash mapped to true for easy testing
22
+ * Note that this does not include reward attributes for EE, so these will come out as part of customer attts
23
+ *
24
+ * @return array
25
+ */
26
+ protected static function _getAttrsIgnored()
27
+ {
28
+ static $attrs = array(
29
+ 'confirmation' => true,
30
+ 'created_at' => true,
31
+ 'created_in' => true,
32
+ 'default_billing' => true,
33
+ 'default_shipping' => true,
34
+ 'disable_auto_group_change' => true,
35
+ 'dob' => true,
36
+ 'email' => true,
37
+ 'firstname' => true,
38
+ 'gender' => true,
39
+ 'group_id' => true,
40
+ 'lastname' => true,
41
+ 'middlename' => true,
42
+ 'password_hash' => true,
43
+ 'prefix' => true,
44
+ 'rp_token' => true,
45
+ 'rp_token_created_at' => true,
46
+ 'store_id' => true,
47
+ 'suffix' => true,
48
+ 'taxvat' => true,
49
+ 'website_id' => true
50
+ );
51
+
52
+ return $attrs;
53
+ }
54
+
55
+ /**
56
+ * Get customer attribute collection with only custom attributes
57
+ *
58
+ * @return Varien_Data_Collection_Db
59
+ */
60
+ public function getCustomCustomerAttrCollection()
61
+ {
62
+ $attrs = self::_getAttrsIgnored();
63
+
64
+ $customerAttributes = Mage::getResourceModel('customer/attribute_collection')
65
+ ->addFieldToFilter('attribute_code', array('nin' => array_keys($attrs)));
66
+
67
+ return $customerAttributes;
68
+ }
69
+
70
+ }
app/code/local/SevenLike/MailUp/Helper/Data.php CHANGED
@@ -79,14 +79,15 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
79
  }
80
  }
81
 
82
- if($config->isLogEnabled()) {
83
  $config->log('Customer with id '.$currentCustomerId);
84
  }
85
  $customer = Mage::getModel('customer/customer')->load($currentCustomerId);
86
  /* @var $customer Mage_Customer_Model_Customer */
87
  $i = $customer->getEmail();
88
 
89
- //recupero gli ordini del cliente corrente
 
90
  $allOrdersTotalAmount = 0;
91
  $allOrdersDateTimes = array();
92
  $allOrdersTotals = array();
@@ -97,20 +98,20 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
97
  $lastShipmentOrderId = null;
98
  $lastShipmentOrderDate = null;
99
 
100
- if($config->isLogEnabled()) {
101
  $config->log('Parsing orders of customer with id '.$currentCustomerId);
102
  }
103
- $orders = Mage::getModel('sales/order')
104
- ->getCollection()
105
- ->addAttributeToFilter('customer_id', $currentCustomerId)
106
- ;
107
- foreach($orders as $order) {
108
- if($config->isLogEnabled()) {
109
- $config->log("ORDINE IN STATUS: " . $order->getStatus());
110
- }
111
- if( ! in_array($order->getStatus(), array("closed", "complete", "processing"))) {
112
- continue;
113
  }
 
 
114
  $currentOrderTotal = floatval($order->getGrandTotal());
115
  $allOrdersTotalAmount += $currentOrderTotal;
116
 
@@ -203,6 +204,18 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
203
  $toSend[$i]['email'] = $customer->getEmail();
204
  $toSend[$i]['IDCliente'] = $currentCustomerId;
205
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  $toSend[$i]['registeredDate'] = self::_retriveDateFromDatetime($customer->getCreatedAt());
207
 
208
  //controllo se iscritto o meno alla newsletter
@@ -330,7 +343,7 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
330
  if($config->isLogEnabled($storeId)) {
331
  $config->log('generateAndSendCustomers [Empty Customer ID Array]');
332
  }
333
- return FALSE;
334
  }
335
 
336
  $jobId = $post['id'];
@@ -340,11 +353,15 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
340
  if ($accessKey === false) {
341
  Mage::throwException('no access key returned');
342
  }
343
-
344
- //$fields = $wsSend->GetFields($accessKey);
345
  $fields_mapping = $wsImport->getFieldsMapping($storeId); // Pass StoreId
 
 
 
 
 
346
 
347
- //definisco il gruppo a cui aggiungere gli iscritti
348
  $groupId = $post['mailupGroupId'];
349
  $listGUID = $post['mailupListGUID'];
350
  $idList = $post['mailupIdList'];
@@ -382,12 +399,14 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
382
  $totalCustomers = sizeof($mailupCustomerIds);
383
  foreach ($mailupCustomerIds as $customerId) {
384
  $subscribers_counter++;
385
- $xmlData .= self::_getCustomerXml($customerId, $fields_mapping, $storeId);
 
 
386
  }
387
  /**
388
  * We have Valid Data to send
389
  */
390
- if(strlen($xmlData)) {
391
  $importProcessData["xmlDoc"] = "<subscribers>$xmlData</subscribers>";
392
  $xmlData = "";
393
  $subscribers_counter = 0;
@@ -471,17 +490,17 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
471
  /**
472
  * Get a single customers XML data.
473
  *
474
- * @param int
475
- * @param array
476
- * @param int
477
- * @return string
478
  */
479
  protected static function _getCustomerXml($customerId, $fields_mapping, $storeId)
480
  {
481
  $config = Mage::getModel('mailup/config');
482
  /* @var $config SevenLike_Mailup_Model_Config */
483
  $xmlData = '';
484
- $tmp = array();
485
  $subscriber = self::getCustomersData(array($customerId));
486
 
487
  if(is_array($subscriber) && empty($subscriber)) {
@@ -514,8 +533,6 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
514
 
515
  /**
516
  * Map from Customer Data to Mailup Fields.
517
- *
518
- * @todo Need to map Gener field
519
  */
520
  $mappings = array(
521
  'Name' => 'nome',
@@ -547,34 +564,47 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
547
  'DateOfBirth' => 'DateOfBirth',
548
  'Gender' => 'Gender',
549
  );
 
 
 
 
 
 
 
550
 
551
  foreach($mappings as $mapTo => $mapFrom) {
552
  if(isset($fields_mapping[$mapTo]) && ! empty($fields_mapping[$mapTo])) {
553
- $tmp[$fields_mapping[$mapTo]] = '<campo'.$fields_mapping[$mapTo].'>'. "<![CDATA[". $subscriber[$mapFrom] ."]]>". '</campo'.$fields_mapping[$mapTo].'>';
554
  }
555
  elseif( ! empty($fields_mapping[$mapTo])) {
556
- $tmp[$fields_mapping[$mapTo]] = '<campo'.$fields_mapping[$mapTo].'>'. '" "'. '</campo'.$fields_mapping[$mapTo].'>';
557
  }
558
  //else {}
559
  }
560
 
561
- $last_field = max(array_keys($tmp));
 
 
 
 
 
 
562
 
563
  for($i=1; $i < $last_field; $i++) {
564
- if( ! isset($tmp[$i]) && ! empty($i)) {
565
  /**
566
  * If we leave a space it will blank the value out in mail up.
567
  * if we leave it empty, it will leave the old value alone!
568
  */
569
- $tmp[$i] = "<campo{$i}>" ." ". "</campo{$i}>";
570
  }
571
  }
572
 
573
- ksort($tmp);
574
- $tmp = implode("", $tmp);
575
  /** All field values are handled as strings, character '|' (pipe) is not allowed and may lead to "-402" error codes **/
576
- //$tmp = str_replace('|', '', $tmp);
577
- $xmlData .= $tmp;
578
  $xmlData .= "</subscriber>\n";
579
 
580
  /**
79
  }
80
  }
81
 
82
+ if ($config->isLogEnabled()) {
83
  $config->log('Customer with id '.$currentCustomerId);
84
  }
85
  $customer = Mage::getModel('customer/customer')->load($currentCustomerId);
86
  /* @var $customer Mage_Customer_Model_Customer */
87
  $i = $customer->getEmail();
88
 
89
+ // Get order dates, numbers and totals for the current customer
90
+ //TODO: This would be more efficient with just a few SQL statements to gather this
91
  $allOrdersTotalAmount = 0;
92
  $allOrdersDateTimes = array();
93
  $allOrdersTotals = array();
98
  $lastShipmentOrderId = null;
99
  $lastShipmentOrderDate = null;
100
 
101
+ if ($config->isLogEnabled()) {
102
  $config->log('Parsing orders of customer with id '.$currentCustomerId);
103
  }
104
+ // Setup collection to fetch orders for this customer and valid statuses
105
+ $orders = Mage::getResourceModel('sales/order_collection')
106
+ ->addAttributeToFilter('customer_id', $currentCustomerId);
107
+ Mage::helper('mailup/order')->addStatusFilterToOrders($orders);
108
+
109
+ foreach ($orders as $order) {
110
+ if ($config->isLogEnabled()) {
111
+ $config->log("ORDER STATUS: {$order->getState()} / {$order->getStatus()}");
 
 
112
  }
113
+
114
+ // Get current and total orders
115
  $currentOrderTotal = floatval($order->getGrandTotal());
116
  $allOrdersTotalAmount += $currentOrderTotal;
117
 
204
  $toSend[$i]['email'] = $customer->getEmail();
205
  $toSend[$i]['IDCliente'] = $currentCustomerId;
206
 
207
+ // Custom customer attributes
208
+ $customerAttributes = Mage::helper('mailup/customer')->getCustomCustomerAttrCollection();
209
+ foreach ($customerAttributes as $attribute) {
210
+ $code = $attribute->getAttributeCode() . '_custom_customer_attributes';
211
+ $value = $customer->getData($attribute->getAttributeCode());
212
+ if ($attribute->usesSource()) {
213
+ $toSend[$i][$code] = $attribute->getSource()->getOptionText($value);
214
+ } else {
215
+ $toSend[$i][$code] = $value;
216
+ }
217
+ }
218
+
219
  $toSend[$i]['registeredDate'] = self::_retriveDateFromDatetime($customer->getCreatedAt());
220
 
221
  //controllo se iscritto o meno alla newsletter
343
  if($config->isLogEnabled($storeId)) {
344
  $config->log('generateAndSendCustomers [Empty Customer ID Array]');
345
  }
346
+ return false;
347
  }
348
 
349
  $jobId = $post['id'];
353
  if ($accessKey === false) {
354
  Mage::throwException('no access key returned');
355
  }
356
+
 
357
  $fields_mapping = $wsImport->getFieldsMapping($storeId); // Pass StoreId
358
+ if (count($fields_mapping) == 0) {
359
+ if($config->isLogEnabled($storeId))
360
+ $config->log('No mappings set, so cannot sync customers');
361
+ return false;
362
+ }
363
 
364
+ // Define the group we're adding customers to
365
  $groupId = $post['mailupGroupId'];
366
  $listGUID = $post['mailupListGUID'];
367
  $idList = $post['mailupIdList'];
399
  $totalCustomers = sizeof($mailupCustomerIds);
400
  foreach ($mailupCustomerIds as $customerId) {
401
  $subscribers_counter++;
402
+ $xmlCurrentCust = self::_getCustomerXml($customerId, $fields_mapping, $storeId);
403
+ if ($xmlCurrentCust !== false)
404
+ $xmlData .= $xmlCurrentCust;
405
  }
406
  /**
407
  * We have Valid Data to send
408
  */
409
+ if(strlen($xmlData) > 0) {
410
  $importProcessData["xmlDoc"] = "<subscribers>$xmlData</subscribers>";
411
  $xmlData = "";
412
  $subscribers_counter = 0;
490
  /**
491
  * Get a single customers XML data.
492
  *
493
+ * @param int $customerId
494
+ * @param array $fields_mapping
495
+ * @param int $storeId
496
+ * @return string|false
497
  */
498
  protected static function _getCustomerXml($customerId, $fields_mapping, $storeId)
499
  {
500
  $config = Mage::getModel('mailup/config');
501
  /* @var $config SevenLike_Mailup_Model_Config */
502
  $xmlData = '';
503
+ $mappedData = array();
504
  $subscriber = self::getCustomersData(array($customerId));
505
 
506
  if(is_array($subscriber) && empty($subscriber)) {
533
 
534
  /**
535
  * Map from Customer Data to Mailup Fields.
 
 
536
  */
537
  $mappings = array(
538
  'Name' => 'nome',
564
  'DateOfBirth' => 'DateOfBirth',
565
  'Gender' => 'Gender',
566
  );
567
+
568
+ // Add any custom customer attributes
569
+ $customerAttributes = Mage::helper('mailup/customer')->getCustomCustomerAttrCollection();
570
+ foreach ($customerAttributes as $attribute) {
571
+ $code = $attribute->getAttributeCode() . '_custom_customer_attributes';
572
+ $mappings[$code] = $code;
573
+ }
574
 
575
  foreach($mappings as $mapTo => $mapFrom) {
576
  if(isset($fields_mapping[$mapTo]) && ! empty($fields_mapping[$mapTo])) {
577
+ $mappedData[$fields_mapping[$mapTo]] = '<campo'.$fields_mapping[$mapTo].'>'. "<![CDATA[". $subscriber[$mapFrom] ."]]>". '</campo'.$fields_mapping[$mapTo].'>';
578
  }
579
  elseif( ! empty($fields_mapping[$mapTo])) {
580
+ $mappedData[$fields_mapping[$mapTo]] = '<campo'.$fields_mapping[$mapTo].'>'. '" "'. '</campo'.$fields_mapping[$mapTo].'>';
581
  }
582
  //else {}
583
  }
584
 
585
+ // No point in continuing if there is no mapped data
586
+ if (count($mappedData) == 0) {
587
+ if($config->isLogEnabled($storeId))
588
+ $config->log('No mappings set, so cannot sync customers');
589
+ return false;
590
+ }
591
+ $last_field = max(array_keys($mappedData));
592
 
593
  for($i=1; $i < $last_field; $i++) {
594
+ if( ! isset($mappedData[$i]) && ! empty($i)) {
595
  /**
596
  * If we leave a space it will blank the value out in mail up.
597
  * if we leave it empty, it will leave the old value alone!
598
  */
599
+ $mappedData[$i] = "<campo{$i}>" ." ". "</campo{$i}>";
600
  }
601
  }
602
 
603
+ ksort($mappedData);
604
+ $custDataStr = implode("", $mappedData);
605
  /** All field values are handled as strings, character '|' (pipe) is not allowed and may lead to "-402" error codes **/
606
+ //$mappedData = str_replace('|', '', $mappedData);
607
+ $xmlData .= $custDataStr;
608
  $xmlData .= "</subscriber>\n";
609
 
610
  /**
app/code/local/SevenLike/MailUp/Helper/Order.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Order helper methods for MailUp
4
+ */
5
+ class SevenLike_MailUp_Helper_Order extends Mage_Core_Helper_Abstract
6
+ {
7
+ /**
8
+ * Filter an order collection by status/state depending on MailUp config
9
+ * NOTE that cannot override collection consistently as the class changed name in 1.6
10
+ *
11
+ * @param Varien_Data_Collection_Db $collection
12
+ * @return $this
13
+ */
14
+ public function addStatusFilterToOrders($collection)
15
+ {
16
+ $config = Mage::getModel('mailup/config');
17
+
18
+ // Add condition to skip orders that have incorrect statuses
19
+ $allowedStatuses = $config->getQualifyingOrderStatuses();
20
+ // If config options, use the given statuses
21
+ if (count($allowedStatuses) > 0) {
22
+ $collection->addAttributeToFilter('status', $allowedStatuses);
23
+ } else {
24
+ // Else, use complete, closed and processing state only
25
+ $allowedStates = $config->getDefaultQualifyingStates();
26
+ $collection->addAttributeToFilter('state', $allowedStates);
27
+ }
28
+
29
+ return $this;
30
+ }
31
+
32
+ }
app/code/local/SevenLike/MailUp/Model/.DS_Store ADDED
Binary file
app/code/local/SevenLike/MailUp/Model/Adminhtml/.DS_Store ADDED
Binary file
app/code/local/SevenLike/MailUp/Model/Adminhtml/System/.DS_Store ADDED
Binary file
app/code/local/SevenLike/MailUp/Model/Adminhtml/System/Clone/Mappings/Custom.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Provide clone model that specifies custom customer attributes as prefixes to be
5
+ * cloned from single original field
6
+ *
7
+ * Class SevenLike_MailUp_Model_Adminhtml_System_Clone_Mappings_Custom
8
+ */
9
+ class SevenLike_MailUp_Model_Adminhtml_System_Clone_Mappings_Custom
10
+ extends Mage_Core_Model_Config_Data
11
+ {
12
+ /**
13
+ * Get fields prefixes
14
+ *
15
+ * @return array
16
+ */
17
+ public function getPrefixes()
18
+ {
19
+ $customerAttributes = Mage::helper('mailup/customer')->getCustomCustomerAttrCollection();
20
+
21
+ $prefixes = array();
22
+ foreach ($customerAttributes as $attribute) {
23
+ /* @var $attribute Mage_Eav_Model_Entity_Attribute */
24
+ $prefixes[] = array(
25
+ 'field' => $attribute->getAttributeCode() . '_',
26
+ 'label' => $attribute->getFrontend()->getLabel(),
27
+ );
28
+ }
29
+
30
+ return $prefixes;
31
+ }
32
+ }
app/code/local/SevenLike/MailUp/Model/Adminhtml/System/Source/Cron/Frequency.php CHANGED
@@ -8,6 +8,31 @@ class SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Frequency
8
  const EVERY_12_HOURS = 3;
9
  const DAILY = 4;
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  /**
12
  * Fetch options array
13
  *
8
  const EVERY_12_HOURS = 3;
9
  const DAILY = 4;
10
 
11
+ /**
12
+ * Get the frequency in hours given a frequency index such as
13
+ * SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Frequency::EVERY_2_HOURS
14
+ *
15
+ * @param int $frequencyIndex
16
+ * @return null|int
17
+ */
18
+ public static function getPeriod($frequencyIndex)
19
+ {
20
+ static $periodMapping = array(
21
+ self::HOURLY => 1,
22
+ self::EVERY_2_HOURS => 2,
23
+ self::EVERY_6_HOURS => 6,
24
+ self::EVERY_12_HOURS => 12,
25
+ self::DAILY => 24
26
+ );
27
+
28
+ // If no valid entry, return null
29
+ if (!isset($periodMapping[$frequencyIndex])) {
30
+ return null;
31
+ }
32
+
33
+ return $periodMapping[$frequencyIndex];
34
+ }
35
+
36
  /**
37
  * Fetch options array
38
  *
app/code/local/SevenLike/MailUp/Model/Adminhtml/System/Source/Fields.php CHANGED
@@ -1,15 +1,36 @@
1
- <?php
2
 
 
 
 
 
 
 
 
 
 
3
  class SevenLike_MailUp_Model_Adminhtml_System_Source_Fields
4
  {
5
  const CACHE_LIFETIME = 600; // 10 min
 
6
  /**
7
- * Options getter
 
 
 
 
 
 
 
8
  *
9
  * @return array
10
  */
11
  public function toOptionArray()
12
  {
 
 
 
 
13
  $websiteCode = Mage::app()->getRequest()->getParam('website');
14
  $storeCode = Mage::app()->getRequest()->getParam('store');
15
 
@@ -30,27 +51,39 @@ class SevenLike_MailUp_Model_Adminhtml_System_Source_Fields
30
  $cacheId = 'mailup_fields_array';
31
  //$storeId = Mage::app()->getDefaultStoreView()->getStoreId();
32
  }
33
-
 
34
  $options = array(array('value' => '', 'label' => ''));
35
- if(false !== ($data = Mage::app()->getCache()->load($cacheId))) {
 
 
36
  $options = unserialize($data);
37
- }
38
- else {
39
  $wsSend = new MailUpWsSend($storeId);
40
  $accessKey = $wsSend->loginFromId();
41
- if($accessKey !== false) {
42
  $wsFields = $wsSend->getFields($accessKey);
43
- //$wsFields = array('test' => 'test');
44
- foreach ($wsFields as $label => $value) {
45
- $options[] = array(
46
- 'value' => $value,
47
- 'label' => $label, //Mage::helper('adminhtml')->__($label)
48
- );
 
49
  }
 
 
 
 
 
 
50
  }
51
- Mage::app()->getCache()->save(serialize($options), $cacheId, array(), self::CACHE_LIFETIME);
52
  }
53
-
 
 
 
54
  return $options;
55
  }
56
 
1
+ <?php
2
 
3
+ /**
4
+ * Class SevenLike_MailUp_Model_Adminhtml_System_Source_Fields
5
+ *
6
+ * Cached MailUp recipient fields fetched via API
7
+ *
8
+ * There are two levels of caching:
9
+ * - Within one instantiation of magento, store options in the object
10
+ * - Magento's cache is used for up to 10 minutes to save hitting the API too often
11
+ */
12
  class SevenLike_MailUp_Model_Adminhtml_System_Source_Fields
13
  {
14
  const CACHE_LIFETIME = 600; // 10 min
15
+
16
  /**
17
+ * Storage for options array for this run (assuming class used as singleton)
18
+ *
19
+ * @var null|array
20
+ */
21
+ protected $_options = null;
22
+
23
+ /**
24
+ * Options getter for MailUp field mapping drop-down list
25
  *
26
  * @return array
27
  */
28
  public function toOptionArray()
29
  {
30
+ // If in this instantiation of Mage options have been fetched, return them, bypassing even cache
31
+ if ($this->_options !== null) {
32
+ return $this->_options;
33
+ }
34
  $websiteCode = Mage::app()->getRequest()->getParam('website');
35
  $storeCode = Mage::app()->getRequest()->getParam('store');
36
 
51
  $cacheId = 'mailup_fields_array';
52
  //$storeId = Mage::app()->getDefaultStoreView()->getStoreId();
53
  }
54
+
55
+ // Blank option
56
  $options = array(array('value' => '', 'label' => ''));
57
+
58
+ // Attempt to fetch options from cache (handles invalidation after CACHE_LIFETIME)
59
+ if (false !== ($data = Mage::app()->getCache()->load($cacheId))) {
60
  $options = unserialize($data);
61
+ } else {
62
+ // If cache is invalid, make request to MailUp via API
63
  $wsSend = new MailUpWsSend($storeId);
64
  $accessKey = $wsSend->loginFromId();
65
+ if ($accessKey !== false) {
66
  $wsFields = $wsSend->getFields($accessKey);
67
+ if ($wsFields !== null) {
68
+ foreach ($wsFields as $label => $value) {
69
+ $options[] = array(
70
+ 'value' => $value,
71
+ 'label' => $label, //Mage::helper('adminhtml')->__($label)
72
+ );
73
+ }
74
  }
75
+ // Only store a persistent cache of entries if there was a successful response from MailUp
76
+ Mage::app()->getCache()->save(serialize($options), $cacheId, array(), self::CACHE_LIFETIME);
77
+ } else {
78
+ // Force options to be empty so that nothing is saved
79
+ // (thus defaults or saved values will still be available)
80
+ $options = array();
81
  }
 
82
  }
83
+
84
+ // Whether the cache was used, or a call was made (successfully or otherwise), store the result for this run
85
+ $this->_options = $options;
86
+
87
  return $options;
88
  }
89
 
app/code/local/SevenLike/MailUp/Model/Config.php CHANGED
@@ -18,8 +18,10 @@ class SevenLike_MailUp_Model_Config
18
  const XML_WEBHOOK_KEY = 'mailup_newsletter/mailup/webhook_crypt_key';
19
  const XML_DISABLE_NOTIFICATION = 'mailup_newsletter/mailup/disablenewslettersuccesses';
20
  const XML_TEST_MODE_ENABLE = 'mailup_newsletter/mailup/enable_testmode';
 
21
 
22
  const XML_MAPPING_SECTION = 'mailup_newsletter/mailup_mapping';
 
23
 
24
  /**
25
  * Is test mode enabled
@@ -58,6 +60,35 @@ class SevenLike_MailUp_Model_Config
58
 
59
  Mage::log($message, null, 'mailup.log');
60
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
  /**
63
  * Write a log entry if enabled.
@@ -210,14 +241,22 @@ class SevenLike_MailUp_Model_Config
210
 
211
  /**
212
  * Get Field Mapping
213
- *
214
- * @todo Fix to use the config for mappings, per store..
215
  * @param int
216
  * @return array
217
  */
218
  public function getFieldsMapping($storeId = NULL)
219
  {
220
- return Mage::getStoreConfig(self::XML_MAPPING_SECTION, $storeId);
 
 
 
 
 
 
 
 
 
221
 
222
  /*$return = array();
223
 
18
  const XML_WEBHOOK_KEY = 'mailup_newsletter/mailup/webhook_crypt_key';
19
  const XML_DISABLE_NOTIFICATION = 'mailup_newsletter/mailup/disablenewslettersuccesses';
20
  const XML_TEST_MODE_ENABLE = 'mailup_newsletter/mailup/enable_testmode';
21
+ const XML_ORDER_STATUSES = 'mailup_newsletter/mailup/qualifying_order_statuses';
22
 
23
  const XML_MAPPING_SECTION = 'mailup_newsletter/mailup_mapping';
24
+ const XML_CUSTOM_MAPPING_SECTION = 'mailup_newsletter/mailup_mapping_custom';
25
 
26
  /**
27
  * Is test mode enabled
60
 
61
  Mage::log($message, null, 'mailup.log');
62
  }
63
+
64
+ /**
65
+ * Get qualifying order statuses for inclusion in order totals
66
+ *
67
+ * @param int
68
+ * @return array Array of statuses
69
+ */
70
+ public function getQualifyingOrderStatuses($storeId = NULL)
71
+ {
72
+ // Get from config storage
73
+ $statusesStr = Mage::getStoreConfig(self::XML_ORDER_STATUSES, $storeId);
74
+
75
+ if ($statusesStr === null || $statusesStr === '') {
76
+ return array();
77
+ }
78
+
79
+ // Split up comma separated values
80
+ return explode(',', $statusesStr);
81
+ }
82
+
83
+ /**
84
+ * Get default qualifying order stated for inclusion in order totals
85
+ *
86
+ * @return array
87
+ */
88
+ public function getDefaultQualifyingStates()
89
+ {
90
+ return array('complete', 'closed', 'processing');
91
+ }
92
 
93
  /**
94
  * Write a log entry if enabled.
241
 
242
  /**
243
  * Get Field Mapping
244
+ *
 
245
  * @param int
246
  * @return array
247
  */
248
  public function getFieldsMapping($storeId = NULL)
249
  {
250
+ // Get standard mappings
251
+ $mappingMain = Mage::getStoreConfig(self::XML_MAPPING_SECTION, $storeId);
252
+ // Get mappings for custom customer attributes
253
+ $mappingCustom = Mage::getStoreConfig(self::XML_CUSTOM_MAPPING_SECTION, $storeId);
254
+
255
+ if ($mappingCustom === null) {
256
+ $mappingCustom = array();
257
+ }
258
+
259
+ return array_merge($mappingMain, $mappingCustom);
260
 
261
  /*$return = array();
262
 
app/code/local/SevenLike/MailUp/Model/Lists.php CHANGED
@@ -75,6 +75,11 @@ class SevenLike_MailUp_Model_Lists
75
  if($xmlString) {
76
  $xmlString = html_entity_decode($xmlString);
77
  $startLists = strpos($xmlString, '<Lists>');
 
 
 
 
 
78
  $endPos = strpos($xmlString, '</Lists>');
79
  $endLists = $endPos + strlen('</Lists>') - $startLists;
80
  $xmlLists = substr($xmlString, $startLists, $endLists);
@@ -96,7 +101,7 @@ class SevenLike_MailUp_Model_Lists
96
  }
97
  }
98
  } else {
99
- if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log', $storeId)) Mage::log('LoginFromId failed', 0);
100
  $selectLists[0] = array('value' => 0, 'label'=>$GLOBALS["__sl_mailup_login_error"]);
101
  }
102
  }
@@ -128,50 +133,80 @@ class SevenLike_MailUp_Model_Lists
128
 
129
  /**
130
  * Get an array of all lists, and their groups!
131
- *
 
132
  * @return array
133
  */
134
  public function getDataArray($storeId)
135
  {
136
  $selectLists = array();
137
 
138
- if( ! isset($this->_cache[$storeId])) {
139
- if($this->_config()->getUrlConsole($storeId) && $this->_config()->getUsername($storeId)
140
- && $this->_config()->getPassword($storeId)) {
141
- $wsSend = new MailUpWsSend($storeId);
142
- $accessKey = $wsSend->loginFromId();
143
- if($accessKey !== false) {
144
- require_once dirname(__FILE__) . "/MailUpWsImport.php";
145
- $wsImport = new MailUpWsImport($storeId);
146
- $xmlString = $wsImport->GetNlList();
147
- if($xmlString) {
148
- $xmlString = html_entity_decode($xmlString);
149
- $startLists = strpos($xmlString, '<Lists>');
150
- $endPos = strpos($xmlString, '</Lists>');
151
- $endLists = $endPos + strlen('</Lists>') - $startLists;
152
- $xmlLists = substr($xmlString, $startLists, $endLists);
153
- $xmlLists = str_replace("&", "&amp;", $xmlLists);
154
- $xml = simplexml_load_string($xmlLists);
155
- foreach ($xml->List as $list) {
156
- $groups = array();
157
- foreach ($list->Groups->Group as $tmp) {
158
- $groups[(string)$tmp["idGroup"]] = (string)$tmp["groupName"];
159
- }
160
- $selectLists[(string)$list['idList']] = array(
161
- 'idList' => (string)$list['idList'],
162
- 'listName' => (string)$list['listName'],
163
- 'listGUID' =>(string)$list['listGUID'],
164
- "groups" => $groups
165
- );
166
- }
167
- }
168
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  }
170
-
171
- $this->_cache[$storeId] = $selectLists;
 
 
 
 
172
  }
173
-
174
- return $this->_cache[$storeId];
 
 
 
175
  }
176
 
177
  /**
75
  if($xmlString) {
76
  $xmlString = html_entity_decode($xmlString);
77
  $startLists = strpos($xmlString, '<Lists>');
78
+ if ($startLists === false) {
79
+ if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log', $storeId))
80
+ Mage::log('MailUpWsImport failed even though login succeeded');
81
+ return $selectLists;
82
+ }
83
  $endPos = strpos($xmlString, '</Lists>');
84
  $endLists = $endPos + strlen('</Lists>') - $startLists;
85
  $xmlLists = substr($xmlString, $startLists, $endLists);
101
  }
102
  }
103
  } else {
104
+ if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log', $storeId)) Mage::log('LoginFromId failed');
105
  $selectLists[0] = array('value' => 0, 'label'=>$GLOBALS["__sl_mailup_login_error"]);
106
  }
107
  }
133
 
134
  /**
135
  * Get an array of all lists, and their groups!
136
+ *
137
+ * @param string $storeId
138
  * @return array
139
  */
140
  public function getDataArray($storeId)
141
  {
142
  $selectLists = array();
143
 
144
+ // If cache is set, use that
145
+ if (isset($this->_cache[$storeId])) {
146
+ return $this->_cache[$storeId];
147
+ }
148
+
149
+ // If login details not set, return empty list
150
+ if (!$this->_config()->getUrlConsole($storeId) ||
151
+ !$this->_config()->getUsername($storeId) ||
152
+ !$this->_config()->getPassword($storeId)) {
153
+ if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log', $storeId))
154
+ Mage::log('Login details not complete - cannot retrieve lists');
155
+ return $selectLists;
156
+ }
157
+
158
+ // Attempt login (return empty if fails)
159
+ $wsSend = new MailUpWsSend($storeId);
160
+ $accessKey = $wsSend->loginFromId();
161
+ if ($accessKey === false) {
162
+ if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log', $storeId))
163
+ Mage::log('Login failed - cannot retrieve lists');
164
+ return $selectLists;
165
+ }
166
+
167
+ // Attempt to make call to get lists from API
168
+ require_once dirname(__FILE__) . "/MailUpWsImport.php";
169
+ $wsImport = new MailUpWsImport($storeId);
170
+ $xmlString = $wsImport->GetNlList();
171
+ if (!$xmlString) {
172
+ if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log', $storeId))
173
+ Mage::log('MailUpWsImport got empty response when fetching lists even though login succeeded');
174
+ return $selectLists;
175
+ }
176
+
177
+ // Try to decode response. If <Lists> is not in selection, then return
178
+ $xmlString = html_entity_decode($xmlString);
179
+ $startLists = strpos($xmlString, '<Lists>');
180
+ // On XML error, $startLists will fail
181
+ if ($startLists === false) {
182
+ if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log', $storeId))
183
+ Mage::log('MailUpWsImport got error response when fetching lists');
184
+ return $selectLists;
185
+ }
186
+
187
+ // Extract lists and their groups from <List> section of response
188
+ $endPos = strpos($xmlString, '</Lists>');
189
+ $endLists = $endPos + strlen('</Lists>') - $startLists;
190
+ $xmlLists = substr($xmlString, $startLists, $endLists);
191
+ $xmlLists = str_replace("&", "&amp;", $xmlLists);
192
+ $xml = simplexml_load_string($xmlLists);
193
+ foreach ($xml->List as $list) {
194
+ $groups = array();
195
+ foreach ($list->Groups->Group as $tmp) {
196
+ $groups[(string)$tmp["idGroup"]] = (string)$tmp["groupName"];
197
  }
198
+ $selectLists[(string)$list['idList']] = array(
199
+ 'idList' => (string)$list['idList'],
200
+ 'listName' => (string)$list['listName'],
201
+ 'listGUID' => (string)$list['listGUID'],
202
+ "groups" => $groups
203
+ );
204
  }
205
+
206
+ // Cache results as this is a success
207
+ $this->_cache[$storeId] = $selectLists;
208
+
209
+ return $selectLists;
210
  }
211
 
212
  /**
app/code/local/SevenLike/MailUp/Model/MailUpWsImport.php CHANGED
@@ -527,7 +527,6 @@ class MailUpWsImport
527
  //->getSelect()->query()
528
  ;
529
  /**
530
- * @todo review if this is correct behaviour.
531
  * If StoreID = 0 we will not bother to filter...
532
  */
533
  if(isset($storeId) && ! empty($storeId)) {
@@ -559,8 +558,8 @@ class MailUpWsImport
559
  $customersFiltered = self::intersectByEntityId($tempSubscribed, $customersFiltered);
560
  }
561
  /**
562
- * FILTRO 1 ACQUISTATO: in base al fatto se ha effettuato o meno acquisti:
563
- * 0 = tutti, 1 = chi ha acquistato, 2 = chi non ha mai acquistato
564
  */
565
  $count = 0;
566
  $result = array();
@@ -570,9 +569,12 @@ class MailUpWsImport
570
  if ($request->getRequest()->getParam('mailupCustomers') > 0) {
571
  foreach ($customersFiltered as $customer) {
572
  $result[] = $customer;
573
- //filtro gli ordini in base al customer id
574
- $orders = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('customer_id', $result[$count]['entity_id']);
575
- //aggiungo il cliente ad un determinato array in base a se ha ordinato o meno
 
 
 
576
  if ($orders->getData()) {
577
  $tempPurchased[] = $result[$count];
578
  }
@@ -592,7 +594,7 @@ class MailUpWsImport
592
  }
593
  }
594
  /**
595
- * FILTRO 2 PRODOTTO ACQUISTATO: in base al fatto se ha acquistato un determinato prodotto
596
  */
597
  $count = 0;
598
  $result = array();
@@ -602,21 +604,16 @@ class MailUpWsImport
602
  foreach ($customersFiltered as $customer) {
603
  $result[] = $customer;
604
 
605
- //filtro gli ordini in base al customer id
606
- $orders = Mage::getModel('sales/order')
607
- ->getCollection()
608
- ->addAttributeToFilter('customer_id', $result[$count]['entity_id'])
609
- ;
610
- $purchasedProduct = 0;
611
 
 
612
  $mailupProductId = Mage::getModel('catalog/product')
613
- ->getIdBySku($request->getRequest()->getParam('mailupProductSku'))
614
- ;
615
 
616
  foreach ($orders->getData() as $order) {
617
- if(isset($order["status"]) && ! in_array($order["status"], array("closed", "complete", "processing"))) {
618
- continue;
619
- }
620
  $orderIncrementId = $order['increment_id'];
621
 
622
  //carico i dati di ogni ordine
@@ -646,7 +643,7 @@ class MailUpWsImport
646
  $customersFiltered = self::intersectByEntityId($tempProduct, $customersFiltered);
647
  }
648
  /**
649
- * FILTER BOUGHT IN CATEGORY 3: Depending on whether bought at least one product in a given category
650
  */
651
  $count = 0;
652
  $result = array();
@@ -654,18 +651,16 @@ class MailUpWsImport
654
  if ($request->getRequest()->getParam('mailupCategoryId') > 0) {
655
  foreach ($customersFiltered as $customer) {
656
  $result[] = $customer;
657
- //filtro gli ordini in base al customer id
658
- $orders = Mage::getModel('sales/order')
659
- ->getCollection()
660
- ->addAttributeToFilter('customer_id', $result[$count]['entity_id'])
661
- ;
662
  foreach ($orders->getData() as $order) {
663
- if(isset($order["status"]) && ! in_array($order["status"], array("closed", "complete", "processing"))) {
664
- continue;
665
- }
666
  $orderIncrementId = $order['increment_id'];
667
 
668
- //carico i dati di ogni ordine
669
  $orderData = Mage::getModel('sales/order')->loadByIncrementID($orderIncrementId);
670
  $items = $orderData->getAllItems();
671
  /**
@@ -673,9 +668,9 @@ class MailUpWsImport
673
  */
674
  $searchCategories = Mage::helper('mailup')->getSubCategories($request->getRequest()->getParam('mailupCategoryId'));
675
  foreach ($items as $product) {
676
- $_prod = Mage::getModel('catalog/product')->load($product->getProductId()); // ned to load full product for cats.
677
  $productCategories = Mage::getResourceSingleton('catalog/product')->getCategoryIds($_prod);
678
- $matchingCategories = self::intersectByEntityId($productCategories, $searchCategories);
679
  if(is_array($matchingCategories) && ! empty($matchingCategories)) {
680
  $tempCategory[] = $result[$count];
681
  break 2;
@@ -687,9 +682,9 @@ class MailUpWsImport
687
  }
688
  $customersFiltered = self::intersectByEntityId($tempCategory, $customersFiltered);
689
  }
690
-
691
  /**
692
- * FILTRO 4 GRUPPO DI CLIENTI
693
  */
694
  $count = 0;
695
  $result = array();
@@ -1151,13 +1146,13 @@ class MailUpWsImport
1151
  {
1152
  $tempIds = array();
1153
  foreach ($array1 as $entity1) {
1154
- $tempIds[$entity1['entity_id']] = true;
 
1155
  }
1156
  $tempArray = array();
1157
  foreach ($array2 as $entity2) {
1158
- if (isset($tempIds[$entity2['entity_id']])) {
1159
  $tempArray[] = $entity2;
1160
- }
1161
  }
1162
 
1163
  return $tempArray;
527
  //->getSelect()->query()
528
  ;
529
  /**
 
530
  * If StoreID = 0 we will not bother to filter...
531
  */
532
  if(isset($storeId) && ! empty($storeId)) {
558
  $customersFiltered = self::intersectByEntityId($tempSubscribed, $customersFiltered);
559
  }
560
  /**
561
+ * FILTER 1 PURCHASED: Depending on whether or not customer has made ​​purchases
562
+  * 0 = all, 1 = those who purchased, 2 = someone who has never purchased
563
  */
564
  $count = 0;
565
  $result = array();
569
  if ($request->getRequest()->getParam('mailupCustomers') > 0) {
570
  foreach ($customersFiltered as $customer) {
571
  $result[] = $customer;
572
+ // Filter orders based on customer id
573
+ $orders = Mage::getResourceModel('sales/order_collection')
574
+ ->addAttributeToFilter('customer_id', $result[$count]['entity_id']);
575
+ Mage::helper('mailup/order')->addStatusFilterToOrders($orders);
576
+
577
+ // Add customer to either purchased or non-purchased array based on whether any orders
578
  if ($orders->getData()) {
579
  $tempPurchased[] = $result[$count];
580
  }
594
  }
595
  }
596
  /**
597
+ * FILTER 1 BY PRODUCT: Based on whether customer purchased a specific product
598
  */
599
  $count = 0;
600
  $result = array();
604
  foreach ($customersFiltered as $customer) {
605
  $result[] = $customer;
606
 
607
+ // Filter orders based on customer id
608
+ $orders = Mage::getResourceModel('sales/order_collection')
609
+ ->addAttributeToFilter('customer_id', $result[$count]['entity_id']);
610
+ Mage::helper('mailup/order')->addStatusFilterToOrders($orders);
 
 
611
 
612
+ $purchasedProduct = 0;
613
  $mailupProductId = Mage::getModel('catalog/product')
614
+ ->getIdBySku($request->getRequest()->getParam('mailupProductSku'));
 
615
 
616
  foreach ($orders->getData() as $order) {
 
 
 
617
  $orderIncrementId = $order['increment_id'];
618
 
619
  //carico i dati di ogni ordine
643
  $customersFiltered = self::intersectByEntityId($tempProduct, $customersFiltered);
644
  }
645
  /**
646
+ * FILTER 3 BY CATEGORY: Depending on whether bought at least one product in a given category
647
  */
648
  $count = 0;
649
  $result = array();
651
  if ($request->getRequest()->getParam('mailupCategoryId') > 0) {
652
  foreach ($customersFiltered as $customer) {
653
  $result[] = $customer;
654
+ // Filter orders based on customer id
655
+ $orders = Mage::getResourceModel('sales/order_collection')
656
+ ->addAttributeToFilter('customer_id', $result[$count]['entity_id']);
657
+ Mage::helper('mailup/order')->addStatusFilterToOrders($orders);
658
+
659
  foreach ($orders->getData() as $order) {
660
+
 
 
661
  $orderIncrementId = $order['increment_id'];
662
 
663
+ // Load data for each order (very slow)
664
  $orderData = Mage::getModel('sales/order')->loadByIncrementID($orderIncrementId);
665
  $items = $orderData->getAllItems();
666
  /**
668
  */
669
  $searchCategories = Mage::helper('mailup')->getSubCategories($request->getRequest()->getParam('mailupCategoryId'));
670
  foreach ($items as $product) {
671
+ $_prod = Mage::getModel('catalog/product')->load($product->getProductId()); // need to load full product for cats.
672
  $productCategories = Mage::getResourceSingleton('catalog/product')->getCategoryIds($_prod);
673
+ $matchingCategories = array_intersect($productCategories, $searchCategories);
674
  if(is_array($matchingCategories) && ! empty($matchingCategories)) {
675
  $tempCategory[] = $result[$count];
676
  break 2;
682
  }
683
  $customersFiltered = self::intersectByEntityId($tempCategory, $customersFiltered);
684
  }
685
+
686
  /**
687
+ * FILTER 4 CUSTOMER GROUP
688
  */
689
  $count = 0;
690
  $result = array();
1146
  {
1147
  $tempIds = array();
1148
  foreach ($array1 as $entity1) {
1149
+ if (isset($entity1['entity_id']))
1150
+ $tempIds[$entity1['entity_id']] = true;
1151
  }
1152
  $tempArray = array();
1153
  foreach ($array2 as $entity2) {
1154
+ if (isset($entity2['entity_id']) && isset($tempIds[$entity2['entity_id']]))
1155
  $tempArray[] = $entity2;
 
1156
  }
1157
 
1158
  return $tempArray;
app/code/local/SevenLike/MailUp/Model/Observer.php CHANGED
@@ -10,6 +10,9 @@ class SevenLike_MailUp_Model_Observer
10
  * @var SevenLike_MailUp_Model_Config
11
  */
12
  protected $_config;
 
 
 
13
 
14
  /**
15
  * Save system config event
@@ -36,26 +39,45 @@ class SevenLike_MailUp_Model_Observer
36
  */
37
  protected function _getSchedule()
38
  {
 
39
  $data = Mage::app()->getRequest()->getPost('groups');
40
  $frequency = !empty($data['mailup']['fields']['mailup_cron_frequency']['value'])?
41
  $data['mailup']['fields']['mailup_cron_frequency']['value']:
 
 
 
42
  0;
43
 
44
- switch ($frequency) {
45
- case SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Frequency::DAILY:
46
- return "0 0 * * *";
47
- case SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Frequency::EVERY_2_HOURS:
48
- return "0 0,2,4,6,8,10,12,14,16,18,20,22 * * *";
49
- case SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Frequency::EVERY_6_HOURS:
50
- return "0 0,6,12,18 * * *";
51
- case SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Frequency::EVERY_12_HOURS:
52
- return "0 0,12 * * *";
53
- case SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Frequency::HOURLY:
54
- default:
55
- return "0 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * *";
56
  }
 
 
 
57
  }
58
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  /**
60
  * Observes: customer_customer_authenticated
61
  *
@@ -106,6 +128,7 @@ class SevenLike_MailUp_Model_Observer
106
  $model->save();
107
  break;
108
  case "in attesa":
 
109
  Mage::getSingleton('core/session')->addNotice(Mage::helper("mailup")->__("Your subscription is waiting for confirmation"));
110
  break;
111
  default:
@@ -120,26 +143,53 @@ class SevenLike_MailUp_Model_Observer
120
 
121
  return $this;
122
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
 
124
  /**
125
  * Observes subscription
126
  *
127
  * @see newsletter_subscriber_save_after
128
- * @param type $observer
129
  * @return \SevenLike_MailUp_Model_Observer
130
  */
131
  public function inviaUtente($observer)
132
  {
133
- if (isset($GLOBALS["__sl_mailup_invia_utente"])) {
 
 
 
134
  return $this;
135
  }
136
- $GLOBALS["__sl_mailup_invia_utente"] = true;
137
-
138
- $model = $observer->getEvent()->getDataObject();
139
  if(Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) {
140
  Mage::log($model->getData());
141
  }
142
- $status = Mage::getModel('newsletter/subscriber')->loadByEmail($model->getEmail())->getStatus();
 
143
 
144
  $module = Mage::app()->getRequest()->getModuleName();
145
  $controller = Mage::app()->getRequest()->getControllerName();
@@ -194,7 +244,8 @@ class SevenLike_MailUp_Model_Observer
194
  }
195
  }
196
  if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) Mage::log("STATO ISCRIZIONE: $status");
197
- if ($status == 1) {
 
198
  $ws = "http://{$console}/frontend/Xmlsubscribe.aspx";
199
  } else {
200
  $ws = "http://{$console}/frontend/Xmlunsubscribe.aspx";
10
  * @var SevenLike_MailUp_Model_Config
11
  */
12
  protected $_config;
13
+
14
+ protected $_beforeSaveCalled = array();
15
+ protected $_afterSaveCalled = array();
16
 
17
  /**
18
  * Save system config event
39
  */
40
  protected function _getSchedule()
41
  {
42
+ // Get frequency and offset from posted data
43
  $data = Mage::app()->getRequest()->getPost('groups');
44
  $frequency = !empty($data['mailup']['fields']['mailup_cron_frequency']['value'])?
45
  $data['mailup']['fields']['mailup_cron_frequency']['value']:
46
+ SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Frequency::HOURLY;
47
+ $offset = !empty($data['mailup']['fields']['mailup_cron_offset']['value'])?
48
+ $data['mailup']['fields']['mailup_cron_offset']['value']:
49
  0;
50
 
51
+ // Get period between calls and calculate explicit hours using this and offset
52
+ $period = SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Frequency::getPeriod($frequency);
53
+ if ($period === null) {
54
+ Mage::log("MailUp: Could not find cron frequency in valid list. Defaulted to hourly", Zend_Log::ERR);
55
+ $period = 1;
 
 
 
 
 
 
 
56
  }
57
+ $hoursStr = $this->_calculateHourFreqString($period, $offset);
58
+
59
+ return "0 {$hoursStr} * * *";
60
  }
61
+
62
+ /**
63
+ * Get comma-separated list of hours in a day spaced by $periodInHours and offset by
64
+ * $offset hours. Note that if $offset is greater than $periodInHours then it loops (modulo)
65
+ *
66
+ * @param int $periodInHours Hours between each call
67
+ * @param int $offset Offset (in hours) for each entry
68
+ * @return string Comma-separated list of hours
69
+ */
70
+ private function _calculateHourFreqString($periodInHours, $offset)
71
+ {
72
+ $hours = array();
73
+ // Repeat as many times as the period fits into 24 hours
74
+ for ($n = 0; $n < (24 / $periodInHours); $n++)
75
+ $hours[] = $n * $periodInHours + ($offset % $periodInHours);
76
+ $hourStr = implode(',', $hours);
77
+
78
+ return $hourStr;
79
+ }
80
+
81
  /**
82
  * Observes: customer_customer_authenticated
83
  *
128
  $model->save();
129
  break;
130
  case "in attesa":
131
+ Mage::getModel('newsletter/subscriber')->loadByEmail($model->getEmail())->setStatus(Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED)->save();
132
  Mage::getSingleton('core/session')->addNotice(Mage::helper("mailup")->__("Your subscription is waiting for confirmation"));
133
  break;
134
  default:
143
 
144
  return $this;
145
  }
146
+
147
+ /**
148
+ * Observes Before save, sets the status based on single or double opt-in
149
+ *
150
+ * @see newsletter_subscriber_save_before
151
+ * @param $observer
152
+ */
153
+ public function beforeSave($observer)
154
+ {
155
+ $model = $observer->getEvent()->getDataObject();
156
+
157
+ $confirm = Mage::getStoreConfig('mailup_newsletter/mailup/require_subscription_confirmation');
158
+
159
+ // If change is to subscribe, and confirmation required, set to confirmation pending
160
+ if ($model->getStatus() == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED && $confirm) {
161
+ // Always change the status
162
+ $model->setStatus(Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED);
163
+ // Ensure that (if called as singleton), this will only get called once per customer
164
+ if (!isset($this->_beforeSaveCalled[$model->getEmail()])) {
165
+ Mage::getSingleton('core/session')->addNotice(Mage::helper("mailup")->__("Your subscription is waiting for confirmation"));
166
+ $this->_beforeSaveCalled[$model->getEmail()] = true;
167
+ }
168
+ }
169
+ }
170
 
171
  /**
172
  * Observes subscription
173
  *
174
  * @see newsletter_subscriber_save_after
175
+ * @param $observer
176
  * @return \SevenLike_MailUp_Model_Observer
177
  */
178
  public function inviaUtente($observer)
179
  {
180
+ $model = $observer->getEvent()->getDataObject();
181
+
182
+ // Ensure that (if called as singleton), this will only get called once per customer
183
+ if (isset($this->_afterSaveCalled[$model->getEmail()])) {
184
  return $this;
185
  }
186
+ $this->_afterSaveCalled[$model->getEmail()] = true;
187
+
 
188
  if(Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) {
189
  Mage::log($model->getData());
190
  }
191
+ $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($model->getEmail());
192
+ $status = $subscriber->getStatus();
193
 
194
  $module = Mage::app()->getRequest()->getModuleName();
195
  $controller = Mage::app()->getRequest()->getControllerName();
244
  }
245
  }
246
  if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) Mage::log("STATO ISCRIZIONE: $status");
247
+ if ($status == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED ||
248
+ $status == Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED) {
249
  $ws = "http://{$console}/frontend/Xmlsubscribe.aspx";
250
  } else {
251
  $ws = "http://{$console}/frontend/Xmlunsubscribe.aspx";
app/code/local/SevenLike/MailUp/Model/Wssend.php CHANGED
@@ -116,8 +116,8 @@ class MailUpWsSend
116
  $fields = null;
117
 
118
  try {
119
- $result = get_object_vars($this->soapClient->GetFields(array('accessKey' => $accessKey)));
120
- $xml = simplexml_load_string($result['GetFieldsResult']);
121
 
122
  if ($xml->Error) {
123
  throw new Exception($xml->Error);
@@ -143,12 +143,14 @@ class MailUpWsSend
143
 
144
  if ($xmlSimpleElement->Fields && sizeof($xmlSimpleElement->Fields->Field) > 0) {
145
  $fields = array();
146
- if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log', $this->storeId)) Mage::log('Fields returned, overwriting default configuration', 0);
 
147
  foreach ($xmlSimpleElement->Fields->Field as $fieldSimpleElement) {
148
  $fields[(string)$fieldSimpleElement['Name']] = (string)$fieldSimpleElement['Id'];
149
  }
150
  }
151
- if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log', $this->storeId)) Mage::log($fields);
 
152
  return $fields;
153
  }
154
 
116
  $fields = null;
117
 
118
  try {
119
+ $result = get_object_vars($this->soapClient->GetFields_st(array('accessKey' => $accessKey)));
120
+ $xml = simplexml_load_string($result['GetFields_stResult']);
121
 
122
  if ($xml->Error) {
123
  throw new Exception($xml->Error);
143
 
144
  if ($xmlSimpleElement->Fields && sizeof($xmlSimpleElement->Fields->Field) > 0) {
145
  $fields = array();
146
+ if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log', $this->storeId))
147
+ Mage::log('Fields returned, overwriting default configuration', Zend_Log::INFO);
148
  foreach ($xmlSimpleElement->Fields->Field as $fieldSimpleElement) {
149
  $fields[(string)$fieldSimpleElement['Name']] = (string)$fieldSimpleElement['Id'];
150
  }
151
  }
152
+ if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log', $this->storeId))
153
+ Mage::log($fields);
154
  return $fields;
155
  }
156
 
app/code/local/SevenLike/MailUp/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <SevenLike_MailUp>
5
- <version>2.4.1</version>
6
  </SevenLike_MailUp>
7
  </modules>
8
  <!-- frontend -->
@@ -96,6 +96,15 @@
96
  </resources>
97
  <!-- events -->
98
  <events>
 
 
 
 
 
 
 
 
 
99
  <newsletter_subscriber_save_after>
100
  <observers>
101
  <mailupinviautente_observer>
@@ -181,7 +190,38 @@
181
  <disablenewslettersuccesses>1</disablenewslettersuccesses>
182
  <require_subscription_confirmation>1</require_subscription_confirmation>
183
  <enable_testmode>0</enable_testmode>
 
 
184
  </mailup>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  </mailup_newsletter>
186
  </default>
187
  <!-- adminhtml -->
2
  <config>
3
  <modules>
4
  <SevenLike_MailUp>
5
+ <version>2.6</version>
6
  </SevenLike_MailUp>
7
  </modules>
8
  <!-- frontend -->
96
  </resources>
97
  <!-- events -->
98
  <events>
99
+ <newsletter_subscriber_save_before>
100
+ <observers>
101
+ <mailup_observer>
102
+ <type>singleton</type>
103
+ <class>SevenLike_MailUp_Model_Observer</class>
104
+ <method>beforeSave</method>
105
+ </mailup_observer>
106
+ </observers>
107
+ </newsletter_subscriber_save_before>
108
  <newsletter_subscriber_save_after>
109
  <observers>
110
  <mailupinviautente_observer>
190
  <disablenewslettersuccesses>1</disablenewslettersuccesses>
191
  <require_subscription_confirmation>1</require_subscription_confirmation>
192
  <enable_testmode>0</enable_testmode>
193
+ <mailup_cron_frequency>0</mailup_cron_frequency>
194
+ <mailup_cron_offset>0</mailup_cron_offset>
195
  </mailup>
196
+ <mailup_mapping>
197
+ <!-- Default mapping from Magento fields (or this extensions mapper) to MailUp fields -->
198
+ <Name>1</Name>
199
+ <Last>2</Last>
200
+ <Email>111</Email>
201
+ <Company>3</Company>
202
+ <Address>9</Address>
203
+ <City>4</City>
204
+ <ZIP>6</ZIP>
205
+ <Province>5</Province>
206
+ <Region>8</Region>
207
+ <LatestAbandonedCartTotal>21</LatestAbandonedCartTotal>
208
+ <LatestAbandonedCartDate>20</LatestAbandonedCartDate>
209
+ <LatestShippedOrderDate>18</LatestShippedOrderDate>
210
+ <LatestShippedOrderID>19</LatestShippedOrderID>
211
+ <AllOrderedProductIDs>26</AllOrderedProductIDs>
212
+ <LatestOrderCategoryIDs>17</LatestOrderCategoryIDs>
213
+ <TotalOrderedLast30d>25</TotalOrderedLast30d>
214
+ <TotalOrderedLast12m>24</TotalOrderedLast12m>
215
+ <TotalOrdered>23</TotalOrdered>
216
+ <LatestAbandonedCartID>22</LatestAbandonedCartID>
217
+ <Gender>10</Gender>
218
+ <CustomerID>12</CustomerID>
219
+ <Phone>11</Phone>
220
+ <LatestOrderAmount>15</LatestOrderAmount>
221
+ <LatestOrderDate>14</LatestOrderDate>
222
+ <LatestOrderID>13</LatestOrderID>
223
+ <LatestOrderProductIDs>16</LatestOrderProductIDs>
224
+ </mailup_mapping>
225
  </mailup_newsletter>
226
  </default>
227
  <!-- adminhtml -->
app/code/local/SevenLike/MailUp/etc/system.xml CHANGED
@@ -39,7 +39,7 @@
39
  <show_in_default>1</show_in_default>
40
  <show_in_website>1</show_in_website>
41
  <show_in_store>1</show_in_store>
42
- <comment>It's the domain portion of the browser address field when you using the MailUp Admin console (e.g. g4a0.s03.it)</comment>
43
  <backend_model>mailup/consoleurlvalidator</backend_model>
44
  </url_console>
45
  <username_ws translate="comment">
@@ -58,7 +58,7 @@
58
  <show_in_default>1</show_in_default>
59
  <show_in_website>1</show_in_website>
60
  <show_in_store>1</show_in_store>
61
- <comment>For assistance visit help.mailup.com and search for "API credentials"</comment>
62
  </password_ws>
63
  <list translate="label comment">
64
  <label>List</label>
@@ -86,7 +86,7 @@
86
  <show_in_default>1</show_in_default>
87
  <show_in_website>1</show_in_website>
88
  <show_in_store>1</show_in_store>
89
- <comment>Double opt-in required</comment>
90
  </require_subscription_confirmation>
91
  <enable_cron_export tranlate="label comment">
92
  <label>Enable Automatic Data Export to MailUp</label>
@@ -97,6 +97,16 @@
97
  <show_in_website>1</show_in_website>
98
  <show_in_store>1</show_in_store>
99
  </enable_cron_export>
 
 
 
 
 
 
 
 
 
 
100
  <mailup_cron_frequency translate="label comment">
101
  <label>Export Frequency</label>
102
  <frontend_type>select</frontend_type>
@@ -106,8 +116,18 @@
106
  <show_in_website>1</show_in_website>
107
  <show_in_store>1</show_in_store>
108
  </mailup_cron_frequency>
 
 
 
 
 
 
 
 
 
 
109
  <webhook_crypt_key>
110
- <label>Webhook crypt key</label>
111
  <frontend_type>text</frontend_type>
112
  <sort_order>100</sort_order>
113
  <show_in_default>1</show_in_default>
@@ -115,7 +135,7 @@
115
  <show_in_store>1</show_in_store>
116
  </webhook_crypt_key>
117
  <enable_log>
118
- <label>Enable module debugging log</label>
119
  <frontend_type>select</frontend_type>
120
  <source_model>adminhtml/system_config_source_yesno</source_model>
121
  <sort_order>110</sort_order>
@@ -131,8 +151,18 @@
131
  <show_in_default>1</show_in_default>
132
  <show_in_website>1</show_in_website>
133
  <show_in_store>1</show_in_store>
134
- <comment>Disable Magento newsletter subscription notification emails</comment>
135
  </disablenewslettersuccesses>
 
 
 
 
 
 
 
 
 
 
136
  </fields>
137
  </mailup>
138
  <!-- mapping section -->
@@ -143,6 +173,7 @@
143
  <show_in_default>1</show_in_default>
144
  <show_in_website>1</show_in_website>
145
  <show_in_store>1</show_in_store>
 
146
  <fields>
147
  <Name translate="comment">
148
  <label>Name</label>
@@ -408,6 +439,28 @@
408
  </AllOrderedProductIDs>
409
  </fields>
410
  </mailup_mapping>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
411
  </groups>
412
  </mailup_newsletter>
413
  </sections>
39
  <show_in_default>1</show_in_default>
40
  <show_in_website>1</show_in_website>
41
  <show_in_store>1</show_in_store>
42
+ <comment>It's the domain portion of the URL to your MailUp Admin console (e.g. g4a0.s03.it)</comment>
43
  <backend_model>mailup/consoleurlvalidator</backend_model>
44
  </url_console>
45
  <username_ws translate="comment">
58
  <show_in_default>1</show_in_default>
59
  <show_in_website>1</show_in_website>
60
  <show_in_store>1</show_in_store>
61
+ <comment>For assistance visit http://help.mailup.com/x/PgAy</comment>
62
  </password_ws>
63
  <list translate="label comment">
64
  <label>List</label>
86
  <show_in_default>1</show_in_default>
87
  <show_in_website>1</show_in_website>
88
  <show_in_store>1</show_in_store>
89
+ <comment>Defines whether double opt-in is required</comment>
90
  </require_subscription_confirmation>
91
  <enable_cron_export tranlate="label comment">
92
  <label>Enable Automatic Data Export to MailUp</label>
97
  <show_in_website>1</show_in_website>
98
  <show_in_store>1</show_in_store>
99
  </enable_cron_export>
100
+ <server_timezone translate="label comment">
101
+ <label>Server Timezone</label>
102
+ <frontend_type>label</frontend_type>
103
+ <frontend_model>mailup/adminhtml_system_config_form_field_timezone</frontend_model>
104
+ <sort_order>85</sort_order>
105
+ <show_in_default>1</show_in_default>
106
+ <show_in_website>1</show_in_website>
107
+ <show_in_store>1</show_in_store>
108
+ <frontend_class>disabled</frontend_class>
109
+ </server_timezone>
110
  <mailup_cron_frequency translate="label comment">
111
  <label>Export Frequency</label>
112
  <frontend_type>select</frontend_type>
116
  <show_in_website>1</show_in_website>
117
  <show_in_store>1</show_in_store>
118
  </mailup_cron_frequency>
119
+ <mailup_cron_offset translate="label comment">
120
+ <label>Export Offset (in hours)</label>
121
+ <frontend_type>text</frontend_type>
122
+ <validate>validate-digits</validate>
123
+ <sort_order>95</sort_order>
124
+ <show_in_default>1</show_in_default>
125
+ <show_in_website>1</show_in_website>
126
+ <show_in_store>1</show_in_store>
127
+ <comment>e.g. Offset of 2 hours and frequency of each 12 hours will run at 02:00 and 14:00</comment>
128
+ </mailup_cron_offset>
129
  <webhook_crypt_key>
130
+ <label>Webhook Crypt Key</label>
131
  <frontend_type>text</frontend_type>
132
  <sort_order>100</sort_order>
133
  <show_in_default>1</show_in_default>
135
  <show_in_store>1</show_in_store>
136
  </webhook_crypt_key>
137
  <enable_log>
138
+ <label>Enable Module Debugging Log</label>
139
  <frontend_type>select</frontend_type>
140
  <source_model>adminhtml/system_config_source_yesno</source_model>
141
  <sort_order>110</sort_order>
151
  <show_in_default>1</show_in_default>
152
  <show_in_website>1</show_in_website>
153
  <show_in_store>1</show_in_store>
154
+ <comment>Disables the default notification sent by Magento</comment>
155
  </disablenewslettersuccesses>
156
+ <qualifying_order_statuses>
157
+ <label>Order Statuses to Match For Customer Totals</label>
158
+ <frontend_type>multiselect</frontend_type>
159
+ <source_model>adminhtml/system_config_source_order_status</source_model>
160
+ <sort_order>130</sort_order>
161
+ <show_in_default>1</show_in_default>
162
+ <show_in_website>1</show_in_website>
163
+ <show_in_store>1</show_in_store>
164
+ <comment>If none set, those that are complete, closed or processing will be matched</comment>
165
+ </qualifying_order_statuses>
166
  </fields>
167
  </mailup>
168
  <!-- mapping section -->
173
  <show_in_default>1</show_in_default>
174
  <show_in_website>1</show_in_website>
175
  <show_in_store>1</show_in_store>
176
+ <comment>Matching Magento customer attributes (on the left) with MailUp attributes (on the right)</comment>
177
  <fields>
178
  <Name translate="comment">
179
  <label>Name</label>
439
  </AllOrderedProductIDs>
440
  </fields>
441
  </mailup_mapping>
442
+ <mailup_mapping_custom translate="label">
443
+ <label>Custom Customer Attributes</label>
444
+ <frontend_type>text</frontend_type>
445
+ <sort_order>10</sort_order>
446
+ <show_in_default>1</show_in_default>
447
+ <show_in_website>1</show_in_website>
448
+ <show_in_store>1</show_in_store>
449
+ <clone_fields>1</clone_fields>
450
+ <clone_model>mailup/adminhtml_system_clone_mappings_custom</clone_model>
451
+ <comment>Matching custom Magento customer attributes (on the left) with MailUp attributes (on the right)</comment>
452
+ <fields>
453
+ <custom_customer_attributes translate="label">
454
+ <label></label>
455
+ <frontend_type>select</frontend_type>
456
+ <source_model>mailup/adminhtml_system_source_fields</source_model>
457
+ <sort_order>10</sort_order>
458
+ <show_in_default>1</show_in_default>
459
+ <show_in_website>1</show_in_website>
460
+ <show_in_store>1</show_in_store>
461
+ </custom_customer_attributes>
462
+ </fields>
463
+ </mailup_mapping_custom>
464
  </groups>
465
  </mailup_newsletter>
466
  </sections>
app/design/adminhtml/default/default/template/sevenlike/mailup/confirm.phtml CHANGED
@@ -90,6 +90,9 @@ $xml = simplexml_load_string($xmlLists);
90
  <?php $listGUID = (string) $list['listGUID'] ?>
91
  <?php endif ?>
92
  <?php endforeach ?>
 
 
 
93
  <form id="edit_form" name="edit_form" method="post" action="<?php echo $this->getUrl('*/*/post')?>">
94
  <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
95
  <input type="hidden" name="store_id" value="<?php echo $this->getRequest()->getParam('store_id'); ?>" />
@@ -187,6 +190,7 @@ $xml = simplexml_load_string($xmlLists);
187
  </table>
188
  </fieldset>
189
  </form>
 
190
 
191
  </div>
192
  <script type="text/javascript">
90
  <?php $listGUID = (string) $list['listGUID'] ?>
91
  <?php endif ?>
92
  <?php endforeach ?>
93
+ <?php if (!isset($idList)): ?>
94
+ <h4><?php echo $this->__('There is no list selected in MailUp config. Please select one.')?></h4>
95
+ <?php else: ?>
96
  <form id="edit_form" name="edit_form" method="post" action="<?php echo $this->getUrl('*/*/post')?>">
97
  <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
98
  <input type="hidden" name="store_id" value="<?php echo $this->getRequest()->getParam('store_id'); ?>" />
190
  </table>
191
  </fieldset>
192
  </form>
193
+ <?php endif; ?>
194
 
195
  </div>
196
  <script type="text/javascript">
app/design/frontend/base/default/layout/mailup.xml CHANGED
@@ -10,10 +10,18 @@
10
  <reference name="root">
11
  <action method="setTemplate">
12
  <template>page/1column.phtml</template>
13
- </action>
14
  </reference>
15
  <reference name="content">
16
  <block type="mailup/index" name="mailup_index" template="mailup/index.phtml"/>
17
  </reference>
18
- </mailup_index_index>
 
 
 
 
 
 
 
 
19
  </layout>
10
  <reference name="root">
11
  <action method="setTemplate">
12
  <template>page/1column.phtml</template>
13
+ </action>
14
  </reference>
15
  <reference name="content">
16
  <block type="mailup/index" name="mailup_index" template="mailup/index.phtml"/>
17
  </reference>
18
+ </mailup_index_index>
19
+
20
+ <customer_account_index>
21
+ <reference name="customer_account_dashboard_info">
22
+ <action method="setTemplate">
23
+ <template>mailup/customer/account/dashboard/info.phtml</template>
24
+ </action>
25
+ </reference>
26
+ </customer_account_index>
27
  </layout>
app/design/frontend/base/default/template/mailup/customer/account/dashboard/info.phtml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="col2-set">
2
+ <div class="col-1">
3
+ <div class="box">
4
+ <div class="box-title">
5
+ <h3><?php echo $this->__('Contact Information') ?></h3>
6
+ <a href="<?php echo $this->getUrl('customer/account/edit') ?>"><?php echo $this->__('Edit') ?></a>
7
+ </div>
8
+ <div class="box-content">
9
+ <p>
10
+ <?php echo $this->escapeHtml($this->getCustomer()->getName()) ?><br />
11
+ <?php echo $this->escapeHtml($this->getCustomer()->getEmail()) ?><br />
12
+ <a href="<?php echo $this->getChangePasswordUrl() ?>"><?php echo $this->__('Change Password') ?></a>
13
+ </p>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ <?php if( $this->isNewsletterEnabled() ): ?>
18
+ <div class="col-2">
19
+ <div class="box">
20
+ <div class="box-title">
21
+ <h3><?php echo $this->__('Newsletters') ?></h3>
22
+ <a href="<?php echo $this->getUrl('newsletter/manage') ?>"><?php echo $this->__('Edit') ?></a>
23
+ </div>
24
+ <div class="box-content">
25
+ <p>
26
+ <?php /** @modification: Checks for subscription status, not just whether subscribed */
27
+ switch( $this->getSubscriptionObject()->getStatus() ) {
28
+ case Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED:
29
+ echo $this->__('You are currently subscribed to "General Subscription"'); break;
30
+ case Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED:
31
+ echo $this->__('Check your email to confirm your subscription to our newsletter.'); break;
32
+ default:
33
+ echo $this->__('You are currently not subscribed to any newsletter.');
34
+ }
35
+ ?>
36
+ </p>
37
+ </div>
38
+ </div>
39
+ <?php /* Extensions placeholder */ ?>
40
+ <?php echo $this->getChildHtml('customer.account.dashboard.info.extra')?>
41
+ </div>
42
+ <?php endif; ?>
43
+ </div>
app/design/frontend/enterprise/default/layout/mailup.xml CHANGED
@@ -5,4 +5,12 @@
5
  <block type="mailup/checkout_subscribe" name="mailup.subscribe" template="mailup/subscribe.phtml" />
6
  </reference>
7
  </checkout_onepage_review>
 
 
 
 
 
 
 
 
8
  </layout>
5
  <block type="mailup/checkout_subscribe" name="mailup.subscribe" template="mailup/subscribe.phtml" />
6
  </reference>
7
  </checkout_onepage_review>
8
+
9
+ <customer_account_index>
10
+ <reference name="customer_account_dashboard_info">
11
+ <action method="setTemplate">
12
+ <template>mailup/customer/account/dashboard/info.phtml</template>
13
+ </action>
14
+ </reference>
15
+ </customer_account_index>
16
  </layout>
app/design/frontend/enterprise/default/template/mailup/customer/account/dashboard/info.phtml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="col2-set">
2
+ <div class="col-1">
3
+ <div class="info-box">
4
+ <h3 class="box-title"><?php echo $this->__('Contact Information') ?> <span class="separator">|</span> <a href="<?php echo $this->getUrl('customer/account/edit') ?>"><?php echo $this->__('Edit') ?></a></h3>
5
+ <p class="box-content">
6
+ <?php echo $this->escapeHtml($this->getCustomer()->getName()) ?><br />
7
+ <?php echo $this->escapeHtml($this->getCustomer()->getEmail()) ?><br />
8
+ <a href="<?php echo $this->getChangePasswordUrl() ?>"><?php echo $this->__('Change Password') ?></a>
9
+ </p>
10
+ </div>
11
+ </div>
12
+ <?php if( $this->isNewsletterEnabled() ): ?>
13
+ <div class="col-2">
14
+ <div class="info-box">
15
+ <h3 class="box-title"><?php echo $this->__('Newsletters') ?> <span class="separator">|</span> <a href="<?php echo $this->getUrl('newsletter/manage') ?>"><?php echo $this->__('Edit') ?></a></h3>
16
+ <p class="box-content">
17
+ <?php /** @modification: Checks for subscription status, not just whether subscribed */
18
+ switch( $this->getSubscriptionObject()->getStatus() ) {
19
+ case Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED:
20
+ echo $this->__('You are currently subscribed to "General Subscription"'); break;
21
+ case Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED:
22
+ echo $this->__('Check your email to confirm your subscription to our newsletter.'); break;
23
+ default:
24
+ echo $this->__('You are currently not subscribed to any newsletter.');
25
+ }
26
+ ?>
27
+ </p>
28
+ </div>
29
+ <?php /* Extensions placeholder */ ?>
30
+ <?php echo $this->getChildHtml('customer.account.dashboard.info.extra')?>
31
+ </div>
32
+ <?php endif; ?>
33
+ </div>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MailUp</name>
4
- <version>2.5.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/academic.php">Academic Free License (AFL)</license>
7
  <channel>community</channel>
@@ -46,15 +46,18 @@
46
  &lt;/ul&gt;&#xD;
47
  &lt;p&gt;&lt;br /&gt;Ad esempio un sito di ecommerce potrebbe alimentare il DB di MailUp con informazioni sugli acquisti e MailUp potr&amp;agrave; quindi inviare, ad esempio dopo 7 giorni dall'acquisto, un messaggio di costumer satisfaction oppure l'invito ad acquistare un prodotto correlato.&lt;/p&gt;</description>
48
  <notes>&lt;ul&gt;&#xD;
49
- &lt;li&gt;Allows Single Opt In as an optional setting&lt;/li&gt;&#xD;
50
- &lt;li&gt;Make "send opt-in email..." unchecked by default&lt;/li&gt;&#xD;
51
- &lt;li&gt;Bug Fix: Cannot overwrite with blank email address&lt;/li&gt;&#xD;
52
- &lt;li&gt;Bug Fix: If incorrect URL or login details entered, checkout could be disrupted&lt;/li&gt;&#xD;
 
 
 
53
  &lt;/ul&gt;</notes>
54
  <authors><author><name>Mailup</name><user>Mailup</user><email>sales@mailup.com</email></author></authors>
55
- <date>2014-04-08</date>
56
- <time>09:43:12</time>
57
- <contents><target name="magelocal"><dir name="SevenLike"><dir name="MailUp"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="Grid.php" hash="6af78ed4eaf0e5e4589080af6e287f1b"/></dir><file name="Log.php" hash="b81d437533b23160e0b9f85844cd45e3"/><dir name="Mailup"><file name="Grid.php" hash="94dccf2de2027ea2d7ba470482c6e56e"/></dir><file name="Mailupbackend.php" hash="142d7d788b131fc32dbf395dd51d1b7f"/><dir name="Sync"><file name="Grid.php" hash="ca011e2cd4012bc6dc27886d07507cf0"/></dir><file name="Sync.php" hash="0c44aecfe6ddbd227e442fd124bd33b2"/></dir><dir name="Checkout"><file name="Subscribe.php" hash="9cd1c87df8a23f93d8bf0995e13652f2"/></dir><file name="Filters.php" hash="f881a202a8d2e3c34b3f1b4094852b2c"/><file name="Index.php" hash="7d5c46e16c94b50f6236d8d0027066d0"/></dir><dir name="Helper"><file name="Data.php" hash="fb22c1ab446b3903662d8239572278e6"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Source"><dir name="Cron"><file name="Frequency.php" hash="2f874a2d82957748f2f249658c7e96f1"/><file name="Hours.php" hash="99b0428a6e88248bf15007396f48b0fc"/></dir><file name="Fields.php" hash="8f1e07f911366478c26b32cd7cef19ad"/></dir></dir></dir><file name="Config.php" hash="34d1eb31205b26e65c929abcbda4494d"/><file name="Consoleurlvalidator.php" hash="2cd27b9d21570e39ef6a5a0bbf3f97c5"/><file name="Cron.php" hash="db67d877c077536d660051535cc66060"/><file name="Job.php" hash="6739a5df8b10248d91d3f2e3dd1ca894"/><file name="Lists.php" hash="3674105d19de12dba1c9f27be65dbeaa"/><file name="Log.php" hash="9e15739c03264cf839a1460ac29f6def"/><file name="MailUp.php" hash="1b552b40a7bf6f4c915667adbe164140"/><file name="MailUpWsImport.php" hash="db5807ba779260b19177287668542df3"/><dir name="Mysql14"><dir name="MailUp"><file name="Collection.php" hash="256485c1ba69eff42ae109d3218c89ff"/></dir><file name="MailUp.php" hash="d06606483ac4c35e42f9cb449a36c1c5"/></dir><dir name="Mysql4"><dir name="Job"><file name="Collection.php" hash="9cdb99926ae73a9c6d5bafee0f2d6042"/></dir><file name="Job.php" hash="244a509b404abb9fc47755aaff8463d9"/><dir name="Log"><file name="Collection.php" hash="4589959dac703289c9a6fdf58a0436a6"/></dir><file name="Log.php" hash="e96fdf661e3060499fa6c6d6f8a69177"/><dir name="Sync"><file name="Collection.php" hash="e05d869a6b953a0a45fec482e4e74562"/></dir><file name="Sync.php" hash="971e196c7c19f215955aac740218be22"/></dir><file name="Observer.php" hash="becad8232256ed26b3832455b83850ec"/><dir name="Source"><file name="Store.php" hash="de1b07b5bd94ae4292377dff5a153340"/></dir><file name="Subscriber.php" hash="877fe0e81d86e8b9b0d9c23ccd5378f2"/><file name="Sync.php" hash="7736a7e1fb38aad61c4e6a5aa89294a2"/><file name="Webserviceusernamevalidator.php" hash="9650aed034726d621968f18371d554bc"/><file name="Ws.php" hash="21ef21afcf35867d0ec8ff345babeab6"/><file name="Wssend.php" hash="759922bc344c79e9a1ab01a1a5fc42b9"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ConfigurationController.php" hash="240d526f2c944b93b78d00d85d4b6c47"/><file name="FieldsmappingController.php" hash="66f0598c537f9518433b99cb7aa9acfe"/><file name="FilterController.php" hash="18812ae48db6286c9a6e0a71e791dc11"/><file name="LogController.php" hash="1300abf084a62b9ed2b00e7f2a632c29"/><file name="MailupbackendController.php" hash="963646cb267f4f4e05efd09be387b834"/><file name="SyncController.php" hash="94e0f9d8f42b609e9b08822d1766f9f8"/><file name="ViewdatatransferlogController.php" hash="eec948994f2d1491ead736578deabf92"/></dir><file name="IndexController.php" hash="d7dfe7ee526df542d7810936a496a1fc"/><file name="TestController.php" hash="bfe840edde428a33526724d812a29661"/><file name="WebhookController.php" hash="ef72fa5602b3f9fec0eae41eb34638a1"/></dir><dir name="etc"><file name="config.xml" hash="a84af1b67fb5b2a475829be94e6f3440"/><file name="system.xml" hash="6413a9eb81975ab3091170436a220d1b"/></dir><dir name="sql"><dir name="mailup_setup"><file name="mysql4-install-0.1.0.php" hash="8e52462c1d0d28f39c1c3f67c3748d26"/><file name="mysql4-install-2.3.0.php" hash="9532dac8b7bbc85f4e13d44816213076"/><file name="mysql4-install-2.4.0.php" hash="df3247d77cf4dff79c7dbf305e5ad9b8"/><file name="mysql4-upgrade-0.1.0-1.0.0.php" hash="8e52462c1d0d28f39c1c3f67c3748d26"/><file name="mysql4-upgrade-0.3.0-1.0.0.php" hash="97e4f8e3ba9e2ab4d5c5757efb3a47de"/><file name="mysql4-upgrade-1.0.0-1.5.2.php" hash="4fda0e9178a6cba85631f4f24faaf71b"/><file name="mysql4-upgrade-2.1.3-2.2.0.php" hash="9d4c89357d75bc526c0a38c8b7108611"/><file name="mysql4-upgrade-2.2.0-2.3.0.php" hash="6b838a9491a8a3d8cd66ec8399667fe3"/><file name="mysql4-upgrade-2.2.1-2.3.0.php" hash="6b838a9491a8a3d8cd66ec8399667fe3"/><file name="mysql4-upgrade-2.3.0-2.3.1.php" hash="d7b7aac558c7bbfcd9f5657342bb8d5d"/><file name="mysql4-upgrade-2.3.1-2.3.2.php" hash="841257c7988bd63828d2fdeaa087eaca"/><file name="mysql4-upgrade-2.3.2-2.4.0.php" hash="df3247d77cf4dff79c7dbf305e5ad9b8"/><file name="mysql4-upgrade-2.4.0-2.4.1.php" hash="812b65d636b1e15d3804c21d134de572"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mailup.xml" hash="1e83a4178884228b5346571152dede1d"/></dir><dir name="template"><dir name="sevenlike"><dir name="mailup"><file name="confirm.phtml" hash="ba22d8b8f370ed7ea5e48e599f8bed5d"/><file name="fieldsmapping.phtml" hash="b0b22c19bc6f9c97b22754dc7a0103ba"/><file name="filter.phtml" hash="9938d917ad94034d581069b08d93c3ca"/><file name="viewdatatransferlog.phtml" hash="fcc13d34146e22630d1a170888b2cc73"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="mailup.xml" hash="8fb6592222c1deacc7120ab474e39cab"/></dir><dir name="template"><dir name="mailup"><file name="index.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="subscribe.phtml" hash="3316f1a2e166179d2631a4a568059d66"/></dir></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="layout"><file name="mailup.xml" hash="dfb8fa89ec00b1b07264d9e2153e097d"/></dir><dir name="template"><dir name="mailup"><file name="subscribe.phtml" hash="a102e2e0dc4c836bc78eb044bf13e172"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="SevenLike_MailUp.xml" hash="28e0d7aac3e7e87c416a779c40b48c3f"/></dir></target><target name="magelocale"><dir name="en_US"><file name="SevenLike_MailUp.csv" hash="ed0b8d49915f1b1d6c40541fe65c45d4"/></dir><dir name="it_IT"><file name="SevenLike_MailUp.csv" hash="746c5012c1659dc21dbeb9e50cb4deb7"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="sevenlike"><dir name="mailup"><dir name="images"><file name="MailUp_300_200_transparent_small.png" hash="fcaf7d0876af346b01e40f3c1eeaa721"/><file name="titoli.png" hash="95a7996cd77d3413fd048018095aec6e"/></dir><file name="mailup.css" hash="cd3e7f45f619c6172de923d688d21dc3"/></dir></dir><dir name="images"><file name="MailUp_300_200_transparent_small.png" hash="fcaf7d0876af346b01e40f3c1eeaa721"/></dir></dir></dir></dir></target></contents>
58
  <compatible/>
59
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
60
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MailUp</name>
4
+ <version>2.6.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/academic.php">Academic Free License (AFL)</license>
7
  <channel>community</channel>
46
  &lt;/ul&gt;&#xD;
47
  &lt;p&gt;&lt;br /&gt;Ad esempio un sito di ecommerce potrebbe alimentare il DB di MailUp con informazioni sugli acquisti e MailUp potr&amp;agrave; quindi inviare, ad esempio dopo 7 giorni dall'acquisto, un messaggio di costumer satisfaction oppure l'invito ad acquistare un prodotto correlato.&lt;/p&gt;</description>
48
  <notes>&lt;ul&gt;&#xD;
49
+ &lt;li&gt;Custom customer attribute mapping&lt;/li&gt;&#xD;
50
+ &lt;li&gt;Recipient fields are automatically mapped for new installations&lt;/li&gt;&#xD;
51
+ &lt;li&gt;MailUp recipient fields sync as soon as login details are saved&lt;/li&gt;&#xD;
52
+ &lt;li&gt;Select which statuses are used to find orders for filters and totals&lt;/li&gt;&#xD;
53
+ &lt;li&gt;Sync offset in hours for cron&lt;/li&gt;&#xD;
54
+ &lt;li&gt;Displays accurate pending message in customer dashboard if double opt-in used&lt;/li&gt;&#xD;
55
+ &lt;li&gt;Bug Fix: Filter by category returns all matching customers&lt;/li&gt;&#xD;
56
  &lt;/ul&gt;</notes>
57
  <authors><author><name>Mailup</name><user>Mailup</user><email>sales@mailup.com</email></author></authors>
58
+ <date>2014-05-14</date>
59
+ <time>10:58:21</time>
60
+ <contents><target name="magelocal"><dir name="SevenLike"><dir name="MailUp"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="Grid.php" hash="6af78ed4eaf0e5e4589080af6e287f1b"/></dir><file name="Log.php" hash="b81d437533b23160e0b9f85844cd45e3"/><dir name="Mailup"><file name="Grid.php" hash="94dccf2de2027ea2d7ba470482c6e56e"/></dir><file name="Mailupbackend.php" hash="142d7d788b131fc32dbf395dd51d1b7f"/><dir name="Sync"><file name="Grid.php" hash="ca011e2cd4012bc6dc27886d07507cf0"/></dir><file name="Sync.php" hash="0c44aecfe6ddbd227e442fd124bd33b2"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Timezone.php" hash="c6140fcdd82a4e336be9c6f2ffa49949"/></dir></dir></dir></dir></dir><dir name="Checkout"><file name="Subscribe.php" hash="9cd1c87df8a23f93d8bf0995e13652f2"/></dir><file name="Filters.php" hash="f881a202a8d2e3c34b3f1b4094852b2c"/><file name="Index.php" hash="7d5c46e16c94b50f6236d8d0027066d0"/></dir><dir name="Helper"><file name="Customer.php" hash="c2657e1af95b572d536d892e1bf74b9c"/><file name="Data.php" hash="3d1af6565f71ed9c52739537b17e9bc5"/><file name="Order.php" hash="919848a9fd6952f1df90c4b73500ed61"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Clone"><dir name="Mappings"><file name="Custom.php" hash="43d286b59d67ef1a0f15cc74f46f95a1"/></dir></dir><dir name="Source"><dir name="Cron"><file name="Frequency.php" hash="0bdd434c98ce97bfe7db1d79a96c1b25"/><file name="Hours.php" hash="99b0428a6e88248bf15007396f48b0fc"/></dir><file name="Fields.php" hash="f692f935af7c3ca442a5945a16d6e450"/></dir><file name=".DS_Store" hash="699eb0995de74828d9f23655e826e581"/></dir><file name=".DS_Store" hash="173bd8294aed6b0b02e19ffb8e68cbd5"/></dir><file name="Config.php" hash="5fb0bb4c012ee7dde1f37b71f3a350f4"/><file name="Consoleurlvalidator.php" hash="2cd27b9d21570e39ef6a5a0bbf3f97c5"/><file name="Cron.php" hash="db67d877c077536d660051535cc66060"/><file name="Job.php" hash="6739a5df8b10248d91d3f2e3dd1ca894"/><file name="Lists.php" hash="c7e14b69d39ff8d9c78fb972168b7860"/><file name="Log.php" hash="9e15739c03264cf839a1460ac29f6def"/><file name="MailUp.php" hash="1b552b40a7bf6f4c915667adbe164140"/><file name="MailUpWsImport.php" hash="edfd6d6df0892ebc0f83350bd1825ca3"/><dir name="Mysql14"><dir name="MailUp"><file name="Collection.php" hash="256485c1ba69eff42ae109d3218c89ff"/></dir><file name="MailUp.php" hash="d06606483ac4c35e42f9cb449a36c1c5"/></dir><dir name="Mysql4"><dir name="Job"><file name="Collection.php" hash="9cdb99926ae73a9c6d5bafee0f2d6042"/></dir><file name="Job.php" hash="244a509b404abb9fc47755aaff8463d9"/><dir name="Log"><file name="Collection.php" hash="4589959dac703289c9a6fdf58a0436a6"/></dir><file name="Log.php" hash="e96fdf661e3060499fa6c6d6f8a69177"/><dir name="Sync"><file name="Collection.php" hash="e05d869a6b953a0a45fec482e4e74562"/></dir><file name="Sync.php" hash="971e196c7c19f215955aac740218be22"/></dir><file name="Observer.php" hash="6f64b4d6af36cc77f8cec2a166ebd0a9"/><dir name="Source"><file name="Store.php" hash="de1b07b5bd94ae4292377dff5a153340"/></dir><file name="Subscriber.php" hash="877fe0e81d86e8b9b0d9c23ccd5378f2"/><file name="Sync.php" hash="7736a7e1fb38aad61c4e6a5aa89294a2"/><file name="Webserviceusernamevalidator.php" hash="9650aed034726d621968f18371d554bc"/><file name="Ws.php" hash="21ef21afcf35867d0ec8ff345babeab6"/><file name="Wssend.php" hash="2aa70db9b522d262b45f63c8cfcd1bbc"/><file name=".DS_Store" hash="6f2c4920df9dd2405271ef9b6495cacc"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ConfigurationController.php" hash="240d526f2c944b93b78d00d85d4b6c47"/><file name="FieldsmappingController.php" hash="66f0598c537f9518433b99cb7aa9acfe"/><file name="FilterController.php" hash="18812ae48db6286c9a6e0a71e791dc11"/><file name="LogController.php" hash="1300abf084a62b9ed2b00e7f2a632c29"/><file name="MailupbackendController.php" hash="963646cb267f4f4e05efd09be387b834"/><file name="SyncController.php" hash="94e0f9d8f42b609e9b08822d1766f9f8"/><file name="ViewdatatransferlogController.php" hash="eec948994f2d1491ead736578deabf92"/></dir><file name="IndexController.php" hash="d7dfe7ee526df542d7810936a496a1fc"/><file name="TestController.php" hash="bfe840edde428a33526724d812a29661"/><file name="WebhookController.php" hash="ef72fa5602b3f9fec0eae41eb34638a1"/></dir><dir name="etc"><file name="config.xml" hash="6d89b6c3edbe6ad204967215919436df"/><file name="system.xml" hash="ba559125f849eab3e7491f80b35d6993"/></dir><dir name="sql"><dir name="mailup_setup"><file name="mysql4-install-0.1.0.php" hash="8e52462c1d0d28f39c1c3f67c3748d26"/><file name="mysql4-install-2.3.0.php" hash="9532dac8b7bbc85f4e13d44816213076"/><file name="mysql4-install-2.4.0.php" hash="df3247d77cf4dff79c7dbf305e5ad9b8"/><file name="mysql4-upgrade-0.1.0-1.0.0.php" hash="8e52462c1d0d28f39c1c3f67c3748d26"/><file name="mysql4-upgrade-0.3.0-1.0.0.php" hash="97e4f8e3ba9e2ab4d5c5757efb3a47de"/><file name="mysql4-upgrade-1.0.0-1.5.2.php" hash="4fda0e9178a6cba85631f4f24faaf71b"/><file name="mysql4-upgrade-2.1.3-2.2.0.php" hash="9d4c89357d75bc526c0a38c8b7108611"/><file name="mysql4-upgrade-2.2.0-2.3.0.php" hash="6b838a9491a8a3d8cd66ec8399667fe3"/><file name="mysql4-upgrade-2.2.1-2.3.0.php" hash="6b838a9491a8a3d8cd66ec8399667fe3"/><file name="mysql4-upgrade-2.3.0-2.3.1.php" hash="d7b7aac558c7bbfcd9f5657342bb8d5d"/><file name="mysql4-upgrade-2.3.1-2.3.2.php" hash="841257c7988bd63828d2fdeaa087eaca"/><file name="mysql4-upgrade-2.3.2-2.4.0.php" hash="df3247d77cf4dff79c7dbf305e5ad9b8"/><file name="mysql4-upgrade-2.4.0-2.4.1.php" hash="812b65d636b1e15d3804c21d134de572"/></dir></dir><file name=".DS_Store" hash="e49cca224ac24efb7898b1adf5d52aaf"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mailup.xml" hash="1e83a4178884228b5346571152dede1d"/></dir><dir name="template"><dir name="sevenlike"><dir name="mailup"><file name="confirm.phtml" hash="1f2af2e10a35f639044e3a4fbd865788"/><file name="fieldsmapping.phtml" hash="b0b22c19bc6f9c97b22754dc7a0103ba"/><file name="filter.phtml" hash="9938d917ad94034d581069b08d93c3ca"/><file name="viewdatatransferlog.phtml" hash="fcc13d34146e22630d1a170888b2cc73"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="mailup.xml" hash="e1bdb69f2ad9a1c67d06e786e08905bd"/></dir><dir name="template"><dir name="mailup"><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="1ecb6cf1173e15ba491279f6967498f2"/></dir></dir></dir><file name="index.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="subscribe.phtml" hash="3316f1a2e166179d2631a4a568059d66"/></dir></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="layout"><file name="mailup.xml" hash="1251bb9bdafdb8c5799ff3f78fa960d6"/></dir><dir name="template"><dir name="mailup"><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="6b5e29196f0176c1c76e560f9f8346cb"/></dir></dir></dir><file name="subscribe.phtml" hash="a102e2e0dc4c836bc78eb044bf13e172"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="SevenLike_MailUp.xml" hash="28e0d7aac3e7e87c416a779c40b48c3f"/></dir></target><target name="magelocale"><dir name="en_US"><file name="SevenLike_MailUp.csv" hash="ed0b8d49915f1b1d6c40541fe65c45d4"/></dir><dir name="it_IT"><file name="SevenLike_MailUp.csv" hash="746c5012c1659dc21dbeb9e50cb4deb7"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="sevenlike"><dir name="mailup"><dir name="images"><file name="MailUp_300_200_transparent_small.png" hash="fcaf7d0876af346b01e40f3c1eeaa721"/><file name="titoli.png" hash="95a7996cd77d3413fd048018095aec6e"/></dir><file name="mailup.css" hash="cd3e7f45f619c6172de923d688d21dc3"/></dir></dir><dir name="images"><file name="MailUp_300_200_transparent_small.png" hash="fcaf7d0876af346b01e40f3c1eeaa721"/></dir></dir></dir></dir></target></contents>
61
  <compatible/>
62
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
63
  </package>