Sarbacane_Mailify - Version 1.0.0.4

Version Notes

This release hugely improves the plugin behavior. No more useless data are stored.

Download this release

Release Info

Developer Sarbacane Software
Extension Sarbacane_Mailify
Version 1.0.0.4
Comparing to
See all releases


Code changes from version 1.0.0.2 to 1.0.0.4

app/code/community/Sarbacane/Mailify/Helper/Data.php CHANGED
@@ -72,15 +72,11 @@ class Sarbacane_Mailify_Helper_Data extends Mage_Core_Helper_Abstract
72
  {
73
  $resource = Mage::getSingleton('core/resource');
74
  $db_write = $resource->getConnection('core_write');
75
- $sarbacanedesktop = $resource->getTableName('sarbacanedesktop');
76
  $rq_sql = '
77
  DELETE FROM `' . $sarbacanedesktop . '`
78
- WHERE `list_type` = ' . $db_write->quote($list_type) . '
79
- AND `store_id` = ' . $db_write->quote($store_id);
80
- if ($sd_id != '') {
81
- $rq_sql .= '
82
- AND `sd_id` = ' . $db_write->quote($sd_id);
83
- }
84
  $db_write->query($rq_sql);
85
  }
86
 
@@ -139,37 +135,13 @@ class Sarbacane_Mailify_Helper_Data extends Mage_Core_Helper_Abstract
139
  }
140
  }
141
 
142
- public function setConfiguration($field, $value)
143
- {
144
- $sql_field = '';
145
- if ($field == 'identifier') {
146
- $sql_field = 'lastname';
147
- } else if ($field == 'sd_list') {
148
- $sql_field = 'firstname';
149
- } else if ($field == 'sd_token') {
150
- $sql_field = 'orders_data';
151
- }
152
- if ($sql_field != '') {
153
- $resource = Mage::getSingleton('core/resource');
154
- $db_write = $resource->getConnection('core_write');
155
- $sarbacanedesktop = $resource->getTableName('sarbacanedesktop');
156
- $rq_sql = '
157
- UPDATE `' . $sarbacanedesktop . '`
158
- SET `' . $sql_field . '` = ' . $db_write->quote($value) . '
159
- WHERE `email` = \'-\'
160
- AND `store_id` = \'-\'
161
- AND `list_type` = \'-\'';
162
- $db_write->query($rq_sql);
163
- }
164
- }
165
 
166
  public function deleteSdid($sd_id){
167
  $resource = Mage::getSingleton('core/resource');
168
  $db_write = $resource->getConnection('core_write');
169
- $sarbacanedesktop = $resource->getTableName('sarbacanedesktop');
170
  $sarbacanedesktop_users = $resource->getTableName('sarbacanedesktop_users');
171
 
172
- $rq_sql = 'DELETE FROM sarbacanedesktop WHERE sd_id = (SELECT sd_id FROM sarbacanedesktop_users WHERE sd_type= "sd_id" AND sd_value="'. $sd_id .'")';
173
  $db_write->query($rq_sql);
174
  }
175
 
72
  {
73
  $resource = Mage::getSingleton('core/resource');
74
  $db_write = $resource->getConnection('core_write');
75
+ $sarbacanedesktop = $resource->getTableName('sarbacanedesktop_users');
76
  $rq_sql = '
77
  DELETE FROM `' . $sarbacanedesktop . '`
78
+ WHERE `sd_type` = "sd_id"
79
+ AND `sd_id` = ' . $db_write->quote($sd_id);
 
 
 
 
80
  $db_write->query($rq_sql);
81
  }
82
 
135
  }
136
  }
137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
 
139
  public function deleteSdid($sd_id){
140
  $resource = Mage::getSingleton('core/resource');
141
  $db_write = $resource->getConnection('core_write');
 
142
  $sarbacanedesktop_users = $resource->getTableName('sarbacanedesktop_users');
143
 
144
+ $rq_sql = 'DELETE FROM '.$sarbacanedesktop_users.' WHERE sd_value ="'.$sd_id.' AND sd_type="sd_id"';
145
  $db_write->query($rq_sql);
146
  }
147
 
app/code/community/Sarbacane/Mailify/controllers/Adminhtml/MailifyController.php CHANGED
@@ -47,7 +47,7 @@ class Sarbacane_Mailify_Adminhtml_MailifyController extends Mage_Adminhtml_Contr
47
  if(Mage::app()->getRequest()->getParam("sd_is_user")){
48
  Mage::getSingleton("core/session")->setData("sd_is_user",Mage::app()->getRequest()->getParam("sd_is_user"));
49
  }
50
- $this->_title($this->__('Sarbacane Desktop'));
51
  $this->_setActiveMenu('newsletter');
52
  $this->renderLayout();
53
  }
@@ -68,7 +68,6 @@ class Sarbacane_Mailify_Adminhtml_MailifyController extends Mage_Adminhtml_Contr
68
  }
69
  }
70
  $old_sd_list_array = Mage::helper('mailify')->getListConfiguration('array');
71
- Mage::helper('mailify')->setConfiguration('sd_list', $shops);
72
  $rq_sql = '
73
  UPDATE `' . $sarbacanedesktop_users . '`
74
  SET `sd_value` = ' . $db_write->quote($shops) . '
@@ -88,9 +87,7 @@ class Sarbacane_Mailify_Adminhtml_MailifyController extends Mage_Adminhtml_Contr
88
  private function createTokenParameterConfiguration(){
89
  $resource = Mage::getSingleton('core/resource');
90
  $db_write = $resource->getConnection('core_write');
91
- $sarbacanedesktop = $resource->getTableName('sarbacanedesktop');
92
  $sarbacanedesktop_users = $resource->getTableName('sarbacanedesktop_users');
93
- $rq_sql = 'TRUNCATE `' . $sarbacanedesktop . '`';
94
  $rq_sql = 'TRUNCATE `' . $sarbacanedesktop_users . '`';
95
  $db_write->query($rq_sql);
96
  $token_parameter = rand(100000, 999999) . Mage::getModel('core/date')->timestamp(time());
@@ -102,10 +99,7 @@ class Sarbacane_Mailify_Adminhtml_MailifyController extends Mage_Adminhtml_Contr
102
  {
103
  $resource = Mage::getSingleton('core/resource');
104
  $db_write = $resource->getConnection('core_write');
105
- $sarbacanedesktop = $resource->getTableName('sarbacanedesktop');
106
  $sarbacanedesktop_users = $resource->getTableName('sarbacanedesktop_users');
107
- $rq_sql = 'TRUNCATE `' . $sarbacanedesktop . '`';
108
- $db_write->query($rq_sql);
109
  $token_parameter = rand(100000, 999999) . Mage::getModel('core/date')->timestamp(time());
110
  $rq_sql = '
111
  UPDATE `' . $sarbacanedesktop_users . '`
47
  if(Mage::app()->getRequest()->getParam("sd_is_user")){
48
  Mage::getSingleton("core/session")->setData("sd_is_user",Mage::app()->getRequest()->getParam("sd_is_user"));
49
  }
50
+ $this->_title($this->__('Mailify'));
51
  $this->_setActiveMenu('newsletter');
52
  $this->renderLayout();
53
  }
68
  }
69
  }
70
  $old_sd_list_array = Mage::helper('mailify')->getListConfiguration('array');
 
71
  $rq_sql = '
72
  UPDATE `' . $sarbacanedesktop_users . '`
73
  SET `sd_value` = ' . $db_write->quote($shops) . '
