MailUp - Version 2.7.2

Version Notes


  • Bug fix: Customer updates are merged into larger jobs to reduce the number of syncs run

  • Bug fix: Chosen schedule now always used overriding the default schedule

  • Bug fix: Per-store autosync settings used to set customers for sync and send jobs via cron

  • Bug fix: Unconfirmed subscribers shown as subscribed in customer account area and admin customer view, removing possibility of accidental unsubscription

  • Syncs customers that are awaiting confirmation so that when they confirm their details are correct

  • If synching is stopped part way through for any reason, it will be automatically restarted at next cron

  • Customers are added to sync queue when saved on front-end or admin

Download this release

Release Info

Developer MailUp
Extension MailUp
Version 2.7.2
Comparing to
See all releases


Code changes from version 2.7.1 to 2.7.2

app/code/local/MailUp/MailUpSync/Helper/Data.php CHANGED
@@ -214,7 +214,17 @@ class MailUp_MailUpSync_Helper_Data extends Mage_Core_Helper_Abstract
214
  $code = $attribute->getAttributeCode() . '_custom_customer_attributes';
215
  $value = $customer->getData($attribute->getAttributeCode());
216
  if ($attribute->usesSource()) {
217
- $toSend[$i][$code] = $attribute->getSource()->getOptionText($value);
 
 
 
 
 
 
 
 
 
 
218
  } else {
219
  $toSend[$i][$code] = $value;
220
  }
@@ -585,13 +595,9 @@ class MailUp_MailUpSync_Helper_Data extends Mage_Core_Helper_Abstract
585
  }
586
 
587
  foreach($mappings as $mapTo => $mapFrom) {
588
- if(isset($fields_mapping[$mapTo]) && ! empty($fields_mapping[$mapTo])) {
589
  $mappedData[$fields_mapping[$mapTo]] = '<campo'.$fields_mapping[$mapTo].'>'. "<![CDATA[". $subscriber[$mapFrom] ."]]>". '</campo'.$fields_mapping[$mapTo].'>';
590
  }
591
- elseif( ! empty($fields_mapping[$mapTo])) {
592
- $mappedData[$fields_mapping[$mapTo]] = '<campo'.$fields_mapping[$mapTo].'>'. '" "'. '</campo'.$fields_mapping[$mapTo].'>';
593
- }
594
- //else {}
595
  }
596
 
597
  // No point in continuing if there is no mapped data
@@ -915,20 +921,56 @@ class MailUp_MailUpSync_Helper_Data extends Mage_Core_Helper_Abstract
915
  }
916
 
917
  /**
918
- * Is Someone a subscriber?
919
  *
920
  * @param int
921
  * @param int
922
  * @return bool
923
  */
924
  public function isSubscriber($customerId, $storeId)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
925
  {
926
  $customerId = (int) $customerId;
927
  $storeId = (int) $storeId;
 
 
 
 
 
928
  $table = Mage::getSingleton('core/resource')->getTableName('newsletter_subscriber');
929
- $connection = Mage::getSingleton('core/resource')->getConnection('core_read');
930
- //$sql = "SELECT * FROM {$table} WHERE customer_id = '{$customerId}' AND store_id = '{$storeId}'";
931
- // Issue with magento, it seems to only subscribe on a websote leve, not store level!
932
  $sql = "SELECT * FROM {$table} WHERE customer_id = '{$customerId}'";
933
  try {
934
  $result = $connection->fetchAll($sql); // array
@@ -936,14 +978,15 @@ class MailUp_MailUpSync_Helper_Data extends Mage_Core_Helper_Abstract
936
  return FALSE;
937
  }
938
  $result = $result[0];
939
-
940
- return $result['subscriber_status'] == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED;
941
- }
 
942
  catch(Exception $e){
943
  Mage::log($e->getMessage());
944
  }
945
-
946
- return FALSE;
947
  }
948
 
949
  /**
@@ -961,13 +1004,6 @@ class MailUp_MailUpSync_Helper_Data extends Mage_Core_Helper_Abstract
961
  "created_at" => gmdate("Y-m-d H:i:s"),
962
  "scheduled_at" => $when
963
  ));
964
-
965
- /*$schedule = Mage::getModel('cron/schedule');
966
- $schedule->setJobCode($jobCode)
967
- ->setCreatedAt($timecreated)
968
- ->setScheduledAt($timescheduled)
969
- ->setStatus(Mage_Cron_Model_Schedule::STATUS_PENDING)
970
- ->save();*/
971
  }
972
 
973
  /**
214
  $code = $attribute->getAttributeCode() . '_custom_customer_attributes';
215
  $value = $customer->getData($attribute->getAttributeCode());
216
  if ($attribute->usesSource()) {
217
+ /* Attempt to get source model. As we cannot trust customers to have not leave broken
218
+ attributes with invalid source models around, we will test this directly */
219
+ $source = Mage::getModel($attribute->getSourceModel());
220
+ if ($source == false) {
221
+ if ($config->isLogEnabled()) {
222
+ $config->log('Invalid source model for attribute ' . $attribute->getAttributeCode());
223
+ }
224
+ $toSend[$i][$code] = null;
225
+ } else {
226
+ $toSend[$i][$code] = $attribute->getSource()->getOptionText($value);
227
+ }
228
  } else {
229
  $toSend[$i][$code] = $value;
230
  }
595
  }
596
 
597
  foreach($mappings as $mapTo => $mapFrom) {
598
+ if (isset($fields_mapping[$mapTo]) && !empty($fields_mapping[$mapTo])) {
599
  $mappedData[$fields_mapping[$mapTo]] = '<campo'.$fields_mapping[$mapTo].'>'. "<![CDATA[". $subscriber[$mapFrom] ."]]>". '</campo'.$fields_mapping[$mapTo].'>';
600
  }
 
 
 
 
601
  }
602
 
603
  // No point in continuing if there is no mapped data
921
  }
922
 
923
  /**
924
+ * Is someone a subscriber?
925
  *
926
  * @param int
927
  * @param int
928
  * @return bool
929
  */
930
  public function isSubscriber($customerId, $storeId)
931
+ {
932
+ $statuses = array(
933
+ Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED
934
+ );
935
+ return $this->_isSubscriberInStatus($customerId, $statuses, $storeId);
936
+ }
937
+
938
+ /**
939
+ * Is someone a subscriber or unconfirmed?
940
+ *
941
+ * @param int
942
+ * @param int
943
+ * @return bool
944
+ */
945
+ public function isSubscriberOrWaiting($customerId, $storeId)
946
+ {
947
+ $statuses = array(
948
+ Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED,
949
+ Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED
950
+ );
951
+ return $this->_isSubscriberInStatus($customerId, $statuses, $storeId);
952
+ }
953
+
954
+ /**
955
+ * Is the given customer a subscriber with the given status?
956
+ * Note that an empty set of statuses will just return true
957
+ *
958
+ * @param $customerId
959
+ * @param array $statuses
960
+ * @param $storeId
961
+ * @return bool|mixed
962
+ */
963
+ protected function _isSubscriberInStatus($customerId, array $statuses, $storeId)
964
  {
965
  $customerId = (int) $customerId;
966
  $storeId = (int) $storeId;
967
+
968
+ // If no status set given, just return true
969
+ if (empty($statuses))
970
+ return true;
971
+
972
  $table = Mage::getSingleton('core/resource')->getTableName('newsletter_subscriber');
973
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_read');
 
 
974
  $sql = "SELECT * FROM {$table} WHERE customer_id = '{$customerId}'";
975
  try {
976
  $result = $connection->fetchAll($sql); // array
978
  return FALSE;
979
  }
980
  $result = $result[0];
981
+
982
+ // Return whether status is in given set
983
+ return (array_search($result['subscriber_status'], $statuses) !== false);
984
+ }
985
  catch(Exception $e){
986
  Mage::log($e->getMessage());
987
  }
988
+
989
+ return false;
990
  }
991
 
992
  /**
1004
  "created_at" => gmdate("Y-m-d H:i:s"),
1005
  "scheduled_at" => $when
1006
  ));
 
 
 
 
 
 
 
1007
  }
1008
 
1009
  /**
app/code/local/MailUp/MailUpSync/Model/Cron.php CHANGED
@@ -9,6 +9,7 @@ require_once dirname(__FILE__) . "/Wssend.php";
9
 
10
  class MailUp_MailUpSync_Model_Cron
11
  {
 
12
  /**
13
  * Run the Task
14
  *
@@ -23,75 +24,87 @@ class MailUp_MailUpSync_Model_Cron
23
  $this->_config()->dbLog("Cron [Triggered]");
24
  }
25
 
26
- if ($this->_config()->isCronExportEnabled()) {
27
- /**
28
- * This doesn't exist in 1.3.2!
29
- */
30
- $indexProcess = new Mage_Index_Model_Process();
31
- $indexProcess->setId("mailupcronrun");
32
- if ($indexProcess->isLocked()) {
33
- $this->_config()->log('MAILUP: cron already running or locked');
34
- return false;
35
- }
36
- $indexProcess->lockAndBlock();
37
-
 
 
 
 
 
38
  require_once dirname(__FILE__) . '/../Helper/Data.php';
39
- $db_read = Mage::getSingleton('core/resource')->getConnection('core_read');
40
- $db_write = Mage::getSingleton('core/resource')->getConnection('core_write');
41
  $syncTableName = Mage::getSingleton('core/resource')->getTableName('mailup/sync');
42
  $jobsTableName = Mage::getSingleton('core/resource')->getTableName('mailup/job');
43
- $lastsync = gmdate("Y-m-d H:i:s");
44
- // reading customers (jobid == 0, their updates)
45
- $customer_entity_table_name = Mage::getSingleton('core/resource')->getTableName('customer_entity');
46
 
47
  /**
48
  * Now Handle Jobs we need to Sync, and all customers attached to each job
49
  */
50
- foreach(Mage::getModel('mailup/job')->fetchQueuedJobsCollection() as $jobModel) {
51
  /* @var $jobModel MailUp_MailUpSync_Model_Job */
52
  $job = $jobModel->getData();
53
- $stmt = $db_write->query(
54
- "UPDATE {$jobsTableName}
55
- SET status='started', start_datetime='" . gmdate("Y-m-d H:i:s") . "'
 
 
 
 
 
 
 
 
 
56
  WHERE id={$job["id"]}"
57
  );
58
- $storeId = isset($job['store_id']) ? $job['store_id'] : NULL;
59
- //$storeId = Mage::app()->getDefaultStoreView()->getStoreId(); // Fallback incase not set?!?
60
- $customers = array();
61
- $job['mailupNewGroup'] = 0;
62
- $job['mailupIdList'] = Mage::getStoreConfig('mailup_newsletter/mailup/list', $storeId);
63
- $job["mailupGroupId"] = $job["mailupgroupid"];
64
- $job["send_optin_email_to_new_subscribers"] = $job["send_optin"];
65
 
66
  // If group is 0 and there is a default group, set group to this group
67
  $defaultGroupId = Mage::getStoreConfig('mailup_newsletter/mailup/default_group');
68
  if ($job["mailupGroupId"] == 0 && $defaultGroupId !== null) {
69
  $job["mailupGroupId"] = $defaultGroupId;
70
  }
71
-
72
- $tmp = Mage::getSingleton('mailup/source_lists');
73
- $tmp = $tmp->toOptionArray($storeId); // pass store id!
74
- foreach ($tmp as $t) {
75
- if ($t["value"] == $job['mailupIdList']) {
76
- $job['mailupListGUID'] = $t["guid"];
77
- $job["groups"] = $t["groups"];
78
- break;
79
- }
80
- }
81
- unset($tmp);
82
  unset($t);
83
- $stmt = $db_read->query("
84
- SELECT ms.*, ce.email
85
- FROM {$syncTableName} ms
86
- JOIN $customer_entity_table_name ce
87
- ON (ms.customer_id = ce.entity_id)
88
- WHERE ms.needs_sync=1
89
- AND ms.entity='customer'
90
  AND job_id={$job["id"]}"
91
  );
92
- while ($row = $stmt->fetch()) {
93
- $customers[] = $row["customer_id"];
94
- }
95
  /**
96
  * Send the Data!
97
  */
@@ -99,21 +112,21 @@ class MailUp_MailUpSync_Model_Cron
99
  /**
100
  * Check return OK
101
  */
102
- if($returnCode === 0) {
103
  $customerCount = count($customers);
104
  $db_write->query("
105
- UPDATE {$syncTableName} SET needs_sync=0, last_sync='$lastsync'
106
- WHERE job_id = {$job["id"]}
107
  AND entity='customer'"
108
  );
109
  $this->_config()->dbLog("Job Task [update] [Synced] [customer count:{$customerCount}]", $job["id"], $storeId);
110
- // finishing the job also
111
- $db_write->query("
112
- UPDATE {$jobsTableName} SET status='finished', finish_datetime='" . gmdate("Y-m-d H:i:s") . "'
113
  WHERE id={$job["id"]}"
114
  );
115
  $this->_config()->dbLog("Jobs [Update] [Complete] [{$job["id"]}]", $job["id"], $storeId);
116
- }
117
  /**
118
  * Only successfull if we get 0 back. False is also a fail.
119
  */
@@ -125,15 +138,41 @@ class MailUp_MailUpSync_Model_Cron
125
  $this->_config()->dbLog(sprintf("generateAndSendCustomers [ReturnCode] [ERROR] [%d]", $returnCode), $job["id"], $storeId);
126
  }