87
  private function createTokenParameterConfiguration(){
88
  $resource = Mage::getSingleton('core/resource');
89
  $db_write = $resource->getConnection('core_write');
 
90
  $sarbacanedesktop_users = $resource->getTableName('sarbacanedesktop_users');
 
91
  $rq_sql = 'TRUNCATE `' . $sarbacanedesktop_users . '`';
92
  $db_write->query($rq_sql);
93
  $token_parameter = rand(100000, 999999) . Mage::getModel('core/date')->timestamp(time());
99
  {
100
  $resource = Mage::getSingleton('core/resource');
101
  $db_write = $resource->getConnection('core_write');
 
102
  $sarbacanedesktop_users = $resource->getTableName('sarbacanedesktop_users');
 
 
103
  $token_parameter = rand(100000, 999999) . Mage::getModel('core/date')->timestamp(time());
104
  $rq_sql = '
105
  UPDATE `' . $sarbacanedesktop_users . '`
app/code/community/Sarbacane/Mailify/controllers/IndexController.php CHANGED
@@ -1,361 +1,303 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * @category Sarbacane
16
- * @package Sarbacane_Mailify
17
- * @author Sarbacane Software <contact@sarbacane.com>
18
- * @copyright 2015 Sarbacane Software
19
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
- */
21
- class Sarbacane_Mailify_IndexController extends Mage_Core_Controller_Front_Action {
22
- private function getSdidIdentifier($sdid) {
23
- $resource = Mage::getSingleton ( 'core/resource' );
24
- $db_read = $resource->getConnection ( 'core_read' );
25
- $sarbacanedesktop_users = $resource->getTableName ( 'sarbacanedesktop_users' );
26
- $rq_sql = '
27
- SELECT `sd_id`
28
- FROM `' . $sarbacanedesktop_users . '`
29
- WHERE `sd_type` = \'sd_id\'
30
- AND `sd_value` = ' . $db_read->quote ( $sdid );
31
- $rq = $db_read->query ( $rq_sql );
32
- while ( $r = $rq->fetch () ) {
33
- return $r ['sd_id'];
34
- }
35
- return '';
36
- }
37
- private function saveSdid($sdid) {
38
- $resource = Mage::getSingleton ( 'core/resource' );
39
- $db_write = $resource->getConnection ( 'core_write' );
40
- $sarbacanedesktop_users = $resource->getTableName ( 'sarbacanedesktop_users' );
41
- $rq_sql = '
42
- INSERT INTO `' . $sarbacanedesktop_users . '` (`sd_type`, `sd_value`) VALUES
43
- (\'sd_id\', ' . $db_write->quote ( $sdid ) . ')';
44
- $rq = $db_write->query ( $rq_sql );
45
- return $this->getSdidIdentifier ( $sdid );
46
- }
47
- public function indexAction() {
48
- if (Mage::app ()->getRequest ()->getParam ( 'stk' ) && Mage::app ()->getRequest ()->getParam ( 'sdid' )) {
49
- $sdid = Mage::app ()->getRequest ()->getParam ( 'sdid' );
50
- if (Mage::app ()->getRequest ()->getParam ( 'stk' ) == Mage::helper ( 'mailify' )->getToken () && $sdid != '') {
51
- $identifier = Mage::helper ( 'mailify' )->getConfiguration ( 'identifier' );
52
- $sd_id = $this->getSdidIdentifier ( $sdid );
53
- if ($sd_id == '' && ! Mage::app ()->getRequest ()->getParam ( 'list' ))
54
- $sd_id = $this->saveSdid ( $sdid );
55
- if ($sd_id != '') {
56
- $configuration = Mage::helper ( 'mailify' )->getConfiguration ( 'all' );
57
- if ($configuration ['sd_token'] != '' && $configuration ['sd_list'] != '') {
58
- $sd_list_array = Mage::helper ( 'mailify' )->getListConfiguration ( 'array' );
59
- if ($sd_list_array != '') {
60
- if (Mage::app ()->getRequest ()->getParam ( 'list' )) {
61
- $list = Mage::app ()->getRequest ()->getParam ( 'list' );
62
- $store_id = Mage::helper ( 'mailify' )->getStoreidFromList ( $list );
63
- $list_type = Mage::helper ( 'mailify' )->getListTypeFromList ( $list );
64
- $list_type_array = Mage::helper ( 'mailify' )->getListTypeArray ();
65
- if (in_array ( $list_type, $list_type_array )) {
66
- $id_and_list = $store_id . $list_type;
67
- if (($list_type == 'N' && in_array ( $id_and_list . '0', $sd_list_array )) || ($list_type == 'C' && (in_array ( $id_and_list . '0', $sd_list_array ) || in_array ( $id_and_list . '1', $sd_list_array )))) {
68
- if (Mage::app ()->getRequest ()->getParam ( 'action' )) {
69
- if (Mage::app ()->getRequest ()->getParam ( 'action' ) == 'reset') {
70
- Mage::helper ( 'mailify' )->resetList ( $list_type, $store_id, $sd_id );
71
- }
72
- }
73
- $this->processNewUnsubcribersAndSubscribers ( $list_type, $store_id, $sd_id );
74
- }
75
- }
76
- } else {
77
- if('delete' == Mage::app ()->getRequest ()->getParam ( 'action' )){
78
- Mage::helper ( 'mailify' )->deleteSdid ( $sd_id );
79
- }else{
80
- $this->getFormattedContentShops ( $sd_id );
81
- }
82
- }
83
- }
84
- }
85
- }
86
- }
87
- } else {
88
- echo "Param&egrave;tre[s] manquant[s]";
89
- }
90
- }
91
- private function processNewUnsubcribersAndSubscribers($list_type, $store_id, $sd_id) {
92
- $line = 'email;lastname;firstname';
93
- if ($list_type == 'C') {
94
- if ($this->checkIfListWithCustomerData ( $list_type, $store_id )) {
95
- $line .= ';date_first_order;date_last_order;amount_min_order;amount_max_order;amount_avg_order;nb_orders;amount_all_orders';
96
- }
97
- }
98
- $line .= ';action';
99
- echo $line;
100
- $this->processNewUnsubscribers ( $list_type, $store_id, $sd_id );
101
- $this->processNewSubscribers ( $list_type, $store_id, $sd_id );
102
- }
103
- private function getListTypeArray() {
104
- return array ('N','C'
105
- );
106
- }
107
- private function checkIfListWithCustomerData($list_type, $store_id) {
108
- $sd_list_array = Mage::helper ( 'mailify' )->getListConfiguration ( 'array' );
109
- if (in_array ( $store_id . $list_type . '1', $sd_list_array )) {
110
- return true;
111
- }
112
- return false;
113
- }
114
- private function getFormattedContentShops($sd_id) {
115
- $stores = Mage::helper ( 'mailify' )->getStoresArray ();
116
- echo 'list_id;name;reset;is_updated;type;version' . "\n";
117
- $sd_list_array = Mage::helper ( 'mailify' )->getListConfiguration ( 'array' );
118
- $list_array = array ();
119
- foreach ( $sd_list_array as $list ) {
120
- $store_id = Mage::helper ( 'mailify' )->getStoreidFromList ( $list );
121
- $list_type = Mage::helper ( 'mailify' )->getListTypeFromList ( $list );
122
- array_push ( $list_array, array ('store_id' => $store_id,'list_type' => $list_type
123
- ) );
124
- }
125
- foreach ( $stores as $store ) {
126
- foreach ( $list_array as $list ) {
127
- if ($store ['store_id'] == $list ['store_id']) {
128
- $store_list = "" . $store ['store_id'] . $list ['list_type'] . ';' . $this->dQuote ( $store ['store_name'] ) . ';'; // TEST
129
- $store_list .= $this->listIsResetted ( $store ['store_id'], $list ['list_type'], $sd_id ) . ';';
130
- $store_list .= $this->listIsUpdated ( $store ['store_id'], $list ['list_type'], $sd_id ) . ';';
131
- $store_list .= 'Magento;1.0.0.0' . "\n";
132
- echo $store_list;
133
- }
134
- }
135
- }
136
- }
137
- private function listIsResetted($store_id, $list_type, $sd_id) {
138
- $resource = Mage::getSingleton ( 'core/resource' );
139
- $db_read = $resource->getConnection ( 'core_read' );
140
- $sarbacanedesktop = $resource->getTableName ( 'sarbacanedesktop' );
141
- $rq_sql = '
142
- SELECT count(`email`) AS `nb_in_table`
143
- FROM ' . $sarbacanedesktop . '
144
- WHERE `list_type` = ' . $db_read->quote ( $list_type ) . '
145
- AND `store_id` = ' . $db_read->quote ( $store_id ) . '
146
- AND `sd_id` = ' . $db_read->quote ( $sd_id );
147
- $nb_in_table = $db_read->fetchOne ( $rq_sql );
148
- if ($nb_in_table == 0)
149
- return 'Y';
150
- return 'N';
151
- }
152
- private function listIsUpdated($store_id, $list_type, $sd_id) {
153
- $is_updated_list = 'N';
154
- if ($this->processNewUnsubscribers ( $list_type, $store_id, $sd_id, 'is_updated' ) > 0) {
155
- $is_updated_list = 'Y';
156
- }
157
- if ($this->processNewSubscribers ( $list_type, $store_id, $sd_id, 'is_updated' ) > 0) {
158
- $is_updated_list = 'Y';
159
- }
160
- return $is_updated_list;
161
- }
162
- private function dQuote($value) {
163
- $value = str_replace ( '"', '""', $value );
164
- if (strpos ( $value, ' ' ) || strpos ( $value, ';' )) {
165
- $value = '"' . $value . '"';
166
- }
167
- return $value;
168
- }
169
- private function processNewSubscribers($list_type, $store_id, $sd_id, $type_action = 'display') {
170
- $resource = Mage::getSingleton ( 'core/resource' );
171
- $db_read = $resource->getConnection ( 'core_read' );
172
- $db_write = $resource->getConnection ( 'core_write' );
173
- $newsletter_subscriber = $resource->getTableName ( 'newsletter_subscriber' );
174
- $sarbacanedesktop = $resource->getTableName ( 'sarbacanedesktop' );
175
- $sales_flat_order = $resource->getTableName ( 'sales_flat_order' );
176
- $customer_entity = $resource->getTableName ( 'customer_entity' );
177
- $customer_entity_varchar = $resource->getTableName ( 'customer_entity_varchar' );
178
- $core_store = $resource->getTableName ( 'core_store' ); // core store
179
- $attr_firstname = Mage::getModel ( 'customer/customer' )->getAttribute ( 'firstname' )->getAttributeId ();
180
- $attr_lastname = Mage::getModel ( 'customer/customer' )->getAttribute ( 'lastname' )->getAttributeId ();
181
- $rq_sql_limit = '2500';
182
- if ($type_action == 'is_updated')
183
- $rq_sql_limit = '1';
184
- if ($list_type == 'N') {
185
- $rq_sql = '
186
- SELECT t.* FROM (
187
- SELECT ns.`subscriber_email` AS `email`, IFNULL(lastname.`value`, \'\') AS `lastname`, IFNULL(firstname.`value`, \'\') AS `firstname`
188
- FROM `' . $newsletter_subscriber . '` AS `ns`
189
- LEFT JOIN ' . $customer_entity_varchar . ' AS `lastname` ON lastname.`entity_id` = ns.`customer_id` AND lastname.`attribute_id` = ' . ( int ) $attr_lastname . '
190
- LEFT JOIN ' . $customer_entity_varchar . ' AS `firstname` ON firstname.`entity_id` = ns.`customer_id` AND firstname.`attribute_id` = ' . ( int ) $attr_firstname . '
191
- LEFT JOIN ' . $sarbacanedesktop . ' AS `s` ON s.`email` = ns.`subscriber_email` AND s.`store_id` = ns.`store_id` AND s.`list_type` = \'N\'
192
- WHERE ns.`subscriber_status` = 1
193
- AND ns.`store_id` = ' . ( int ) $store_id . '
194
- ) AS `t`
195
- LEFT JOIN ' . $sarbacanedesktop . ' AS `s` ON (s.`email` = t.`email` AND s.`list_type` = \'N\'
196
- AND s.`store_id` = ' . $db_write->quote ( $store_id ) . ' AND s.`sd_id` = ' . $db_write->quote ( $sd_id ) . '
197
- AND s.`lastname` = t.`lastname` AND s.`firstname` = t.`firstname`)
198
- WHERE s.`store_id` IS NULL
199
- LIMIT 0, ' . $rq_sql_limit;
200
- } else if ($list_type == 'C') {
201
- $add_customer_data = $this->checkIfListWithCustomerData ( $list_type, $store_id );
202
- if($add_customer_data){
203
- $rq_sql = "
204
- SELECT c.email AS email ,cevln.value as lastname , cevfn.value as firstname, MAX(sfo.base_grand_total) as amount_max_order, MIN(sfo.base_grand_total) as amount_min_order, AVG(sfo.base_grand_total) as amount_avg_order, MIN(sfo.created_at) as date_first_order, MAX(sfo.created_at) as date_last_order, COUNT(sfo.entity_id) as nb_orders, SUM(sfo.base_grand_total) as amount_all_orders,sd.sd_id,sd.orders_data
205
- FROM $customer_entity c
206
- LEFT JOIN $customer_entity_varchar cevln ON cevln.entity_id = c.entity_id AND cevln.attribute_id=7
207
- LEFT JOIN $customer_entity_varchar cevfn ON cevfn.entity_id = c.entity_id AND cevfn.attribute_id = 5
208
- LEFT JOIN $sales_flat_order sfo ON sfo.customer_id = c.entity_id
209
- LEFT JOIN $sarbacanedesktop sd ON sd.email = c.email AND sd.sd_id = ". $sd_id ." AND sd.list_type='C'
210
- WHERE c.store_id = ". $store_id ."
211
- GROUP BY c.entity_id
212
- HAVING nb_orders > 0 AND (sd.sd_id IS NULL OR sd.orders_data != CONCAT(MIN(sfo.base_grand_total),MAX(sfo.base_grand_total),COUNT(sfo.entity_id),SUM(sfo.base_grand_total)))
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  UNION
214
- SELECT sfo.customer_email AS email ,sfo.customer_lastname as lastname , sfo.customer_firstname as firstname, MAX(sfo.base_grand_total) as amount_max_order, MIN(sfo.base_grand_total) as amount_min_order, AVG(sfo.base_grand_total) as amount_avg_order, MIN(sfo.created_at) as date_first_order, MAX(sfo.created_at) as date_last_order, COUNT(sfo.entity_id) as nb_orders, SUM(sfo.base_grand_total) as amount_all_orders,sd.sd_id,sd.orders_data
 
 
 
 
215
  FROM $sales_flat_order sfo
216
- LEFT JOIN $sarbacanedesktop sd ON sd.email = sfo.customer_email AND sd.sd_id = ". $sd_id ." AND sd.list_type='C'
217
- WHERE sd.sd_id IS NULL AND sfo.customer_id IS NULL AND sfo.store_id = ". $store_id ."
218
- GROUP BY sfo.customer_email
219
- HAVING nb_orders > 0 AND (sd.sd_id IS NULL OR sd.orders_data != CONCAT(MIN(sfo.base_grand_total),MAX(sfo.base_grand_total),COUNT(sfo.entity_id),SUM(sfo.base_grand_total)))";
220
- }else{
221
- $rq_sql = "
222
- SELECT c.email AS email ,cevln.value as lastname , cevfn.value as firstname
223
- FROM $customer_entity c
224
- LEFT JOIN $customer_entity_varchar cevln ON cevln.entity_id = c.entity_id AND cevln.attribute_id=7
225
- LEFT JOIN $customer_entity_varchar cevfn ON cevfn.entity_id = c.entity_id AND cevfn.attribute_id = 5
226
- LEFT JOIN $sarbacanedesktop sd ON sd.email = c.email AND sd.sd_id = ". $sd_id ." AND sd.list_type='C'
227
- WHERE sd.sd_id IS NULL AND c.store_id = ". $store_id ."
228
- UNION
229
- SELECT sfo.customer_email AS email ,sfo.customer_lastname as lastname , sfo.customer_firstname as firstname
230
- FROM $sales_flat_order sfo
231
- LEFT JOIN $sarbacanedesktop sd ON sd.email = sfo.customer_email AND sd.sd_id = ". $sd_id ." AND sd.list_type='C'
232
- WHERE sd.sd_id IS NULL AND sfo.customer_id IS NULL AND sfo.store_id = ". $store_id ." ";
233
- }
234
- $rq_sql .=" LIMIT 0, 2500";
235
- } else {
236
- return;
237
- }
238
- if ($type_action == 'is_updated') {
239
- $rq = $db_read->fetchAll ( $rq_sql );
240
- return count ( $rq );
241
- } else {
242
- $rq = $db_read->query ( $rq_sql );
243
- $rq_sql_insert = '';
244
- $i = 0;
245
- while ( $r = $rq->fetch () ) {
246
- $line = "\r\n" . $this->dQuote ( $r ['email'] ) . ';'; // TEST
247
- $line .= $this->dQuote ( $r ['lastname'] ) . ';' . $this->dQuote ( $r ['firstname'] );
248
- $orders_data = '';
249
- if ($list_type == 'C') {
250
- if ($add_customer_data) {
251
- $line .= ';' . $this->dQuote ( $r ['date_first_order'] ) . ';' . $this->dQuote ( $r ['date_last_order'] );
252
- $line .= ';' . ( float ) $r ['amount_min_order'] . ';' . ( float ) $r ['amount_max_order'] . ';' . ( float ) $r ['amount_avg_order'];
253
- $line .= ';' . $r ['nb_orders'] . ';' . ( float ) $r ['amount_all_orders'];
254
- $orders_data = $r ['amount_min_order'] . $r ['amount_max_order'];
255
- $orders_data .= $r ['nb_orders'] . $r ['amount_all_orders'];
256
- }
257
- }
258
- $line .= ';S';
259
- echo $line;
260
- $insert_values = $db_write->quote ( $r ['email'] ) . ', ' . $db_write->quote ( $list_type ) . ', ' . $db_write->quote ( $store_id ) . ', ' . $db_write->quote ( $sd_id );
261
- $insert_values .= ', ' . $db_write->quote ( $r ['lastname'] ) . ', ' . $db_write->quote ( $r ['firstname'] ) . ', ' . $db_write->quote ( $orders_data );
262
- $rq_sql_insert .= ' (' . $insert_values . '),';
263
- if ($i == 200) {
264
- $rq_sql_insert = substr ( $rq_sql_insert, 0, - 1 );
265
- $rq_sql = '
266
- INSERT INTO `' . $sarbacanedesktop . '` (`email`, `list_type`, `store_id`, `sd_id`, `lastname`, `firstname`, `orders_data`) VALUES
267
- ' . $rq_sql_insert . '
268
- ON DUPLICATE KEY UPDATE
269
- `lastname` = VALUES(`lastname`),
270
- `firstname` = VALUES(`firstname`),
271
- `orders_data` = VALUES(`orders_data`)';
272
- $db_write->query ( $rq_sql );
273
- $rq_sql_insert = '';
274
- $i = 0;
275
- }
276
- $i ++;
277
- }
278
- if ($rq_sql_insert != '') {
279
- $rq_sql_insert = substr ( $rq_sql_insert, 0, - 1 );
280
- $rq_sql = '
281
- INSERT INTO `' . $sarbacanedesktop . '` (`email`, `list_type`, `store_id`, `sd_id`, `lastname`, `firstname`, `orders_data`) VALUES
282
- ' . $rq_sql_insert . '
283
- ON DUPLICATE KEY UPDATE
284
- `lastname` = VALUES(`lastname`),
285
- `firstname` = VALUES(`firstname`),
286
- `orders_data` = VALUES(`orders_data`)';
287
- $db_write->query ( $rq_sql );
288
- }
289
- }
290
- }
291
- private function processNewUnsubscribers($list_type, $store_id, $sd_id, $type_action = 'display') {
292
- $resource = Mage::getSingleton ( 'core/resource' );
293
- $db_read = $resource->getConnection ( 'core_read' );
294
- $db_write = $resource->getConnection ( 'core_write' );
295
- $sarbacanedesktop = $resource->getTableName ( 'sarbacanedesktop' );
296
- $newsletter_subscriber = $resource->getTableName ( 'newsletter_subscriber' );
297
- $customer_entity = $resource->getTableName ( 'customer_entity' );
298
-
299
- $rq_sql_limit = '2500';
300
- if ($type_action == 'is_updated')
301
- $rq_sql_limit = '1';
302
- if ($list_type == 'N') {
303
- $rq_sql = '
304
- SELECT s.`email`, s.`store_id`
305
- FROM `' . $sarbacanedesktop . '` AS s
306
- LEFT JOIN `' . $newsletter_subscriber . '` AS ns ON (ns.`subscriber_email` = s.`email` AND ns.`store_id` = s.`store_id` AND ns.`subscriber_status` = 1)
307
- WHERE s.`list_type` = \'N\' AND s.`store_id` = ' . $db_write->quote ( $store_id ) . ' AND s.`sd_id` = ' . $db_write->quote ( $sd_id ) . ' AND ns.`store_id` IS NULL';
308
- } else if ($list_type == 'C') {
309
- // REVOIR REQUETE
310
- $rq_sql = "SELECT * FROM " . $sarbacanedesktop . " WHERE 1=2";
311
- // $rq_sql = '
312
- // SELECT s.email, s.store_id FROM `' . $sarbacanedesktop . '` AS `s` LEFT JOIN ' . $customer_entity . ' AS c ON s.email = c.email WHERE c.is_active = 0';
313
- } else {
314
- return;
315
- }
316
- if ($type_action == 'is_updated') {
317
- $rq = $db_read->fetchAll ( $rq_sql );
318
- return count ( $rq );
319
- } else {
320
- $rq = $db_read->query ( $rq_sql );
321
- $rq_sql_delete = '';
322
- $i = 0;
323
- while ( $r = $rq->fetch () ) {
324
- $line = "\n" . $this->dQuote ( $r ['email'] ) . ';;'; // TEST
325
- if ($list_type == 'C') {
326
- if ($this->checkIfListWithCustomerData ( $list_type, $store_id )) {
327
- $line .= ';;;;;';
328
- }
329
- }
330
- $line .= ';U' . "\r\n";
331
- echo $line;
332
- $rq_sql_delete .= '(' . $db_write->quote ( $r ['email'] ) . '),';
333
- if ($i == 200) {
334
- $rq_sql_delete = substr ( $rq_sql_delete, 0, - 1 );
335
- $rq_sql = '
336
- DELETE FROM `' . $sarbacanedesktop . '`
337
- WHERE (`email`)
338
- IN (' . $rq_sql_delete . ')
339
- AND `list_type` = ' . $db_write->quote ( $list_type ) . '
340
- AND `store_id` = ' . $db_write->quote ( $store_id ) . '
341
- AND `sd_id` = ' . $db_write->quote ( $sd_id );
342
- $db_write->query ( $rq_sql );
343
- $rq_sql_delete = '';
344
- $i = 0;
345
- }
346
- $i ++;
347
- }
348
- if ($rq_sql_delete != '') {
349
- $rq_sql_delete = substr ( $rq_sql_delete, 0, - 1 );
350
- $rq_sql = '
351
- DELETE FROM `' . $sarbacanedesktop . '`
352
- WHERE (`email`)
353
- IN (' . $rq_sql_delete . ')
354
- AND `list_type` = ' . $db_write->quote ( $list_type ) . '
355
- AND `store_id` = ' . $db_write->quote ( $store_id ) . '
356
- AND `sd_id` = ' . $db_write->quote ( $sd_id );
357
- $db_write->query ( $rq_sql );
358
- }
359
- }
360
- }
361
  }
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Sarbacane
16
+ * @package Sarbacane_Mailify
17
+ * @author Sarbacane Software <contact@sarbacane.com>
18
+ * @copyright 2015 Sarbacane Software
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+ class Sarbacane_Mailify_IndexController extends Mage_Core_Controller_Front_Action {
22
+ private function saveSdid($sdid, $list) {
23
+ $resource = Mage::getSingleton ( 'core/resource' );
24
+ $db_write = $resource->getConnection ( 'core_write' );
25
+ $sarbacanedesktop_users = $resource->getTableName ( 'sarbacanedesktop_users' );
26
+ $rq_sql = 'DELETE FROM `' . $sarbacanedesktop_users . '` WHERE sd_type=\'sd_id\' AND sd_value=\'' . $sdid . '\' AND list_id=\'' . $list . '\'';
27
+ $rq = $db_write->query ( $rq_sql );
28
+ $rq_sql = '
29
+ INSERT INTO `' . $sarbacanedesktop_users . '` (`sd_type`, `sd_value`, `list_id`, `last_call_date` ) VALUES
30
+ (\'sd_id\', ' . $db_write->quote ( $sdid ) . ', \'' . $list . '\', \'' . date ( 'Y-m-d H:i:s' ) . '\')';
31
+ $rq = $db_write->query ( $rq_sql );
32
+ return;
33
+ }
34
+ public function indexAction() {
35
+ if (Mage::app ()->getRequest ()->getParam ( 'stk' ) && Mage::app ()->getRequest ()->getParam ( 'sdid' )) {
36
+ $sdid = Mage::app ()->getRequest ()->getParam ( 'sdid' );
37
+ if (Mage::app ()->getRequest ()->getParam ( 'stk' ) == Mage::helper ( 'mailify' )->getToken () && $sdid != '') {
38
+ $identifier = Mage::helper ( 'mailify' )->getConfiguration ( 'identifier' );
39
+ $sd_id = "";
40
+ $configuration = Mage::helper ( 'mailify' )->getConfiguration ( 'all' );
41
+ if ($configuration ['sd_token'] != '' && $configuration ['sd_list'] != '') {
42
+ $sd_list_array = Mage::helper ( 'mailify' )->getListConfiguration ( 'array' );
43
+ if ($sd_list_array != '') {
44
+ if (Mage::app ()->getRequest ()->getParam ( 'list' )) {
45
+ $list = Mage::app ()->getRequest ()->getParam ( 'list' );
46
+ $store_id = Mage::helper ( 'mailify' )->getStoreidFromList ( $list );
47
+ $list_type = Mage::helper ( 'mailify' )->getListTypeFromList ( $list );
48
+ $list_type_array = Mage::helper ( 'mailify' )->getListTypeArray ();
49
+ if (in_array ( $list_type, $list_type_array )) {
50
+ $id_and_list = $store_id . $list_type;
51
+ if (($list_type == 'N' && in_array ( $id_and_list . '0', $sd_list_array )) || ($list_type == 'C' && (in_array ( $id_and_list . '0', $sd_list_array ) || in_array ( $id_and_list . '1', $sd_list_array )))) {
52
+ $this->processNewUnsubcribersAndSubscribers ( $list_type, $store_id, $sdid );
53
+ $sd_id = $this->saveSdid ( $sdid, $list );
54
+ }else{
55
+ header ( 'HTTP/1.1 404 Not found' );
56
+ header ( "Content-type: application/json ; charset=utf-8" );
57
+ die ( 'FAILED_ID' );
58
+ }
59
+ } else {
60
+ header ( 'HTTP/1.1 404 Not found' );
61
+ header ( "Content-type: application/json ; charset=utf-8" );
62
+ die ( 'FAILED_ID' );
63
+ }
64
+ } else {
65
+ if ('delete' == Mage::app ()->getRequest ()->getParam ( 'action' )) {
66
+ Mage::helper ( 'mailify' )->deleteSdid ( $sd_id );
67
+ } else {
68
+ $this->getFormattedContentShops ( $sdid, $last_call_date );
69
+ }
70
+ }
71
+ }
72
+ }
73
+ } else {
74
+ header ( "HTTP/1.1 403 Unauthorized" );
75
+ header ( "Content-type: application/json; charset=utf-8" );
76
+ die ( 'FAILED_SDTOKEN' );
77
+ }
78
+ } else {
79
+ echo "Param&egrave;tre[s] manquant[s]";
80
+ }
81
+ }
82
+ private function processNewUnsubcribersAndSubscribers($list_type, $store_id, $sd_id) {
83
+ $resource = Mage::getSingleton ( 'core/resource' );
84
+ $db_read = $resource->getConnection ( 'core_read' );
85
+ $sarbacanedesktop_users = $resource->getTableName ( 'sarbacanedesktop_users' );
86
+ $rq_sql = 'SELECT last_call_date FROM ' . $sarbacanedesktop_users . ' WHERE sd_type=\'sd_id\' AND sd_value=\'' . $sd_id . '\' AND list_id=\'' . $store_id . $list_type . '\'';
87
+ $last_call_date = $db_read->fetchOne ( $rq_sql );
88
+ $line = 'email;lastname;firstname';
89
+ if ($list_type == 'C') {
90
+ if ($this->checkIfListWithCustomerData ( $list_type, $store_id )) {
91
+ $line .= ';date_first_order;date_last_order;amount_min_order;amount_max_order;amount_avg_order;nb_orders;amount_all_orders';
92
+ }
93
+ }
94
+ $line .= ';action';
95
+ echo $line;
96
+ $this->processNewUnsubscribers ( $list_type, $store_id, $sd_id, 'display', $last_call_date );
97
+ $this->processNewSubscribers ( $list_type, $store_id, $sd_id, 'display', $last_call_date );
98
+ }
99
+ private function getListTypeArray() {
100
+ return array (
101
+ 'N',
102
+ 'C'
103
+ );
104
+ }
105
+ private function checkIfListWithCustomerData($list_type, $store_id) {
106
+ $sd_list_array = Mage::helper ( 'mailify' )->getListConfiguration ( 'array' );
107
+ if (in_array ( $store_id . $list_type . '1', $sd_list_array )) {
108
+ return true;
109
+ }
110
+ return false;
111
+ }
112
+ private function getFormattedContentShops($sd_id) {
113
+ $stores = Mage::helper ( 'mailify' )->getStoresArray ();
114
+ echo 'list_id;name;reset;is_updated;type;version' . "\n";
115
+ $sd_list_array = Mage::helper ( 'mailify' )->getListConfiguration ( 'array' );
116
+ $list_array = array ();
117
+ foreach ( $sd_list_array as $list ) {
118
+ $store_id = Mage::helper ( 'mailify' )->getStoreidFromList ( $list );
119
+ $list_type = Mage::helper ( 'mailify' )->getListTypeFromList ( $list );
120
+ array_push ( $list_array, array (
121
+ 'store_id' => $store_id,
122
+ 'list_type' => $list_type,
123
+ 'list_id' => $list
124
+ ) );
125
+ }
126
+ foreach ( $stores as $store ) {
127
+ foreach ( $list_array as $list ) {
128
+ if ($store ['store_id'] == $list ['store_id']) {
129
+ $store_list = "" . $store ['store_id'] . $list ['list_type'] . ';' . $this->dQuote ( $store ['store_name'] ) . ';'; // TEST
130
+ $store_list .= $this->listIsResetted ( $store ['store_id'] . $list ['list_type'], $sd_id ) . ';';
131
+ $store_list .= $this->listIsUpdated ( $store ['store_id'], $list ['list_type'], $sd_id ) . ';';
132
+ $store_list .= 'Magento;1.0.0.4' . "\n";
133
+ echo $store_list;
134
+ }
135
+ }
136
+ }
137
+ }
138
+ private function listIsResetted($list_id, $sd_id) {
139
+ $resource = Mage::getSingleton ( 'core/resource' );
140
+ $db_read = $resource->getConnection ( 'core_read' );
141
+ $sarbacanedesktop_users = $resource->getTableName ( 'sarbacanedesktop_users' );
142
+ $rq_sql = '
143
+ SELECT count(*) AS `nb_in_table`
144
+ FROM ' . $sarbacanedesktop_users . '
145
+ WHERE `sd_type` = "sd_id"
146
+ AND `sd_value` = ' . $db_read->quote ( $sd_id ) . ' AND list_id="' . $list_id . '"';
147
+ $nb_in_table = $db_read->fetchOne ( $rq_sql );
148
+ if ($nb_in_table == 0)
149
+ return 'Y';
150
+ return 'N';
151
+ }
152
+ private function listIsUpdated($store_id, $list_type, $sd_id) {
153
+ $resource = Mage::getSingleton ( 'core/resource' );
154
+ $db_read = $resource->getConnection ( 'core_read' );
155
+ $sarbacanedesktop_users = $resource->getTableName ( 'sarbacanedesktop_users' );
156
+ $rq_sql = 'SELECT last_call_date FROM ' . $sarbacanedesktop_users . ' WHERE sd_type=\'sd_id\' AND sd_value=\'' . $sd_id . '\' AND list_id=\'' . $store_id . $list_type . '\'';
157
+ $last_call_date = $db_read->fetchOne ( $rq_sql );
158
+ $is_updated_list = 'N';
159
+ if ($this->processNewUnsubscribers ( $list_type, $store_id, $sd_id, 'is_updated', $last_call_date ) > 0) {
160
+ $is_updated_list = 'Y';
161
+ }
162
+ if ($this->processNewSubscribers ( $list_type, $store_id, $sd_id, 'is_updated', $last_call_date ) > 0) {
163
+ $is_updated_list = 'Y';
164
+ }
165
+ return $is_updated_list;
166
+ }
167
+ private function dQuote($value) {
168
+ $value = str_replace ( '"', '""', $value );
169
+ if (strpos ( $value, ' ' ) || strpos ( $value, ';' )) {
170
+ $value = '"' . $value . '"';
171
+ }
172
+ return $value;
173
+ }
174
+ private function processNewSubscribers($list_type, $store_id, $sd_id, $type_action = 'display', $last_call_date) {
175
+ $resource = Mage::getSingleton ( 'core/resource' );
176
+ $db_read = $resource->getConnection ( 'core_read' );
177
+ $db_write = $resource->getConnection ( 'core_write' );
178
+ $sd_updates = $resource->getTableName ( 'sd_updates' );
179
+ $newsletter_subscriber = $resource->getTableName ( 'newsletter_subscriber' );
180
+ $sales_flat_order = $resource->getTableName ( 'sales_flat_order' );
181
+ $customer_entity = $resource->getTableName ( 'customer_entity' );
182
+ $customer_entity_varchar = $resource->getTableName ( 'customer_entity_varchar' );
183
+ $core_store = $resource->getTableName ( 'core_store' ); // core store
184
+ $attr_firstname = Mage::getModel ( 'customer/customer' )->getAttribute ( 'firstname' )->getAttributeId ();
185
+ $attr_lastname = Mage::getModel ( 'customer/customer' )->getAttribute ( 'lastname' )->getAttributeId ();
186
+ $rq_sql_limit = '2500';
187
+ if ($type_action == 'is_updated')
188
+ $rq_sql_limit = '1';
189
+ if ($list_type == 'N') {
190
+ if ($last_call_date != null && $last_call_date != '') {
191
+ $rq_sql = 'SELECT sdu.`email` AS `email`, IFNULL(lastname.`value`, \'\') AS `lastname`, IFNULL(firstname.`value`, \'\') AS `firstname`
192
+ FROM `' . $sd_updates . '` AS `sdu`
193
+ LEFT JOIN ' . $newsletter_subscriber . ' ns ON ns.subscriber_email = sdu.email
194
+ LEFT JOIN ' . $customer_entity_varchar . ' AS `lastname` ON lastname.`entity_id` = ns.`customer_id` AND lastname.`attribute_id` = ' . ( int ) $attr_lastname . '
195
+ LEFT JOIN ' . $customer_entity_varchar . ' AS `firstname` ON firstname.`entity_id` = ns.`customer_id` AND firstname.`attribute_id` = ' . ( int ) $attr_firstname . '
196
+ WHERE ns.`subscriber_status` = 1 AND sdu.update_time > "' . $last_call_date . '" AND sdu.list_type="N" AND sdu.action="S"
197
+ AND ns.`store_id` = ' . ( int ) $store_id . '
198
+ LIMIT 0, ' . $rq_sql_limit;
199
+ } else {
200
+ $rq_sql = '
201
+ SELECT ns.`subscriber_email` AS `email`, IFNULL(lastname.`value`, \'\') AS `lastname`, IFNULL(firstname.`value`, \'\') AS `firstname`
202
+ FROM `' . $newsletter_subscriber . '` AS `ns`
203
+ LEFT JOIN ' . $customer_entity_varchar . ' AS `lastname` ON lastname.`entity_id` = ns.`customer_id` AND lastname.`attribute_id` = ' . ( int ) $attr_lastname . '
204
+ LEFT JOIN ' . $customer_entity_varchar . ' AS `firstname` ON firstname.`entity_id` = ns.`customer_id` AND firstname.`attribute_id` = ' . ( int ) $attr_firstname . '
205
+ WHERE ns.`subscriber_status` = 1
206
+ AND ns.`store_id` = ' . ( int ) $store_id . '
207
+ LIMIT 0, ' . $rq_sql_limit;
208
+ }
209
+ } else if ($list_type == 'C') {
210
+ $add_customer_data = $this->checkIfListWithCustomerData ( $list_type, $store_id );
211
+ $rq_sql = "
212
+ SELECT c.email AS email ,cevln.value as lastname , cevfn.value as firstname";
213
+ if ($add_customer_data) {
214
+ $rq_sql .= ", MAX(sfo.base_grand_total) as amount_max_order, MIN(sfo.base_grand_total) as amount_min_order, AVG(sfo.base_grand_total) as amount_avg_order, MIN(sfo.created_at) as date_first_order, MAX(sfo.created_at) as date_last_order, COUNT(sfo.entity_id) as nb_orders, SUM(sfo.base_grand_total) as amount_all_orders";
215
+ }
216
+ $rq_sql .= " FROM $customer_entity c LEFT JOIN $customer_entity_varchar cevln ON cevln.entity_id = c.entity_id AND cevln.attribute_id=7
217
+ LEFT JOIN $customer_entity_varchar cevfn ON cevfn.entity_id = c.entity_id AND cevfn.attribute_id = 5";
218
+ if ($add_customer_data) {
219
+ $rq_sql .= " LEFT JOIN $sales_flat_order sfo ON sfo.customer_id = c.entity_id ";
220
+ }
221
+ $rq_sql .= " WHERE c.store_id = " . $store_id;
222
+ if ($last_call_date != null && $last_call_date != '') {
223
+ $rq_sql .= " AND (c.created_at > '" . $last_call_date . "' OR c.updated_at > '" . $last_call_date . "' OR sfo.created_at > '" . $last_call_date . "' OR sfo.updated_at > '" . $last_call_date . "') ";
224
+ }
225
+ $rq_sql .= " GROUP BY c.email
226
  UNION
227
+ SELECT sfo.customer_email AS email ,sfo.customer_lastname as lastname, sfo.customer_firstname as firstname";
228
+ if ($add_customer_data) {
229
+ $rq_sql .= ", MAX(sfo.base_grand_total) as amount_max_order, MIN(sfo.base_grand_total) as amount_min_order, AVG(sfo.base_grand_total) as amount_avg_order, MIN(sfo.created_at) as date_first_order, MAX(sfo.created_at) as date_last_order, COUNT(sfo.entity_id) as nb_orders, SUM(sfo.base_grand_total) as amount_all_orders";
230
+ }
231
+ $rq_sql .= "
232
  FROM $sales_flat_order sfo
233
+ WHERE sfo.customer_id IS NULL AND sfo.store_id = " . $store_id;
234
+ if ($last_call_date != null && $last_call_date != '') {
235
+ $rq_sql .= " AND (sfo.created_at > '" . $last_call_date . "' OR sfo.updated_at > '" . $last_call_date . "') ";
236
+ }
237
+ $rq_sql .= " GROUP BY sfo.customer_email ";
238
+
239
+ $rq_sql .= " LIMIT 0, " . $rq_sql_limit;
240
+ } else {
241
+ return;
242
+ }
243
+ if ($type_action == 'is_updated') {
244
+ $rq = $db_read->fetchAll ( $rq_sql );
245
+ return count ( $rq );
246
+ } else {
247
+ $rq = $db_read->query ( $rq_sql );
248
+ while ( $r = $rq->fetch () ) {
249
+ $line = "\r\n" . $this->dQuote ( $r ['email'] ) . ';'; // TEST
250
+ $line .= $this->dQuote ( $r ['lastname'] ) . ';' . $this->dQuote ( $r ['firstname'] );
251
+ $orders_data = '';
252
+ if ($list_type == 'C') {
253
+ if ($add_customer_data) {
254
+ $line .= ';' . $this->dQuote ( $r ['date_first_order'] ) . ';' . $this->dQuote ( $r ['date_last_order'] );
255
+ $line .= ';' . ( float ) $r ['amount_min_order'] . ';' . ( float ) $r ['amount_max_order'] . ';' . ( float ) $r ['amount_avg_order'];
256
+ $line .= ';' . $r ['nb_orders'] . ';' . ( float ) $r ['amount_all_orders'];
257
+ $orders_data = $r ['amount_min_order'] . $r ['amount_max_order'];
258
+ $orders_data .= $r ['nb_orders'] . $r ['amount_all_orders'];
259
+ }
260
+ }
261
+ $line .= ';S';
262
+ echo $line;
263
+ }
264
+ }
265
+ }
266
+ private function processNewUnsubscribers($list_type, $store_id, $sd_id, $type_action = 'display', $last_call_date) {
267
+ $resource = Mage::getSingleton ( 'core/resource' );
268
+ $db_read = $resource->getConnection ( 'core_read' );
269
+
270
+ $sd_updates = $resource->getTableName ( 'sd_updates' );
271
+
272
+ $rq_sql_limit = '2500';
273
+ if ($type_action == 'is_updated')
274
+ $rq_sql_limit = '1';
275
+ switch ($list_type) {
276
+ case 'N' :
277
+ case 'C' :
278
+ $rq_sql = 'SELECT email FROM ' . $sd_updates . ' WHERE list_type="' . $list_type . '" AND action = "U"';
279
+ if ($last_call_date != null && $last_call_date != '') {
280
+ $rq_sql .= ' AND update_time > "' . $last_call_date . '"';
281
+ }
282
+ break;
283
+ default :
284
+ return;
285
+ }
286
+ if ($type_action == 'is_updated') {
287
+ $rq = $db_read->fetchAll ( $rq_sql );
288
+ return count ( $rq );
289
+ } else {
290
+ $rq = $db_read->query ( $rq_sql );
291
+ while ( $r = $rq->fetch () ) {
292
+ $line = "\n" . $this->dQuote ( $r ['email'] ) . ';;'; // TEST
293
+ if ($list_type == 'C') {
294
+ if ($this->checkIfListWithCustomerData ( $list_type, $store_id )) {
295
+ $line .= ';;;;;';
296
+ }
297
+ }
298
+ $line .= ';U' . "\r\n";
299
+ echo $line;
300
+ }
301
+ }
302
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  }
app/code/community/Sarbacane/Mailify/etc/config.xml CHANGED
@@ -23,7 +23,7 @@
23
  <config>
24
  <modules>
25
  <Sarbacane_Mailify>
26
- <version>1.0.0.0</version>
27
  </Sarbacane_Mailify>
28
  </modules>
29
  <frontend>
23
  <config>
24
  <modules>
25
  <Sarbacane_Mailify>
26
+ <version>1.0.0.4</version>
27
  </Sarbacane_Mailify>
28
  </modules>
29
  <frontend>
app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-upgrade-1.0.0.0-1.0.0.1.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Sarbacane
16
+ * @package Sarbacane_Sarbacanedesktop
17
+ * @author Sarbacane Software <contact@sarbacane.com>
18
+ * @copyright 2015 Sarbacane Software
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ $installer = $this;
23
+ $installer->startSetup();
24
+
25
+ $installer->endSetup();
app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-upgrade-1.0.0.1-1.0.0.2.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Sarbacane
16
+ * @package Sarbacane_Sarbacanedesktop
17
+ * @author Sarbacane Software <contact@sarbacane.com>
18
+ * @copyright 2015 Sarbacane Software
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ $installer = $this;
23
+ $installer->startSetup();
24
+
25
+ $installer->endSetup();
app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-upgrade-1.0.0.2-1.0.0.3.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Sarbacane
16
+ * @package Sarbacane_Sarbacanedesktop
17
+ * @author Sarbacane Software <contact@sarbacane.com>
18
+ * @copyright 2015 Sarbacane Software
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ $installer = $this;
23
+ $installer->startSetup();
24
+
25
+ $installer->endSetup();
app/code/community/Sarbacane/Mailify/sql/mailify_setup/mysql4-upgrade-1.0.0.3-1.0.0.4.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Sarbacane
16
+ * @package Sarbacane_Sarbacanedesktop
17
+ * @author Sarbacane Software <contact@sarbacane.com>
18
+ * @copyright 2015 Sarbacane Software
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+
22
+ $installer = $this;
23
+ $installer->startSetup();
24
+
25
+ $installer->run("DROP TABLE IF EXISTS `{$this->getTable('sarbacanedesktop')}`;");
26
+ $installer->run("DROP TABLE IF EXISTS `{$this->getTable('sd_updates')}`;");
27
+
28
+ $installer->run("ALTER TABLE `{$this->getTable('sarbacanedesktop_users')}` ADD COLUMN `list_id` VARCHAR(50) NULL DEFAULT NULL AFTER `sd_value`;");
29
+ $installer->run("ALTER TABLE `{$this->getTable('sarbacanedesktop_users')}` ADD COLUMN `last_call_date` VARCHAR(50) NULL DEFAULT NULL AFTER `list_id`;");
30
+
31
+ $installer->run("
32
+ CREATE TABLE `{$this->getTable('sd_updates')}` (
33
+ `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
34
+ `email` VARCHAR(50) NOT NULL COLLATE 'utf8_bin',
35
+ `update_time` DATETIME NOT NULL,
36
+ `action` VARCHAR(5) NOT NULL COLLATE 'utf8_bin',
37
+ `list_type` VARCHAR(10) NULL DEFAULT NULL COLLATE 'utf8_bin',
38
+ PRIMARY KEY (`id`),
39
+ INDEX `update_time_action` (`update_time`, `action`)
40
+ )
41
+ COMMENT='Contains useful data used by SD/MF plugin'
42
+ COLLATE='utf8_bin'
43
+ ENGINE=InnoDB
44
+ ;");
45
+
46
+ $installer->run("DROP TRIGGER IF EXISTS sd_newsletter_update;");
47
+ $installer->run("DROP TRIGGER IF EXISTS sd_customer_delete;");
48
+
49
+ $write = Mage::getSingleton('core/resource')->getConnection('core_write');
50
+
51
+ $sql= "
52
+ CREATE TRIGGER `sd_newsletter_update`
53
+ AFTER UPDATE ON `{$this->getTable('newsletter_subscriber')}`
54
+ FOR EACH ROW BEGIN
55
+ DELETE FROM {$this->getTable('sd_updates')} WHERE email=NEW.subscriber_email AND list_type='N';
56
+ IF NEW.subscriber_status = 1 THEN
57
+ INSERT INTO {$this->getTable('sd_updates')} (email,update_time,action,list_type) VALUES (NEW.subscriber_email,UTC_TIMESTAMP(),'S','N');
58
+ ELSE
59
+ INSERT INTO {$this->getTable('sd_updates')} (email,update_time,action,list_type) VALUES (NEW.subscriber_email,UTC_TIMESTAMP(),'U','N');
60
+ END IF;
61
+ END;";
62
+ $write->exec($sql);
63
+
64
+ $sql= "
65
+ CREATE TRIGGER `sd_newsletter_insert`
66
+ AFTER INSERT ON `{$this->getTable('newsletter_subscriber')}`
67
+ FOR EACH ROW BEGIN
68
+ DELETE FROM {$this->getTable('sd_updates')} WHERE email=NEW.subscriber_email AND list_type='N';
69
+ IF NEW.subscriber_status = 1 THEN
70
+ INSERT INTO {$this->getTable('sd_updates')} (email,update_time,action,list_type) VALUES (NEW.subscriber_email,UTC_TIMESTAMP(),'S','N');
71
+ ELSE
72
+ INSERT INTO {$this->getTable('sd_updates')} (email,update_time,action,list_type) VALUES (NEW.subscriber_email,UTC_TIMESTAMP(),'U','N');
73
+ END IF;
74
+ END;";
75
+ $write->exec($sql);
76
+
77
+ $sql = "
78
+ CREATE TRIGGER `sd_customer_delete`
79
+ BEFORE DELETE ON `{$this->getTable('customer_entity')}`
80
+ FOR EACH ROW BEGIN
81
+ DELETE FROM {$this->getTable('sd_updates')} WHERE email=OLD.email AND list_type='C';
82
+ INSERT INTO {$this->getTable('sd_updates')} (email,update_time,action,list_type) VALUES (OLD.email,UTC_TIMESTAMP(),'U','C');
83
+ END";
84
+ $write->exec($sql);
85
+
86
+
87
+ $installer->endSetup();
app/locale/en_US/Sarbacane_Mailify.csv CHANGED
@@ -25,7 +25,7 @@
25
  "Tel:","Tel:"
26
  "+33(0) 328 328 040","(646)-844-0983"
27
  "Website:","Website : "
28
- "http://www.sarbacane.com/?utm_source=module-prestashop&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=prestashop","http://www.mailify.com/?lng=EN&utm_source=module-magento&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=magento"
29
  "http://www.sarbacane.com","http://www.mailify.com"
30
  "How to set up the module?","How to set up the module?"
31
  "Do you already have a Sarbacane Desktop account?","Do you already have a Mailify account?"
@@ -47,12 +47,12 @@
47
  "- Average amount of the orders placed","- Average amount of the orders placed"
48
  "Previous","Previous"
49
  "Download and install Sarbacane","Download and install Mailify"
50
- "https://www.sarbacane.com/ws/soft-redirect.asp?key=heXmrxBEUO&com=PrestaShopInfo","https://static.mailify.com/ws/soft-redirect.asp?key=as8Ku4rGIs&com=MagentoInfo&lng=EN"
51
  "Create your free account","Create your free account"
52
  "Enable the Prestashop extension in our extensions menu, and then fill in the following fields:","Enable the Magento extension in our extensions menu, and then fill in the following fields:"
53
  "Url","Url"
54
  "Key","Key"
55
  "Generate a new key","Generate a new key"
56
  "Read more","Read more"
57
- "http://www.sarbacane.com/faq/extensions/configuration-plugin-prestashop/?utm_source=module-prestashop&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=prestashop","https://static.mailify.com/ws/soft-redirect.asp?key=pS8AD5f3a9&com=MagentoFAQ&lng=EN"
58
  "in the help section online","in the help section online"
25
  "Tel:","Tel:"
26
  "+33(0) 328 328 040","(646)-844-0983"
27
  "Website:","Website : "
28
+ "http://www.sarbacane.com/?utm_source=module-prestashop&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=prestashop","http://www.mailify.com/?lng=EN&utm_source=module-prestashop&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=prestashop"
29
  "http://www.sarbacane.com","http://www.mailify.com"
30
  "How to set up the module?","How to set up the module?"
31
  "Do you already have a Sarbacane Desktop account?","Do you already have a Mailify account?"
47
  "- Average amount of the orders placed","- Average amount of the orders placed"
48
  "Previous","Previous"
49
  "Download and install Sarbacane","Download and install Mailify"
50
+ "https://www.sarbacane.com/ws/soft-redirect.asp?key=heXmrxBEUO&com=PrestaShopInfo","https://static.mailify.com/ws/soft-redirect.asp?key=heXmrxBEUO&com=PrestaShopInfo&lng=EN"
51
  "Create your free account","Create your free account"
52
  "Enable the Prestashop extension in our extensions menu, and then fill in the following fields:","Enable the Magento extension in our extensions menu, and then fill in the following fields:"
53
  "Url","Url"
54
  "Key","Key"
55
  "Generate a new key","Generate a new key"
56
  "Read more","Read more"
57
+ "http://www.sarbacane.com/faq/extensions/configuration-plugin-prestashop/?utm_source=module-prestashop&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=prestashop","http://www.mailify.com/faq/extensions/configuration-prestashop/?lng=EN&utm_source=module-prestashop&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=prestashop"
58
  "in the help section online","in the help section online"
app/locale/es_ES/Sarbacane_Mailify.csv CHANGED
@@ -25,7 +25,7 @@
25
  "Tel:","Tel:"
26
  "+33(0) 328 328 040","+34 93 4763638"
27
  "Website:","Web : "
28
- "http://www.sarbacane.com/?utm_source=module-prestashop&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=prestashop","http://es.mailify.com/?lng=ES&utm_source=module-magento&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=magento"
29
  "http://www.sarbacane.com","http://es.mailify.com"
30
  "How to set up the module?","¿Cómo configurar el módulo?"
31
  "Do you already have a Sarbacane Desktop account?","¿Ya eres usuario Mailify?"
@@ -47,12 +47,12 @@
47
  "- Average amount of the orders placed","- Importe medio de pedidos"
48
  "Previous","Anterior"
49
  "Download and install Sarbacane","Descarga e instala Mailify"
50
- "https://www.sarbacane.com/ws/soft-redirect.asp?key=heXmrxBEUO&com=PrestaShopInfo","https://static.mailify.com/ws/soft-redirect.asp?key=as8Ku4rGIs&com=MagentoInfo&lng=ES"
51
  "Create your free account","Crea tu cuenta gratis"
52
  "Enable the Prestashop extension in our extensions menu, and then fill in the following fields:","Activa la extensión Magento desde el menú ''Extensiones'' en Mailify e introduce los siguientes datos:"
53
  "Url","Url"
54
  "Key","Clave"
55
  "Generate a new key","Generar una nueva clave"
56
  "Read more","Leer más en la"
57
- "http://www.sarbacane.com/faq/extensions/configuration-plugin-prestashop/?utm_source=module-prestashop&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=prestashop","https://static.mailify.com/ws/soft-redirect.asp?key=pS8AD5f3a9&com=MagentoFAQ&lng=ES"
58
  "in the help section online","ayuda en línea"
25
  "Tel:","Tel:"
26
  "+33(0) 328 328 040","+34 93 4763638"
27
  "Website:","Web : "
28
+ "http://www.sarbacane.com/?utm_source=module-prestashop&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=prestashop","http://es.mailify.com/?lng=ES&utm_source=module-prestashop&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=prestashop"
29
  "http://www.sarbacane.com","http://es.mailify.com"
30
  "How to set up the module?","¿Cómo configurar el módulo?"
31
  "Do you already have a Sarbacane Desktop account?","¿Ya eres usuario Mailify?"
47
  "- Average amount of the orders placed","- Importe medio de pedidos"
48
  "Previous","Anterior"
49
  "Download and install Sarbacane","Descarga e instala Mailify"
50
+ "https://www.sarbacane.com/ws/soft-redirect.asp?key=heXmrxBEUO&com=PrestaShopInfo","https://static.mailify.com/ws/soft-redirect.asp?key=heXmrxBEUO&com=PrestaShopInfo&lng=ES"
51
  "Create your free account","Crea tu cuenta gratis"
52
  "Enable the Prestashop extension in our extensions menu, and then fill in the following fields:","Activa la extensión Magento desde el menú ''Extensiones'' en Mailify e introduce los siguientes datos:"
53
  "Url","Url"
54
  "Key","Clave"
55
  "Generate a new key","Generar una nueva clave"
56
  "Read more","Leer más en la"
57
+ "http://www.sarbacane.com/faq/extensions/configuration-plugin-prestashop/?utm_source=module-prestashop&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=prestashop","https://es.mailify.com/faq/herramientas-analisis-email-marketing/configurar-plugin-prestashop/?lng=ES&utm_source=module-prestashop&utm_medium=plugin&utm_content=lien-sarbacane&utm_campaign=prestashop"
58
  "in the help section online","ayuda en línea"
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Sarbacane_Mailify</name>
4
- <version>1.0.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/academic.php">AFL</license>
7
  <channel>community</channel>
@@ -58,11 +58,11 @@
58
  &lt;li&gt;Possibilit&#xE9; de cibler et exploiter les contacts en fonction de leurs donn&#xE9;es de commandes pour des campagnes plus efficaces&lt;/li&gt;&#xD;
59
  &lt;li&gt;Statistiques d&#xE9;taill&#xE9;es, g&#xE9;olocalisation, d&#xE9;tection des ouvertures, temps d'ouvertures, clics, type de messageries, d&#xE9;sabonnements, adresses erronn&#xE9;es, etc.&lt;/li&gt;&#xD;
60
  &lt;/ul&gt;</description>
61
- <notes>Fixes some links</notes>
62
  <authors><author><name>Sarbacane Software</name><user>egavard</user><email>connectors@sarbacane.com</email></author></authors>
63
- <date>2015-06-17</date>
64
- <time>15:06:48</time>
65
- <contents><target name="magecommunity"><dir name="Sarbacane"><dir name="Mailify"><dir name="Block"><dir name="Adminhtml"><file name="Mailify.php" hash="f0ad71d64dc619421a67a3af24b23278"/></dir></dir><dir name="Helper"><file name="Data.php" hash="0209b2a9566288c2b030552d8bb2d85b"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MailifyController.php" hash="a9088e5aab6fbaef8daa9b0f9aac663d"/></dir><file name="IndexController.php" hash="e34bfde04c99e0fec91c22eb15f52bbc"/></dir><dir name="etc"><file name="config.xml" hash="f1170aa559d1d6ceef7f4ebf22fc8ce8"/></dir><dir name="sql"><dir name="mailify_setup"><file name="mysql4-install-1.0.0.0.php" hash="82834af7ce95c1bd9d3063ffdf3a11f5"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="Sarbacane_Mailify"><file name="mailify.css" hash="6fcee54bdab10db72a361ec5a139cc7c"/></dir></dir><dir name="images"><file name="sd.png" hash="2038d3c503e8f59d14177a131bef7537"/></dir><dir name="js"><dir name="Sarbacane_Mailify"><file name="mailify.js" hash="d38d9ec858dfdce14e0156acc87c1c50"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mailify.xml" hash="2ce0ac9b7cd4ec8adf80494c86aaae10"/></dir><dir name="template"><dir name="mailify"><file name="mailify.phtml" hash="01ed4cea3b25957dbfbb2ad3e99c41e8"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Sarbacane_Mailify.xml" hash="daf2fd2fbde04d804b1fdd7671273c82"/></dir></dir></dir></target><target name="magelocale"><dir name="es_ES"><file name="Sarbacane_Mailify.csv" hash="168cc69eed53a792a539ce1045d19aac"/></dir><dir name="en_US"><file name="Sarbacane_Mailify.csv" hash="324d42d9744e33d635020b84fb6262d6"/></dir></target></contents>
66
  <compatible/>
67
  <dependencies><required><php><min>5.0.0</min><max>5.6.9</max></php></required></dependencies>
68
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Sarbacane_Mailify</name>
4
+ <version>1.0.0.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/academic.php">AFL</license>
7
  <channel>community</channel>
58
  &lt;li&gt;Possibilit&#xE9; de cibler et exploiter les contacts en fonction de leurs donn&#xE9;es de commandes pour des campagnes plus efficaces&lt;/li&gt;&#xD;
59
  &lt;li&gt;Statistiques d&#xE9;taill&#xE9;es, g&#xE9;olocalisation, d&#xE9;tection des ouvertures, temps d'ouvertures, clics, type de messageries, d&#xE9;sabonnements, adresses erronn&#xE9;es, etc.&lt;/li&gt;&#xD;
60
  &lt;/ul&gt;</description>
61
+ <notes>This release hugely improves the plugin behavior. No more useless data are stored.</notes>
62
  <authors><author><name>Sarbacane Software</name><user>egavard</user><email>connectors@sarbacane.com</email></author></authors>
63
+ <date>2015-06-25</date>
64
+ <time>15:08:30</time>
65
+ <contents><target name="magecommunity"><dir name="Sarbacane"><dir name="Mailify"><dir name="Block"><dir name="Adminhtml"><file name="Mailify.php" hash="f0ad71d64dc619421a67a3af24b23278"/></dir></dir><dir name="Helper"><file name="Data.php" hash="00fbadd2b8c1d7d4c88f20edb09721a9"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MailifyController.php" hash="3e8e56c95f4453af3fa9853f946bce9e"/></dir><file name="IndexController.php" hash="a84d67560076b3e0a555503fd0bc7889"/></dir><dir name="etc"><file name="config.xml" hash="0c8052e8c0c88f71148193f672cf382a"/></dir><dir name="sql"><dir name="mailify_setup"><file name="mysql4-install-1.0.0.0.php" hash="82834af7ce95c1bd9d3063ffdf3a11f5"/><file name="mysql4-upgrade-1.0.0.0-1.0.0.1.php" hash="35660ae27bb6ef74c885ad86284f9071"/><file name="mysql4-upgrade-1.0.0.1-1.0.0.2.php" hash="35660ae27bb6ef74c885ad86284f9071"/><file name="mysql4-upgrade-1.0.0.2-1.0.0.3.php" hash="35660ae27bb6ef74c885ad86284f9071"/><file name="mysql4-upgrade-1.0.0.3-1.0.0.4.php" hash="2bd5ea1d79115c1a6ba919a708b1fb4b"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="Sarbacane_Mailify"><file name="mailify.css" hash="6fcee54bdab10db72a361ec5a139cc7c"/></dir></dir><dir name="images"><file name="sd.png" hash="2038d3c503e8f59d14177a131bef7537"/></dir><dir name="js"><dir name="Sarbacane_Mailify"><file name="mailify.js" hash="d38d9ec858dfdce14e0156acc87c1c50"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mailify.xml" hash="2ce0ac9b7cd4ec8adf80494c86aaae10"/></dir><dir name="template"><dir name="mailify"><file name="mailify.phtml" hash="01ed4cea3b25957dbfbb2ad3e99c41e8"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Sarbacane_Mailify.xml" hash="daf2fd2fbde04d804b1fdd7671273c82"/></dir></dir></dir></target><target name="magelocale"><dir name="es_ES"><file name="Sarbacane_Mailify.csv" hash="8935ea92f97fa8f488ce2d6e22dcc1f6"/></dir><dir name="en_US"><file name="Sarbacane_Mailify.csv" hash="5e35719a54d7d7729af24a83e65861b0"/></dir></target></contents>
66
  <compatible/>
67
  <dependencies><required><php><min>5.0.0</min><max>5.6.9</max></php></required></dependencies>
68
  </package>