127
  }
128
- }
129
-
130
- $indexProcess->unlock();
 
 
131
  }
 
 
132
 
133
  if ($this->_config()->isLogEnabled()) {
134
  $this->_config()->dbLog("Cron [Completed]");
135
  }
136
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
 
138
  /**
139
  * Run Auto Sync Jobs
9
 
10
  class MailUp_MailUpSync_Model_Cron
11
  {
12
+ const LOCK_INDEX_ID = "mailupcronrun";
13
  /**
14
  * Run the Task
15
  *
24
  $this->_config()->dbLog("Cron [Triggered]");
25
  }
26
 
27
+ /**
28
+ * This doesn't exist in 1.3.2!
29
+ */
30
+ $indexProcess = new Mage_Index_Model_Process();
31
+ $indexProcess->setId(self::LOCK_INDEX_ID);
32
+ if ($indexProcess->isLocked()) {
33
+ // Check how old the lock is - unlock after 1hr
34
+ if ($this->_lockIsOld(self::LOCK_INDEX_ID)) {
35
+ $indexProcess->unlock();
36
+ } else {
37
+ $this->_config()->log('MAILUP: cron already running or locked');
38
+ return false;
39
+ }
40
+ }
41
+ $indexProcess->lockAndBlock();
42
+
43
+ try {
44
  require_once dirname(__FILE__) . '/../Helper/Data.php';
45
+ $db_read = Mage::getSingleton('core/resource')->getConnection('core_read');
46
+ $db_write = Mage::getSingleton('core/resource')->getConnection('core_write');
47
  $syncTableName = Mage::getSingleton('core/resource')->getTableName('mailup/sync');
48
  $jobsTableName = Mage::getSingleton('core/resource')->getTableName('mailup/job');
49
+ $lastsync = gmdate("Y-m-d H:i:s");
50
+ // reading customers (jobid == 0, their updates)
51
+ $customer_entity_table_name = Mage::getSingleton('core/resource')->getTableName('customer_entity');
52
 
53
  /**
54
  * Now Handle Jobs we need to Sync, and all customers attached to each job
55
  */
56
+ foreach(Mage::getModel('mailup/job')->fetchQueuedOrStartedJobsCollection() as $jobModel) {
57
  /* @var $jobModel MailUp_MailUpSync_Model_Job */
58
  $job = $jobModel->getData();
59
+
60
+ $storeId = isset($job['store_id']) ? $job['store_id'] : NULL;
61
+
62
+ // If job is auto-sync and cron is not enabled for the job's site, skip the job
63
+ if ($jobModel->isAutoSync() && ! $this->_config()->isCronExportEnabled($storeId)) {
64
+ $this->_config()->dbLog("Auto-Task skipped as auto-sync disabled for site", $job["id"], $storeId);
65
+ continue;
66
+ }
67
+
68
+ $stmt = $db_write->query(
69
+ "UPDATE {$jobsTableName}
70
+ SET status='started', start_datetime='" . gmdate("Y-m-d H:i:s") . "'
71
  WHERE id={$job["id"]}"
72
  );
73
+ $customers = array();
74
+ $job['mailupNewGroup'] = 0;
75
+ $job['mailupIdList'] = Mage::getStoreConfig('mailup_newsletter/mailup/list', $storeId);
76
+ $job["mailupGroupId"] = $job["mailupgroupid"];
77
+ $job["send_optin_email_to_new_subscribers"] = $job["send_optin"];
 
 
78
 
79
  // If group is 0 and there is a default group, set group to this group
80
  $defaultGroupId = Mage::getStoreConfig('mailup_newsletter/mailup/default_group');
81
  if ($job["mailupGroupId"] == 0 && $defaultGroupId !== null) {
82
  $job["mailupGroupId"] = $defaultGroupId;
83
  }
84
+
85
+ $tmp = Mage::getSingleton('mailup/source_lists');
86
+ $tmp = $tmp->toOptionArray($storeId); // pass store id!
87
+ foreach ($tmp as $t) {
88
+ if ($t["value"] == $job['mailupIdList']) {
89
+ $job['mailupListGUID'] = $t["guid"];
90
+ $job["groups"] = $t["groups"];
91
+ break;
92
+ }
93
+ }
94
+ unset($tmp);
95
  unset($t);
96
+ $stmt = $db_read->query("
97
+ SELECT ms.*, ce.email
98
+ FROM {$syncTableName} ms
99
+ JOIN $customer_entity_table_name ce
100
+ ON (ms.customer_id = ce.entity_id)
101
+ WHERE ms.needs_sync=1
102
+ AND ms.entity='customer'
103
  AND job_id={$job["id"]}"
104
  );
105
+ while ($row = $stmt->fetch()) {
106
+ $customers[] = $row["customer_id"];
107
+ }
108
  /**
109
  * Send the Data!
110
  */
112
  /**
113
  * Check return OK
114
  */
115
+ if($returnCode === 0) {
116
  $customerCount = count($customers);
117
  $db_write->query("
118
+ UPDATE {$syncTableName} SET needs_sync=0, last_sync='$lastsync'
119
+ WHERE job_id = {$job["id"]}
120
  AND entity='customer'"
121
  );
122
  $this->_config()->dbLog("Job Task [update] [Synced] [customer count:{$customerCount}]", $job["id"], $storeId);
123
+ // finishing the job also
124
+ $db_write->query("
125
+ UPDATE {$jobsTableName} SET status='finished', finish_datetime='" . gmdate("Y-m-d H:i:s") . "'
126
  WHERE id={$job["id"]}"
127
  );
128
  $this->_config()->dbLog("Jobs [Update] [Complete] [{$job["id"]}]", $job["id"], $storeId);
129
+ }
130
  /**
131
  * Only successfull if we get 0 back. False is also a fail.
132
  */
138
  $this->_config()->dbLog(sprintf("generateAndSendCustomers [ReturnCode] [ERROR] [%d]", $returnCode), $job["id"], $storeId);
139
  }
140
  }
141
+ }
142
+ } catch (Exception $e) {
143
+ // In case of otherwise uncaught error, unlock and re-throw
144
+ $indexProcess->unlock();
145
+ throw $e;
146
  }
147
+
148
+ $indexProcess->unlock();
149
 
150
  if ($this->_config()->isLogEnabled()) {
151
  $this->_config()->dbLog("Cron [Completed]");
152
  }
153
  }
154
+
155
+ /**
156
+ * Whether a given file was modified over $hoursOld ago
157
+ *
158
+ * @param string $id
159
+ * @param int $hoursOld
160
+ * @return bool
161
+ */
162
+ protected function _lockIsOld($id, $hoursOld=1)
163
+ {
164
+ $varDir = Mage::getConfig()->getVarDir('locks');
165
+ $filename = $varDir . DS . 'index_process_' . $id . '.lock';
166
+ if (!is_file($filename)) {
167
+ return true;
168
+ }
169
+ if (time()-filemtime($filename) > $hoursOld * 3600) {
170
+ return true;
171
+ }
172
+
173
+ // File exists and is less than the specified number of hours old
174
+ return false;
175
+ }
176
 
177
  /**
178
  * Run Auto Sync Jobs
app/code/local/MailUp/MailUpSync/Model/Job.php CHANGED
@@ -134,6 +134,28 @@ class MailUp_MailUpSync_Model_Job extends Mage_Core_Model_Abstract
134
 
135
  return $collection;
136
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
 
138
  /**
139
  * Get a collection of jobs in the Queue
@@ -186,4 +208,14 @@ class MailUp_MailUpSync_Model_Job extends Mage_Core_Model_Abstract
186
 
187
  return $this;
188
  }
 
 
 
 
 
 
 
 
 
 
189
  }
134
 
135
  return $collection;
136
  }
137
+
138
+ /**
139
+ * Get a collection of jobs in the Queue marked as Queued or Started
140
+ *
141
+ * @param int
142
+ * @return MailUp_MailUpSync_Model_Mysql4_Job_Collection
143
+ */
144
+ public function fetchQueuedOrStartedJobsCollection($type = NULL)
145
+ {
146
+ $collection = $this->getCollection();
147
+ /* @var $collection MailUp_MailUpSync_Model_Mysql4_Job_Collection */
148
+ $collection
149
+ ->addFieldToSelect('*')
150
+ ->addFieldToFilter('status', array('in' => array(self::STATUS_QUEUED, self::STATUS_STARTED)))
151
+ ;
152
+
153
+ if($type !== NULL) {
154
+ $collection->addFieldToFilter('type', array('eq' => (int) $type));
155
+ }
156
+
157
+ return $collection;
158
+ }
159
 
160
  /**
161
  * Get a collection of jobs in the Queue
208
 
209
  return $this;
210
  }
211
+
212
+ /**
213
+ * Whether job is an auto-sync job or manual
214
+ *
215
+ * @return bool
216
+ */
217
+ public function isAutoSync()
218
+ {
219
+ return ((int)$this->getType() === self::TYPE_AUTO_SYNC);
220
+ }
221
  }
app/code/local/MailUp/MailUpSync/Model/Observer.php CHANGED
@@ -207,11 +207,13 @@ class MailUp_MailUpSync_Model_Observer
207
  ) {
208
  // Always change the status
209
  $model->setStatus(Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED);
210
- // Ensure that (if called as singleton), this will only get called once per customer
211
- if (!isset($this->_beforeSaveCalled[$model->getEmail()])) {
212
- Mage::getSingleton('core/session')->addNotice(Mage::helper("mailup")->__("Your subscription is waiting for confirmation"));
213
- $this->_beforeSaveCalled[$model->getEmail()] = true;
214
- }
 
 
215
  }
216
  }
217
 
@@ -232,7 +234,17 @@ class MailUp_MailUpSync_Model_Observer
232
  }
233
  $this->_afterSaveCalled[$model->getEmail()] = true;
234
 
235
- if(Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) {
 
 
 
 
 
 
 
 
 
 
236
  Mage::log($model->getData());
237
  }
238
  $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($model->getEmail());
@@ -431,12 +443,12 @@ class MailUp_MailUpSync_Model_Observer
431
  /**
432
  * Attach to customer_save_after even
433
  *
434
- * Track if we've synced this run, only do it ocne.
435
  * This event can be triggers 3+ times per run as the customer
436
  * model is saved! we only want one Sync though.
437
  *
438
  * @todo refactor
439
- * @see customer_save_after
440
  */
441
  public function prepareCustomerForDataSync($observer)
442
  {
@@ -466,18 +478,20 @@ class MailUp_MailUpSync_Model_Observer
466
  }
467
 
468
  /**
469
- * Add custom data to sync table
470
- *
471
- * @param int
472
- * @param int
473
- * @return boolean|null
 
474
  */
475
- private static function setCustomerForDataSync($customerId, $storeId = NULL)
476
  {
477
  if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) {
478
  Mage::log("TRIGGERED setCustomerForDataSync [StoreID:{$storeId}]");
479
  }
480
-
 
481
  if ( ! isset($storeId)) {
482
  $storeId = Mage::app()->getStore()->getId();
483
  }
@@ -501,28 +515,41 @@ class MailUp_MailUpSync_Model_Observer
501
  }
502
  return false;
503
  }
504
- $job = Mage::getModel('mailup/job');
 
 
 
 
 
505
  /* @var $job MailUp_MailUpSync_Model_Job */
506
 
507
  /**
508
- * Only Sync if they are a subscriber!
509
  */
510
- if ( ! $helper->isSubscriber($customerId, $storeId)) {
511
  return null;
512
  }
513
 
514
  // Set options for those already subscribed (not pending and no opt-in)
515
- $job->setData(array(
516
  'mailupgroupid' => '',
517
  'send_optin' => 0,
518
  'as_pending' => 0,
519
  'status' => 'queued',
520
- 'queue_datetime' => gmdate('Y-m-d H:i:s'),
521
  'store_id' => $storeId,
522
  'list_id' => $listID,
523
  'list_guid' => $listGuid,
524
- ));
525
- $job->setAsAutoSync();
 
 
 
 
 
 
 
 
 
526
  try {
527
  $job->save();
528
  $config->dbLog("Job [Insert] [Group:NO GROUP] ", $job->getId(), $storeId);
@@ -532,37 +559,53 @@ class MailUp_MailUpSync_Model_Observer
532
  $config->log($e);
533
  throw $e;
534
  }
535
-
 
536
  try {
 
537
  $jobTask = Mage::getModel('mailup/sync');
538
- /** @var $jobTask MailUp_MailUpSync_Model_Sync */
539
- $jobTask->setData(array(
540
- 'store_id' => $storeId,
541
- 'customer_id' => $customerId,
542
- 'entity' => 'customer',
543
- 'job_id' => $job->getId(),
544
- 'needs_sync' => true,
545
- 'last_sync' => null,
546
- ));
547
- $jobTask->save();
548
- $config->dbLog("Sync [Insert] [customer] [{$customerId}]", $job->getId(), $storeId);
 
 
 
549
  }
550
  catch(Exception $e) {
551
  $config->dbLog("Sync [Insert] [customer] [FAILED] [{$customerId}]", $job->getId(), $storeId);
552
  $config->log($e);
553
  throw $e;
554
  }
555
-
556
- /**
557
- * @todo ADD CRON
558
- *
559
- * WE NEED TO ACTUALLY ADD A CRON JOB NOW!!
560
- *
561
- * OR we use a separate Auto Sync job!!
562
- */
563
 
564
  return true;
565
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
566
 
567
  /**
568
  * Get the config
207
  ) {
208
  // Always change the status
209
  $model->setStatus(Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED);
210
+ }
211
+
212
+ // Check whether there is a status to change
213
+ $origModel = Mage::getModel('newsletter/subscriber')->load($model->getId());
214
+ if ($origModel->getStatus() == $model->getStatus()) {
215
+ $model->setDoNotChangeSubscription(true);
216
+ return;
217
  }
218
  }
219
 
234
  }
235
  $this->_afterSaveCalled[$model->getEmail()] = true;
236
 
237
+ // If there is no change to status, do not subscribe/unsubscribe
238
+ if ($model->getDoNotChangeSubscription()) {
239
+ return $this;
240
+ }
241
+
242
+ // If the status has changed, and it is now unconfirmed, set notification
243
+ if ($model->getStatus() == Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED) {
244
+ Mage::getSingleton('core/session')->addNotice(Mage::helper("mailup")->__("Your subscription is waiting for confirmation"));
245
+ }
246
+
247
+ if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) {
248
  Mage::log($model->getData());
249
  }
250
  $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($model->getEmail());
443
  /**
444
  * Attach to customer_save_after even
445
  *
446
+ * Track if we've synced this run, only do it once.
447
  * This event can be triggers 3+ times per run as the customer
448
  * model is saved! we only want one Sync though.
449
  *
450
  * @todo refactor
451
+ * @observes customer_save_after
452
  */
453
  public function prepareCustomerForDataSync($observer)
454
  {
478
  }
479
 
480
  /**
481
+ * Add customer data to sync table and creates job if required
482
+ *
483
+ * @param $customerId
484
+ * @param null $storeId
485
+ * @return bool|null
486
+ * @throws Exception
487
  */
488
+ private static function setCustomerForDataSync($customerId, $storeId = NULL)
489
  {
490
  if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) {
491
  Mage::log("TRIGGERED setCustomerForDataSync [StoreID:{$storeId}]");
492
  }
493
+
494
+ // If no storeId specified, use current store
495
  if ( ! isset($storeId)) {
496
  $storeId = Mage::app()->getStore()->getId();
497
  }
515
  }
516
  return false;
517
  }
518
+
519
+ // If cron export is not enabled, skip data sync for this customer
520
+ if ( ! $config->isCronExportEnabled($storeId)) {
521
+ return null;
522
+ }
523
+
524
  /* @var $job MailUp_MailUpSync_Model_Job */
525
 
526
  /**
527
+ * Only Sync if they are a subscriber (or are waiting for confirmation)!
528
  */
529
+ if ( ! $helper->isSubscriberOrWaiting($customerId, $storeId)) {
530
  return null;
531
  }
532
 
533
  // Set options for those already subscribed (not pending and no opt-in)
534
+ $data = array(
535
  'mailupgroupid' => '',
536
  'send_optin' => 0,
537
  'as_pending' => 0,
538
  'status' => 'queued',
 
539
  'store_id' => $storeId,
540
  'list_id' => $listID,
541
  'list_guid' => $listGuid,
542
+ );
543
+ // Find a matching job if exists
544
+ $job = Mage::getModel('mailup/job');
545
+ self::loadMatchingJob($job, $data);
546
+ // If no matching job, set data on new one
547
+ if (!$job->getId()) {
548
+ $job->setData($data);
549
+ $job->setQueueDatetime(gmdate('Y-m-d H:i:s'));
550
+ $job->setAsAutoSync();
551
+ }
552
+ // Save new or existing job
553
  try {
554
  $job->save();
555
  $config->dbLog("Job [Insert] [Group:NO GROUP] ", $job->getId(), $storeId);
559
  $config->log($e);
560
  throw $e;
561
  }
562
+
563
+ // Add task - do this whether or not job is new
564
  try {
565
+ // Check if task already exists for this customer
566
  $jobTask = Mage::getModel('mailup/sync');
567
+ if ($jobTask->getIdByUniqueKey($customerId, $job->getId(), $storeId) == null) {
568
+ // If task does not exist, create and save
569
+ /** @var $jobTask MailUp_MailUpSync_Model_Sync */
570
+ $jobTask->setData(array(
571
+ 'store_id' => $storeId,
572
+ 'customer_id' => $customerId,
573
+ 'entity' => 'customer',
574
+ 'job_id' => $job->getId(),
575
+ 'needs_sync' => true,
576
+ 'last_sync' => null,
577
+ ));
578
+ $jobTask->save();
579
+ $config->dbLog("Sync [Insert] [customer] [{$customerId}]", $job->getId(), $storeId);
580
+ }
581
  }
582
  catch(Exception $e) {
583
  $config->dbLog("Sync [Insert] [customer] [FAILED] [{$customerId}]", $job->getId(), $storeId);
584
  $config->log($e);
585
  throw $e;
586
  }
 
 
 
 
 
 
 
 
587
 
588
  return true;
589
  }
590
+
591
+ /**
592
+ * Load job that matches data, or leave job as is
593
+ *
594
+ * @param MailUp_MailUpSync_Model_Job $job
595
+ * @param array $data
596
+ */
597
+ static function loadMatchingJob(&$job, $data)
598
+ {
599
+ $collection = Mage::getModel('mailup/job')->getCollection();
600
+ foreach ($data as $key => $value) {
601
+ $collection->addFieldToFilter($key, $value);
602
+ }
603
+
604
+ if ($collection->getSize() == 0)
605
+ return;
606
+
607
+ $job = $collection->getFirstItem();
608
+ }
609
 
610
  /**
611
  * Get the config
app/code/local/MailUp/MailUpSync/Model/Subscriber.php CHANGED
@@ -70,4 +70,20 @@ class MailUp_MailUpSync_Model_Subscriber extends Mage_Newsletter_Model_Subscribe
70
  {
71
  return Mage::getModel('mailup/config');
72
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
70
  {
71
  return Mage::getModel('mailup/config');
72
  }
73
+
74
+ /**
75
+ * Return customer subscription status
76
+ *
77
+ * @return bool
78
+ */
79
+ public function isSubscribed()
80
+ {
81
+ if($this->getId() &&
82
+ $this->getStatus()==self::STATUS_SUBSCRIBED ||
83
+ $this->getStatus()==self::STATUS_UNCONFIRMED) {
84
+ return true;
85
+ }
86
+
87
+ return false;
88
+ }
89
  }
app/code/local/MailUp/MailUpSync/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <MailUp_MailUpSync>
5
- <version>2.7.1</version>
6
  </MailUp_MailUpSync>
7
  </modules>
8
  <!-- frontend -->
@@ -164,7 +164,7 @@
164
  <mailup_checkout_order_save>
165
  <type>singleton</type>
166
  <class>MailUp_MailUpSync_Model_Observer</class>
167
- <method>onCheckoutSaveOrder</method>
168
  </mailup_checkout_order_save>
169
  </observers>
170
  </customer_save_after>
@@ -345,25 +345,14 @@
345
  <!-- cron -->
346
  <crontab>
347
  <jobs>
348
-
349
- <!--
350
- Manual Sync will be triggered ASAP.
351
-
352
- Auto sync will be triggered by the settings in the DB / config
353
- -->
354
-
355
- <!--
356
- <MailUp_MailUpSync_manualsync>
357
- <run><model>mailup/Cron::run</model></run>
358
- </MailUp_MailUpSync_manualsync>
359
- -->
360
-
361
- <mailup_mailupsync_autosync>
362
- <run><model>mailup/Cron::autoSync</model></run>
363
- </mailup_mailupsync_autosync>
364
-
365
  <mailup_mailupsync>
366
  <run><model>mailup/Cron::run</model></run>
 
 
 
 
 
 
367
  </mailup_mailupsync>
368
  </jobs>
369
  </crontab>
2
  <config>
3
  <modules>
4
  <MailUp_MailUpSync>
5
+ <version>2.7.2</version>
6
  </MailUp_MailUpSync>
7
  </modules>
8
  <!-- frontend -->
164
  <mailup_checkout_order_save>
165
  <type>singleton</type>
166
  <class>MailUp_MailUpSync_Model_Observer</class>
167
+ <method>prepareCustomerForDataSync</method>
168
  </mailup_checkout_order_save>
169
  </observers>
170
  </customer_save_after>
345
  <!-- cron -->
346
  <crontab>
347
  <jobs>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
  <mailup_mailupsync>
349
  <run><model>mailup/Cron::run</model></run>
350
+ <schedule>
351
+ <!-- If config setting save, overrides default below -->
352
+ <config_path>crontab/jobs/mailup_mailupsync/schedule/cron_expr</config_path>
353
+ <!-- Default to run every 30 minutes -->
354
+ <cron_expr>0,30 * * * *</cron_expr>
355
+ </schedule>
356
  </mailup_mailupsync>
357
  </jobs>
358
  </crontab>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MailUp</name>
4
- <version>2.7.1</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,12 +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;Bug fix: Incompatibility with AOE Scheduler resolved&lt;/li&gt;&#xD;
 
 
 
 
 
 
50
  &lt;/ul&gt;</notes>
51
  <authors><author><name>Mailup</name><user>Mailup</user><email>sales@mailup.com</email></author></authors>
52
- <date>2014-10-06</date>
53
- <time>09:29:44</time>
54
- <contents><target name="magelocal"><dir name="MailUp"><dir name="MailUpSync"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="Grid.php" hash="38557c376017afe05298bcbf32d038d1"/></dir><file name="Log.php" hash="e4bffa5e42d20efb0b02888db700cb2f"/><dir name="Mailup"><file name="Grid.php" hash="37420bc13a1ecae89d6a19a7659d6711"/></dir><file name="Mailupbackend.php" hash="67f999af48c88e2c85d9a84d0ba4d632"/><dir name="Sync"><file name="Grid.php" hash="afd6e1c5eb5781fbe05df504d02fe5e0"/></dir><file name="Sync.php" hash="5d34a2a330da7649799172394da28c58"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Timezone.php" hash="ca3f432e8a7b1e7fb1981a7b4eaa704e"/></dir><file name="Testbutton.php" hash="8c2cb5952e81ee89411be42bfea4bcfd"/></dir></dir></dir></dir><dir name="Checkout"><file name="Subscribe.php" hash="1cac447093df6e663b8af8333524e160"/></dir><file name="Filters.php" hash="701661ef5c6eb13708f2909546d17138"/><file name="Index.php" hash="b4a60933c967669e3fd0f1423ac01cac"/></dir><dir name="Helper"><file name="Customer.php" hash="8034cd2301c697fc0c1912ad4130a94e"/><file name="Data.php" hash="7b252063460448345e5a03d48a08e4be"/><file name="Order.php" hash="6fab1a018ff9601dac7e9b745dc989bf"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Clone"><dir name="Mappings"><file name="Custom.php" hash="786ccebb45c3f048e38d871fada8e0d3"/></dir></dir><dir name="Source"><dir name="Cron"><file name="Frequency.php" hash="c0fc8981934028b0eb3ece0253e87691"/><file name="Hours.php" hash="38bd8efdfaae15adbf2654cdd1134f2b"/></dir><file name="Fields.php" hash="0062d2ba3c7a1e16bebbf59d6a9d2c5a"/></dir><file name=".DS_Store" hash="699eb0995de74828d9f23655e826e581"/></dir><file name=".DS_Store" hash="173bd8294aed6b0b02e19ffb8e68cbd5"/></dir><file name="Config.php" hash="79e0f416088acbef55bb1022651f073c"/><file name="Consoleurlvalidator.php" hash="1385ebd3d6c6138c2d38a426bc7a7914"/><file name="Cron.php" hash="d34013b25021eb3c5a866868da318dcf"/><file name="Job.php" hash="26bb0ab71fa8920fc0a6b59f52d5ec50"/><file name="Log.php" hash="c77cf2a4dddbb6a384052f79cfd74f39"/><file name="MailUp.php" hash="84dbd1bab58b00767491c50f37d94f21"/><file name="MailUpWsImport.php" hash="c8f57fc957ab123bd1286ca991871dff"/><dir name="Mysql14"><dir name="MailUp"><file name="Collection.php" hash="3fafd0a1aa00243ca1f88eb409ca31b3"/></dir><file name="MailUp.php" hash="0a80ed4029058663fe09845ee9c1190e"/></dir><dir name="Mysql4"><dir name="Job"><file name="Collection.php" hash="0935b29c6f71e712383d11693553cba3"/></dir><file name="Job.php" hash="3b289d188982ca7eb047e58ccedc7d77"/><dir name="Log"><file name="Collection.php" hash="c7030f645c08cf53da3c6e95902bb063"/></dir><file name="Log.php" hash="c134a9956d7213cca84f71a63b272400"/><dir name="Sync"><file name="Collection.php" hash="a60698dec1fdc044df198a11887d9300"/></dir><file name="Sync.php" hash="2b904c04594f2b842cd061c3673d0cde"/></dir><file name="Observer.php" hash="31e8715a4dd7af0aae0fb11edda393ad"/><dir name="Source"><file name="Groups.php" hash="8661b4079c8620824a24e0769e0ce7d7"/><file name="Lists.php" hash="66b0f269f42fea4f33d585f5b428bb48"/><file name="Store.php" hash="8b1b8bfc67e5e49d085f1f8e685ca8be"/></dir><file name="Subscriber.php" hash="a761b42a869cab4f92de9804906fbbf4"/><file name="Sync.php" hash="d7bbd3ce64dbf67500ce0853fc54c865"/><file name="Webserviceusernamevalidator.php" hash="c8986f1c00af0ca7fc252b593548598f"/><file name="Ws.php" hash="21ef21afcf35867d0ec8ff345babeab6"/><file name="Wssend.php" hash="7c06e853f48a08e137397c0c42413217"/><file name=".DS_Store" hash="6f2c4920df9dd2405271ef9b6495cacc"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ConfigurationController.php" hash="040f8d33cf489ebad77838f8ca016fe7"/><file name="FieldsmappingController.php" hash="2681d558e3abda7b6475dbc969e9a1c7"/><file name="FilterController.php" hash="64f90b9c12c50f4de74a0401da788770"/><file name="LogController.php" hash="909b3b9f0e07c154ffd034ed35da185d"/><file name="MailupbackendController.php" hash="c4d70bc81adb492f7893554998962adf"/><file name="SyncController.php" hash="82398659801687a1bf912b2ac00493ea"/><file name="ViewdatatransferlogController.php" hash="b7baa8c62657e03cfbd00a032b8381ef"/></dir><file name="IndexController.php" hash="c634cdd24f62a7d27c4613b4a62a06f8"/><file name="TestController.php" hash="73359f2e0bf681b7e8900b8dd23c05c3"/><file name="WebhookController.php" hash="333d054fffdc976592c7789de7a15ed4"/></dir><dir name="data"><dir name="mailup_setup"><file name="data-upgrade-2.6.1-2.7.0.php" hash="525fb58aa0ecf97693806d81149793e0"/><file name="data-upgrade-2.7.0-2.7.1.php" hash="b2ff15418a44d42c82aa5ed99c9893d4"/></dir></dir><dir name="etc"><file name="config.xml" hash="9bfc287196799a66727c01c4de8bfd20"/><file name="system.xml" hash="bfe19ce9fac9be62e4000b2491b48ae7"/></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"/><file name="mysql4-upgrade-2.6.1-2.7.0.php" hash="3008b9e79b33278a98640ebf5d35643a"/></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="16c2c7c7c17504acb4d61004533f99b9"/></dir><dir name="template"><dir name="mailup"><dir name="mailupsync"><file name="confirm.phtml" hash="562c3f0f8625cbb3361e81dc17998ba3"/><file name="fieldsmapping.phtml" hash="b0b22c19bc6f9c97b22754dc7a0103ba"/><file name="filter.phtml" hash="d887726f97b0e184f3d673e94d03ed77"/><file name="sysconfigjavascript.phtml" hash="5d8d3ec91184b4bf54faad75b84a2765"/><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="e1859cbb88aefc9fc6f4fac212c23ae9"/></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="05429197b5b352050b28f566fe6d1b88"/></dir></dir></dir><file name="subscribe.phtml" hash="a102e2e0dc4c836bc78eb044bf13e172"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="MailUp_MailUpSync.xml" hash="599cc75c4fccf74da4baccf4ad2314a3"/></dir></target><target name="magelocale"><dir name="en_US"><file name="MailUp_MailUpSync.csv" hash="c93d389981a15db14a1de35c82c2c6fa"/></dir><dir name="it_IT"><file name="MailUp_MailUpSync.csv" hash="a408addc87ef4c64c2cf754cfdf9eb35"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="mailup"><dir name="mailupsync"><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><target name="mageweb"><dir name="js"><dir name="mailup"><file name="admin.js" hash="b30a744826b59ef20767ba7b379949d7"/></dir></dir></target></contents>
55
  <compatible/>
56
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
57
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MailUp</name>
4
+ <version>2.7.2</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;Bug fix: Customer updates are merged into larger jobs to reduce the number of syncs run&lt;/li&gt;&#xD;
50
+ &lt;li&gt;Bug fix: Chosen schedule now always used overriding the default schedule&lt;/li&gt;&#xD;
51
+ &lt;li&gt;Bug fix: Per-store autosync settings used to set customers for sync and send jobs via cron&lt;/li&gt;&#xD;
52
+ &lt;li&gt;Bug fix: Unconfirmed subscribers shown as subscribed in customer account area and admin customer view, removing possibility of accidental unsubscription&lt;/li&gt;&#xD;
53
+ &lt;li&gt;Syncs customers that are awaiting confirmation so that when they confirm their details are correct&lt;/li&gt;&#xD;
54
+ &lt;li&gt;If synching is stopped part way through for any reason, it will be automatically restarted at next cron&lt;/li&gt;&#xD;
55
+ &lt;li&gt;Customers are added to sync queue when saved on front-end or admin&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>2015-02-09</date>
59
+ <time>16:33:08</time>
60
+ <contents><target name="magelocal"><dir name="MailUp"><dir name="MailUpSync"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="Grid.php" hash="38557c376017afe05298bcbf32d038d1"/></dir><file name="Log.php" hash="e4bffa5e42d20efb0b02888db700cb2f"/><dir name="Mailup"><file name="Grid.php" hash="37420bc13a1ecae89d6a19a7659d6711"/></dir><file name="Mailupbackend.php" hash="67f999af48c88e2c85d9a84d0ba4d632"/><dir name="Sync"><file name="Grid.php" hash="afd6e1c5eb5781fbe05df504d02fe5e0"/></dir><file name="Sync.php" hash="5d34a2a330da7649799172394da28c58"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Timezone.php" hash="ca3f432e8a7b1e7fb1981a7b4eaa704e"/></dir><file name="Testbutton.php" hash="8c2cb5952e81ee89411be42bfea4bcfd"/></dir></dir></dir></dir><dir name="Checkout"><file name="Subscribe.php" hash="1cac447093df6e663b8af8333524e160"/></dir><file name="Filters.php" hash="701661ef5c6eb13708f2909546d17138"/><file name="Index.php" hash="b4a60933c967669e3fd0f1423ac01cac"/></dir><dir name="Helper"><file name="Customer.php" hash="8034cd2301c697fc0c1912ad4130a94e"/><file name="Data.php" hash="97e8aa74b6b065975ddff2f440e70c1c"/><file name="Order.php" hash="6fab1a018ff9601dac7e9b745dc989bf"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Clone"><dir name="Mappings"><file name="Custom.php" hash="786ccebb45c3f048e38d871fada8e0d3"/></dir></dir><dir name="Source"><dir name="Cron"><file name="Frequency.php" hash="c0fc8981934028b0eb3ece0253e87691"/><file name="Hours.php" hash="38bd8efdfaae15adbf2654cdd1134f2b"/></dir><file name="Fields.php" hash="0062d2ba3c7a1e16bebbf59d6a9d2c5a"/></dir><file name=".DS_Store" hash="699eb0995de74828d9f23655e826e581"/></dir><file name=".DS_Store" hash="173bd8294aed6b0b02e19ffb8e68cbd5"/></dir><file name="Config.php" hash="79e0f416088acbef55bb1022651f073c"/><file name="Consoleurlvalidator.php" hash="1385ebd3d6c6138c2d38a426bc7a7914"/><file name="Cron.php" hash="c6389802914d7a4d8e2de469c5e73218"/><file name="Job.php" hash="8fb2c1181fbed906cd6a65c58477b7d1"/><file name="Log.php" hash="c77cf2a4dddbb6a384052f79cfd74f39"/><file name="MailUp.php" hash="84dbd1bab58b00767491c50f37d94f21"/><file name="MailUpWsImport.php" hash="c8f57fc957ab123bd1286ca991871dff"/><dir name="Mysql14"><dir name="MailUp"><file name="Collection.php" hash="3fafd0a1aa00243ca1f88eb409ca31b3"/></dir><file name="MailUp.php" hash="0a80ed4029058663fe09845ee9c1190e"/></dir><dir name="Mysql4"><dir name="Job"><file name="Collection.php" hash="0935b29c6f71e712383d11693553cba3"/></dir><file name="Job.php" hash="3b289d188982ca7eb047e58ccedc7d77"/><dir name="Log"><file name="Collection.php" hash="c7030f645c08cf53da3c6e95902bb063"/></dir><file name="Log.php" hash="c134a9956d7213cca84f71a63b272400"/><dir name="Sync"><file name="Collection.php" hash="a60698dec1fdc044df198a11887d9300"/></dir><file name="Sync.php" hash="2b904c04594f2b842cd061c3673d0cde"/></dir><file name="Observer.php" hash="00b43aaa13fd71438496009d20804537"/><dir name="Source"><file name="Groups.php" hash="8661b4079c8620824a24e0769e0ce7d7"/><file name="Lists.php" hash="66b0f269f42fea4f33d585f5b428bb48"/><file name="Store.php" hash="8b1b8bfc67e5e49d085f1f8e685ca8be"/></dir><file name="Subscriber.php" hash="325529498c364949efd4c28f179affc9"/><file name="Sync.php" hash="d7bbd3ce64dbf67500ce0853fc54c865"/><file name="Webserviceusernamevalidator.php" hash="c8986f1c00af0ca7fc252b593548598f"/><file name="Ws.php" hash="21ef21afcf35867d0ec8ff345babeab6"/><file name="Wssend.php" hash="7c06e853f48a08e137397c0c42413217"/><file name=".DS_Store" hash="6f2c4920df9dd2405271ef9b6495cacc"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ConfigurationController.php" hash="040f8d33cf489ebad77838f8ca016fe7"/><file name="FieldsmappingController.php" hash="2681d558e3abda7b6475dbc969e9a1c7"/><file name="FilterController.php" hash="64f90b9c12c50f4de74a0401da788770"/><file name="LogController.php" hash="909b3b9f0e07c154ffd034ed35da185d"/><file name="MailupbackendController.php" hash="c4d70bc81adb492f7893554998962adf"/><file name="SyncController.php" hash="82398659801687a1bf912b2ac00493ea"/><file name="ViewdatatransferlogController.php" hash="b7baa8c62657e03cfbd00a032b8381ef"/></dir><file name="IndexController.php" hash="c634cdd24f62a7d27c4613b4a62a06f8"/><file name="TestController.php" hash="73359f2e0bf681b7e8900b8dd23c05c3"/><file name="WebhookController.php" hash="333d054fffdc976592c7789de7a15ed4"/></dir><dir name="data"><dir name="mailup_setup"><file name="data-upgrade-2.6.1-2.7.0.php" hash="525fb58aa0ecf97693806d81149793e0"/><file name="data-upgrade-2.7.0-2.7.1.php" hash="b2ff15418a44d42c82aa5ed99c9893d4"/></dir></dir><dir name="etc"><file name="config.xml" hash="aea75fc9aac7e66df1544f34492cf71d"/><file name="system.xml" hash="bfe19ce9fac9be62e4000b2491b48ae7"/></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"/><file name="mysql4-upgrade-2.6.1-2.7.0.php" hash="3008b9e79b33278a98640ebf5d35643a"/></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="16c2c7c7c17504acb4d61004533f99b9"/></dir><dir name="template"><dir name="mailup"><dir name="mailupsync"><file name="confirm.phtml" hash="562c3f0f8625cbb3361e81dc17998ba3"/><file name="fieldsmapping.phtml" hash="b0b22c19bc6f9c97b22754dc7a0103ba"/><file name="filter.phtml" hash="d887726f97b0e184f3d673e94d03ed77"/><file name="sysconfigjavascript.phtml" hash="5d8d3ec91184b4bf54faad75b84a2765"/><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="e1859cbb88aefc9fc6f4fac212c23ae9"/></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="05429197b5b352050b28f566fe6d1b88"/></dir></dir></dir><file name="subscribe.phtml" hash="a102e2e0dc4c836bc78eb044bf13e172"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="MailUp_MailUpSync.xml" hash="599cc75c4fccf74da4baccf4ad2314a3"/></dir></target><target name="magelocale"><dir name="en_US"><file name="MailUp_MailUpSync.csv" hash="c93d389981a15db14a1de35c82c2c6fa"/></dir><dir name="it_IT"><file name="MailUp_MailUpSync.csv" hash="a408addc87ef4c64c2cf754cfdf9eb35"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="mailup"><dir name="mailupsync"><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><target name="mageweb"><dir name="js"><dir name="mailup"><file name="admin.js" hash="b30a744826b59ef20767ba7b379949d7"/></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>