MailUp - Version 2.7.0

Version Notes


  • NEW: Specify default group for new subscribers to be added to

  • NEW: Segmenting customers:

    • You can choose a custom subscription message ID

    • Can chose all customers who have not opted-in



  • NEW: Connection check for url, username and password to make entering your details easier

  • Improvement: Shopping-cart abandonment fields cleared immediately after order

  • Improvement: Task and log lists now show most recent first

Download this release

Release Info

Developer MailUp
Extension MailUp
Version 2.7.0
Comparing to
See all releases


Code changes from version 2.6.1 to 2.7.0

Files changed (99) hide show
  1. app/code/local/MailUp/MailUpSync/.DS_Store +0 -0
  2. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Adminhtml/Log.php +1 -1
  3. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Adminhtml/Log/Grid.php +4 -1
  4. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Adminhtml/Mailup/Grid.php +6 -54
  5. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Adminhtml/Mailupbackend.php +1 -1
  6. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Adminhtml/Sync.php +1 -1
  7. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Adminhtml/Sync/Grid.php +4 -12
  8. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Adminhtml/System/Config/Form/Field/Timezone.php +1 -1
  9. app/code/local/MailUp/MailUpSync/Block/Adminhtml/System/Config/Form/Testbutton.php +35 -0
  10. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Checkout/Subscribe.php +1 -1
  11. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Filters.php +2 -2
  12. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Index.php +1 -1
  13. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Helper/Customer.php +1 -1
  14. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Helper/Data.php +219 -15
  15. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Helper/Order.php +1 -1
  16. app/code/local/MailUp/MailUpSync/Model/.DS_Store +0 -0
  17. app/code/local/MailUp/MailUpSync/Model/Adminhtml/.DS_Store +0 -0
  18. app/code/local/MailUp/MailUpSync/Model/Adminhtml/System/.DS_Store +0 -0
  19. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Adminhtml/System/Clone/Mappings/Custom.php +2 -2
  20. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Adminhtml/System/Source/Cron/Frequency.php +2 -2
  21. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Adminhtml/System/Source/Cron/Hours.php +1 -1
  22. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Adminhtml/System/Source/Fields.php +2 -2
  23. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Config.php +14 -2
  24. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Consoleurlvalidator.php +1 -1
  25. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Cron.php +16 -10
  26. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Job.php +9 -8
  27. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Log.php +1 -1
  28. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/MailUp.php +1 -1
  29. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/MailUpWsImport.php +14 -11
  30. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Mysql14/MailUp.php +1 -1
  31. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Mysql14/MailUp/Collection.php +1 -1
  32. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Mysql4/Job.php +1 -1
  33. app/code/local/{SevenLike/MailUp/Model/Mysql4/Sync → MailUp/MailUpSync/Model/Mysql4/Job}/Collection.php +2 -2
  34. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Mysql4/Log.php +1 -1
  35. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Mysql4/Log/Collection.php +1 -1
  36. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Mysql4/Sync.php +1 -1
  37. app/code/local/MailUp/MailUpSync/Model/Mysql4/Sync/Collection.php +11 -0
  38. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Observer.php +104 -41
  39. app/code/local/MailUp/MailUpSync/Model/Source/Groups.php +70 -0
  40. app/code/local/{SevenLike/MailUp/Model → MailUp/MailUpSync/Model/Source}/Lists.php +9 -9
  41. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Source/Store.php +1 -1
  42. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Subscriber.php +5 -5
  43. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Sync.php +5 -5
  44. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Webserviceusernamevalidator.php +1 -1
  45. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Ws.php +0 -0
  46. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Wssend.php +28 -7
  47. app/code/local/MailUp/MailUpSync/controllers/Adminhtml/ConfigurationController.php +85 -0
  48. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/Adminhtml/FieldsmappingController.php +1 -1
  49. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/Adminhtml/FilterController.php +19 -14
  50. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/Adminhtml/LogController.php +1 -1
  51. app/code/local/MailUp/MailUpSync/controllers/Adminhtml/MailupbackendController.php +65 -0
  52. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/Adminhtml/SyncController.php +1 -1
  53. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/Adminhtml/ViewdatatransferlogController.php +1 -1
  54. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/IndexController.php +2 -2
  55. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/TestController.php +4 -4
  56. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/WebhookController.php +1 -1
  57. app/code/local/MailUp/MailUpSync/data/mailup_setup/upgrade-2.6.1-2.7.0.php +14 -0
  58. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/etc/config.xml +44 -35
  59. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/etc/system.xml +54 -35
  60. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-install-0.1.0.php +0 -0
  61. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-install-2.3.0.php +0 -0
  62. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-install-2.4.0.php +0 -0
  63. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-0.1.0-1.0.0.php +0 -0
  64. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-0.3.0-1.0.0.php +0 -0
  65. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-1.0.0-1.5.2.php +0 -0
  66. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-2.1.3-2.2.0.php +0 -0
  67. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-2.2.0-2.3.0.php +0 -0
  68. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-2.2.1-2.3.0.php +0 -0
  69. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-2.3.0-2.3.1.php +0 -0
  70. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-2.3.1-2.3.2.php +0 -0
  71. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-2.3.2-2.4.0.php +0 -0
  72. app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-2.4.0-2.4.1.php +0 -0
  73. app/code/local/MailUp/MailUpSync/sql/mailup_setup/mysql4-upgrade-2.6.1-2.7.0.php +16 -0
  74. app/code/local/SevenLike/MailUp/Model/Mysql4/Job/Collection.php +0 -11
  75. app/code/local/SevenLike/MailUp/controllers/Adminhtml/ConfigurationController.php +0 -15
  76. app/code/local/SevenLike/MailUp/controllers/Adminhtml/MailupbackendController.php +0 -220
  77. app/design/adminhtml/default/default/layout/mailup.xml +21 -11
  78. app/design/adminhtml/default/default/template/{sevenlike/mailup → mailup/mailupsync}/confirm.phtml +42 -3
  79. app/design/adminhtml/default/default/template/{sevenlike/mailup → mailup/mailupsync}/fieldsmapping.phtml +0 -0
  80. app/design/adminhtml/default/default/template/{sevenlike/mailup → mailup/mailupsync}/filter.phtml +9 -5
  81. app/design/adminhtml/default/default/template/mailup/mailupsync/sysconfigjavascript.phtml +17 -0
  82. app/design/adminhtml/default/default/template/{sevenlike/mailup → mailup/mailupsync}/viewdatatransferlog.phtml +0 -0
  83. app/design/frontend/base/default/layout/mailup.xml +0 -0
  84. app/design/frontend/base/default/template/mailup/customer/account/dashboard/info.phtml +1 -1
  85. app/design/frontend/base/default/template/mailup/index.phtml +0 -0
  86. app/design/frontend/base/default/template/mailup/subscribe.phtml +0 -0
  87. app/design/frontend/enterprise/default/layout/mailup.xml +0 -0
  88. app/design/frontend/enterprise/default/template/mailup/customer/account/dashboard/info.phtml +1 -1
  89. app/design/frontend/enterprise/default/template/mailup/subscribe.phtml +0 -0
  90. app/etc/modules/MailUp_MailUpSync.xml +1 -0
  91. app/etc/modules/SevenLike_MailUp.xml +0 -1
  92. app/locale/en_US/{SevenLike_MailUp.csv → MailUp_MailUpSync.csv} +5 -1
  93. app/locale/it_IT/{SevenLike_MailUp.csv → MailUp_MailUpSync.csv} +39 -1
  94. js/mailup/admin.js +39 -0
  95. package.xml +9 -5
  96. skin/adminhtml/default/default/images/MailUp_300_200_transparent_small.png +0 -0
  97. skin/adminhtml/default/default/{sevenlike/mailup → mailup/mailupsync}/images/MailUp_300_200_transparent_small.png +0 -0
  98. skin/adminhtml/default/default/{sevenlike/mailup → mailup/mailupsync}/images/titoli.png +0 -0
  99. skin/adminhtml/default/default/{sevenlike/mailup → mailup/mailupsync}/mailup.css +0 -0
app/code/local/MailUp/MailUpSync/.DS_Store ADDED
Binary file
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Adminhtml/Log.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Log.php
4
  */
5
- class SevenLike_MailUp_Block_Adminhtml_Log extends Mage_Adminhtml_Block_Widget_Grid_Container
6
  {
7
  public function __construct()
8
  {
2
  /**
3
  * Log.php
4
  */
5
+ class MailUp_MailUpSync_Block_Adminhtml_Log extends Mage_Adminhtml_Block_Widget_Grid_Container
6
  {
7
  public function __construct()
8
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Adminhtml/Log/Grid.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Grid.php
4
  */
5
- class SevenLike_MailUp_Block_Adminhtml_Log_Grid extends Mage_Adminhtml_Block_Widget_Grid
6
  {
7
  /**
8
  * Constructor
@@ -25,6 +25,9 @@ class SevenLike_MailUp_Block_Adminhtml_Log_Grid extends Mage_Adminhtml_Block_Wid
25
  {
26
  $collection = Mage::getModel('mailup/log')->getCollection();
27
  $this->setCollection($collection);
 
 
 
28
 
29
  //var_dump(Mage::getModel('mailup/job')->load(1));
30
 
2
  /**
3
  * Grid.php
4
  */
5
+ class MailUp_MailUpSync_Block_Adminhtml_Log_Grid extends Mage_Adminhtml_Block_Widget_Grid
6
  {
7
  /**
8
  * Constructor
25
  {
26
  $collection = Mage::getModel('mailup/log')->getCollection();
27
  $this->setCollection($collection);
28
+ // Set default sort to ID by highest to lowest (normally shows most recent first)
29
+ $this->setDefaultSort('id');
30
+ $this->setDefaultDir('desc');
31
 
32
  //var_dump(Mage::getModel('mailup/job')->load(1));
33
 
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Adminhtml/Mailup/Grid.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Grid.php
4
  */
5
- class SevenLike_MailUp_Block_Adminhtml_MailUp_Grid extends Mage_Adminhtml_Block_Widget_Grid
6
  {
7
  /**
8
  * Constructor
@@ -19,12 +19,15 @@ class SevenLike_MailUp_Block_Adminhtml_MailUp_Grid extends Mage_Adminhtml_Block_
19
  /**
20
  * Prepare Collection
21
  *
22
- * @return
23
  */
24
  protected function _prepareCollection()
25
  {
26
  $collection = Mage::getModel('mailup/job')->getCollection();
27
  $this->setCollection($collection);
 
 
 
28
 
29
  //var_dump(Mage::getModel('mailup/job')->load(1));
30
 
@@ -64,13 +67,6 @@ class SevenLike_MailUp_Block_Adminhtml_MailUp_Grid extends Mage_Adminhtml_Block_
64
  'options' => Mage::getModel('mailup/source_store')->getSelectOptions(),
65
  ));
66
 
67
- /*$this->addColumn('store_id', array(
68
- 'header' => Mage::helper('mailup')->__('Store ID'),
69
- //'align' =>'right',
70
- 'width' => '80px',
71
- 'index' => 'store_id',
72
- ));*/
73
-
74
  $this->addColumn('mailupgroupid', array(
75
  'header' => Mage::helper('mailup')->__('Mailup Group ID'),
76
  //'align' =>'right',
@@ -162,21 +158,6 @@ class SevenLike_MailUp_Block_Adminhtml_MailUp_Grid extends Mage_Adminhtml_Block_
162
  //'gmtoffset' => true
163
  ));
164
 
165
- //
166
- //
167
- // $this->addColumn('status', array(
168
- // 'header' => Mage::helper('importer')->__('Status'),
169
- // 'align' => 'left',
170
- // 'width' => '80px',
171
- // 'index' => 'status',
172
- // 'type' => 'options',
173
- // 'options' => array(
174
- // 1 => 'Enabled',
175
- // 2 => 'Disabled',
176
- // ),
177
- // ));
178
- //
179
-
180
  $this->addColumn('action',
181
  array(
182
  'header' => Mage::helper('mailup')->__('Action'),
@@ -189,16 +170,6 @@ class SevenLike_MailUp_Block_Adminhtml_MailUp_Grid extends Mage_Adminhtml_Block_
189
  'url' => array('base'=> '*/*/runjob'),
190
  'field' => 'id'
191
  ),
192
- array(
193
- 'caption' => Mage::helper('mailup')->__('StartProcess'),
194
- 'url' => array('base'=> '*/*/startProcess'),
195
- 'field' => 'id'
196
- ),
197
- array(
198
- 'caption' => Mage::helper('mailup')->__('GetProcessDetail'),
199
- 'url' => array('base'=> '*/*/getProcessDetail'),
200
- 'field' => 'id'
201
- ),
202
  array(
203
  'caption' => Mage::helper('mailup')->__('Delete'),
204
  'url' => array('base'=> '*/*/delete'),
@@ -209,31 +180,13 @@ class SevenLike_MailUp_Block_Adminhtml_MailUp_Grid extends Mage_Adminhtml_Block_
209
  'sortable' => false,
210
  'index' => 'stores',
211
  'is_system' => true,
 
212
  ));
213
 
214
 
215
  return parent::_prepareColumns();
216
  }
217
 
218
- // /**
219
- // * Prepare Mass Action
220
- // */
221
- // protected function _prepareMassaction()
222
- // {
223
- // $this->setMassactionIdField('id');
224
- // $this->getMassactionBlock()->setFormFieldName('importer');
225
- //
226
- // $this->getMassactionBlock()->addItem('delete', array(
227
- // 'label' => Mage::helper('importer')->__('Delete'),
228
- // 'url' => $this->getUrl('*/*/massDelete'),
229
- // 'confirm' => Mage::helper('importer')->__('Are you sure?')
230
- // ));
231
- //
232
- // $statuses = Mage::getSingleton('importer/import')->getOptionArray();
233
- // array_unshift($statuses, array('label'=>'', 'value'=>''));
234
- //
235
- // return $this;
236
- // }
237
 
238
  /**
239
  * Get row url - None editable
@@ -241,7 +194,6 @@ class SevenLike_MailUp_Block_Adminhtml_MailUp_Grid extends Mage_Adminhtml_Block_
241
  public function getRowUrl($row)
242
  {
243
  return '';
244
- //return $this->getUrl('*/*/edit', array('id' => $row->getId()));
245
  }
246
 
247
  }
2
  /**
3
  * Grid.php
4
  */
5
+ class MailUp_MailUpSync_Block_Adminhtml_MailUp_Grid extends Mage_Adminhtml_Block_Widget_Grid
6
  {
7
  /**
8
  * Constructor
19
  /**
20
  * Prepare Collection
21
  *
22
+ * @return $this
23
  */
24
  protected function _prepareCollection()
25
  {
26
  $collection = Mage::getModel('mailup/job')->getCollection();
27
  $this->setCollection($collection);
28
+ // Set default sort to ID by highest to lowest (normally shows most recent first)
29
+ $this->setDefaultSort('id');
30
+ $this->setDefaultDir('desc');
31
 
32
  //var_dump(Mage::getModel('mailup/job')->load(1));
33
 
67
  'options' => Mage::getModel('mailup/source_store')->getSelectOptions(),
68
  ));
69
 
 
 
 
 
 
 
 
70
  $this->addColumn('mailupgroupid', array(
71
  'header' => Mage::helper('mailup')->__('Mailup Group ID'),
72
  //'align' =>'right',
158
  //'gmtoffset' => true
159
  ));
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  $this->addColumn('action',
162
  array(
163
  'header' => Mage::helper('mailup')->__('Action'),
170
  'url' => array('base'=> '*/*/runjob'),
171
  'field' => 'id'
172
  ),
 
 
 
 
 
 
 
 
 
 
173
  array(
174
  'caption' => Mage::helper('mailup')->__('Delete'),
175
  'url' => array('base'=> '*/*/delete'),
180
  'sortable' => false,
181
  'index' => 'stores',
182
  'is_system' => true,
183
+ 'comment' => 'Run a pending or queued job, or delete an existing job'
184
  ));
185
 
186
 
187
  return parent::_prepareColumns();
188
  }
189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
 
191
  /**
192
  * Get row url - None editable
194
  public function getRowUrl($row)
195
  {
196
  return '';
 
197
  }
198
 
199
  }
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Adminhtml/Mailupbackend.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Mailupbackend.php
4
  */
5
- class SevenLike_MailUp_Block_Adminhtml_Mailupbackend extends Mage_Adminhtml_Block_Widget_Grid_Container
6
  {
7
  public function __construct()
8
  {
2
  /**
3
  * Mailupbackend.php
4
  */
5
+ class MailUp_MailUpSync_Block_Adminhtml_Mailupbackend extends Mage_Adminhtml_Block_Widget_Grid_Container
6
  {
7
  public function __construct()
8
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Adminhtml/Sync.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Sync.php
4
  */
5
- class SevenLike_MailUp_Block_Adminhtml_Sync extends Mage_Adminhtml_Block_Widget_Grid_Container
6
  {
7
  public function __construct()
8
  {
2
  /**
3
  * Sync.php
4
  */
5
+ class MailUp_MailUpSync_Block_Adminhtml_Sync extends Mage_Adminhtml_Block_Widget_Grid_Container
6
  {
7
  public function __construct()
8
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Adminhtml/Sync/Grid.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Grid.php
4
  */
5
- class SevenLike_MailUp_Block_Adminhtml_Sync_Grid extends Mage_Adminhtml_Block_Widget_Grid
6
  {
7
  /**
8
  * Constructor
@@ -25,8 +25,9 @@ class SevenLike_MailUp_Block_Adminhtml_Sync_Grid extends Mage_Adminhtml_Block_Wi
25
  {
26
  $collection = Mage::getModel('mailup/sync')->getCollection();
27
  $this->setCollection($collection);
28
-
29
- //var_dump(Mage::getModel('mailup/job')->load(1));
 
30
 
31
  return parent::_prepareCollection();
32
  }
@@ -43,8 +44,6 @@ class SevenLike_MailUp_Block_Adminhtml_Sync_Grid extends Mage_Adminhtml_Block_Wi
43
  'index' => 'id',
44
  ));
45
 
46
-
47
-
48
  $this->addColumn('store_id', array(
49
  'header' => Mage::helper('mailup')->__('Store'),
50
  'align' => 'left',
@@ -54,13 +53,6 @@ class SevenLike_MailUp_Block_Adminhtml_Sync_Grid extends Mage_Adminhtml_Block_Wi
54
  'options' => Mage::getModel('mailup/source_store')->getSelectOptions(),
55
  ));
56
 
57
- /*$this->addColumn('store_id', array(
58
- 'header' => Mage::helper('mailup')->__('Store ID'),
59
- //'align' =>'right',
60
- 'width' => '80px',
61
- 'index' => 'store_id',
62
- ));*/
63
-
64
  $this->addColumn('customer_id', array(
65
  'header' => Mage::helper('mailup')->__('Customer ID'),
66
  //'align' =>'right',
2
  /**
3
  * Grid.php
4
  */
5
+ class MailUp_MailUpSync_Block_Adminhtml_Sync_Grid extends Mage_Adminhtml_Block_Widget_Grid
6
  {
7
  /**
8
  * Constructor
25
  {
26
  $collection = Mage::getModel('mailup/sync')->getCollection();
27
  $this->setCollection($collection);
28
+ // Set default sort to ID by highest to lowest (normally shows most recent first)
29
+ $this->setDefaultSort('id');
30
+ $this->setDefaultDir('desc');
31
 
32
  return parent::_prepareCollection();
33
  }
44
  'index' => 'id',
45
  ));
46
 
 
 
47
  $this->addColumn('store_id', array(
48
  'header' => Mage::helper('mailup')->__('Store'),
49
  'align' => 'left',
53
  'options' => Mage::getModel('mailup/source_store')->getSelectOptions(),
54
  ));
55
 
 
 
 
 
 
 
 
56
  $this->addColumn('customer_id', array(
57
  'header' => Mage::helper('mailup')->__('Customer ID'),
58
  //'align' =>'right',
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Adminhtml/System/Config/Form/Field/Timezone.php RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class SevenLike_MailUp_Block_Adminhtml_System_Config_Form_Field_Timezone
4
  extends Mage_Adminhtml_Block_System_Config_Form_Field
5
  {
6
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
1
  <?php
2
 
3
+ class MailUp_MailUpSync_Block_Adminhtml_System_Config_Form_Field_Timezone
4
  extends Mage_Adminhtml_Block_System_Config_Form_Field
5
  {
6
  protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
app/code/local/MailUp/MailUpSync/Block/Adminhtml/System/Config/Form/Testbutton.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Self-test button for connection details in system configuration
5
+ */
6
+ class MailUp_MailUpSync_Block_Adminhtml_System_Config_Form_Testbutton
7
+ extends Mage_Adminhtml_Block_System_Config_Form_Field
8
+ {
9
+ /**
10
+ * Return element html
11
+ *
12
+ * @param Varien_Data_Form_Element_Abstract $element
13
+ * @return string
14
+ */
15
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
16
+ {
17
+ return $this->_toHtml();
18
+ }
19
+
20
+ /**
21
+ * Generate button html
22
+ *
23
+ * @return string
24
+ */
25
+ protected function _toHtml()
26
+ {
27
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
28
+ ->setData(array(
29
+ 'id' => 'mailup_selftest_button',
30
+ 'label' => $this->helper('adminhtml')->__('Test Connection')
31
+ ));
32
+
33
+ return $button->toHtml();
34
+ }
35
+ }
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Checkout/Subscribe.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Subscribe.php
4
  */
5
- class SevenLike_MailUp_Block_Checkout_Subscribe extends Mage_Core_Block_Template
6
  {
7
  public function _toHtml()
8
  {
2
  /**
3
  * Subscribe.php
4
  */
5
+ class MailUp_MailUpSync_Block_Checkout_Subscribe extends Mage_Core_Block_Template
6
  {
7
  public function _toHtml()
8
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Filters.php RENAMED
@@ -4,7 +4,7 @@
4
  *
5
  * Adminhtml block for the filters section
6
  */
7
- class SevenLike_MailUp_Block_Filters extends Mage_Core_Block_Template
8
  {
9
  public function _toHtml()
10
  {
@@ -19,7 +19,7 @@ class SevenLike_MailUp_Block_Filters extends Mage_Core_Block_Template
19
  protected function _getStoresArray()
20
  {
21
  $config = Mage::getModel('mailup/config');
22
- /* @var $config SevenLike_Mailup_Model_Config */
23
  return $config->getStoreArray();
24
  }
25
  }
4
  *
5
  * Adminhtml block for the filters section
6
  */
7
+ class MailUp_MailUpSync_Block_Filters extends Mage_Core_Block_Template
8
  {
9
  public function _toHtml()
10
  {
19
  protected function _getStoresArray()
20
  {
21
  $config = Mage::getModel('mailup/config');
22
+ /* @var $config MailUp_MailUpSync_Model_Config */
23
  return $config->getStoreArray();
24
  }
25
  }
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Block/Index.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Index.php
4
  */
5
- class SevenLike_MailUp_Block_Index extends Mage_Core_Block_Template
6
  {
7
  public function _toHtml()
8
  {
2
  /**
3
  * Index.php
4
  */
5
+ class MailUp_MailUpSync_Block_Index extends Mage_Core_Block_Template
6
  {
7
  public function _toHtml()
8
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Helper/Customer.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Customer helper methods for MailUp
4
  */
5
- class SevenLike_MailUp_Helper_Customer extends Mage_Core_Helper_Abstract
6
  {
7
  /**
8
  * Check whether customer attribute is on ignore list
2
  /**
3
  * Customer helper methods for MailUp
4
  */
5
+ class MailUp_MailUpSync_Helper_Customer extends Mage_Core_Helper_Abstract
6
  {
7
  /**
8
  * Check whether customer attribute is on ignore list
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Helper/Data.php RENAMED
@@ -1,10 +1,14 @@
1
  <?php
 
 
 
 
2
  /**
3
  * Data.php
4
  *
5
  * @todo get rid of these static methods!
6
  */
7
- class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
8
  {
9
  /**
10
  * importType takes one of the following values, varying:
@@ -38,7 +42,7 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
38
  public static function getCustomersData($customerCollection = null)
39
  {
40
  $config = Mage::getModel('mailup/config');
41
- /* @var $config SevenLike_Mailup_Model_Config */
42
 
43
  if ($config->isLogEnabled()) {
44
  $config->log('Getting customers data');
@@ -332,7 +336,7 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
332
  public static function generateAndSendCustomers($mailupCustomerIds, $post = null, $storeId = NULL)
333
  {
334
  $config = Mage::getModel('mailup/config');
335
- /* @var $config SevenLike_Mailup_Model_Config */
336
 
337
  $wsSend = new MailUpWsSend($storeId);
338
  require_once dirname(__FILE__) . "/../Model/MailUpWsImport.php";
@@ -348,7 +352,7 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
348
 
349
  $jobId = $post['id'];
350
  $jobModel = Mage::getModel('mailup/job')->load($post['id']);
351
- /* @var $jobModel SevenLike_Mailup_Model_Job */
352
 
353
  if ($accessKey === false) {
354
  Mage::throwException('no access key returned');
@@ -378,6 +382,14 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
378
  $groupId = $wsImport->CreaGruppo($newGroup);
379
  }
380
 
 
 
 
 
 
 
 
 
381
  $importProcessData = array(
382
  "idList" => $idList,
383
  "listGUID" => $listGUID,
@@ -391,7 +403,7 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
391
  "asOptOut" => 0,
392
  "forceOptIn" => 0, // Dangerous to use as this can over-write pending/un-subscribe statuses
393
  "replaceGroups" => 0,
394
- "idConfirmNL" => 0
395
  );
396
 
397
  $xmlData = '';
@@ -410,15 +422,15 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
410
  $importProcessData["xmlDoc"] = "<subscribers>$xmlData</subscribers>";
411
  $xmlData = "";
412
  $subscribers_counter = 0;
413
- /*if($config->isLogEnabled($storeId)) {
414
  Mage::log('ImportProcessData');
415
  Mage::log($importProcessData, 0);
416
- }*/
417
  $processID = $wsImport->newImportProcess($importProcessData);
418
  /**
419
  * Failure
420
  */
421
- if($processID === FALSE | $processID < 0) {
422
  if($config->isLogEnabled($storeId)) {
423
  $config->dbLog(sprintf('newImportProcess [ERROR] [%d]', $processID), $jobId, $storeId);
424
  }
@@ -447,7 +459,7 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
447
  "asOptOut" => 0,
448
  "forceOptIn" => 0, // Dangerous to use as this can over-write pending/un-subscribe statuses
449
  "replaceGroups" => 0,
450
- "idConfirmNL" => 0
451
  );
452
 
453
  if ($config->isLogEnabled($storeId)) {
@@ -498,7 +510,7 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
498
  protected static function _getCustomerXml($customerId, $fields_mapping, $storeId)
499
  {
500
  $config = Mage::getModel('mailup/config');
501
- /* @var $config SevenLike_Mailup_Model_Config */
502
  $xmlData = '';
503
  $mappedData = array();
504
  $subscriber = self::getCustomersData(array($customerId));
@@ -623,7 +635,7 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
623
  public function runJob($jobId)
624
  {
625
  $config = Mage::getModel('mailup/config');
626
- /* @var $config SevenLike_Mailup_Model_Config */
627
  require_once dirname(__FILE__) . '/../Helper/Data.php';
628
  $db_read = Mage::getSingleton('core/resource')->getConnection('core_read');
629
  $db_write = Mage::getSingleton('core/resource')->getConnection('core_write');
@@ -633,7 +645,7 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
633
  // reading customers (jobid == 0, their updates)
634
  $customer_entity_table_name = Mage::getSingleton('core/resource')->getTableName('customer_entity');
635
  $jobModel = Mage::getModel('mailup/job')->load($jobId);
636
- /* @var $jobModel SevenLike_MailUp_Model_Job */
637
 
638
  if( ! $jobModel) {
639
  throw new Mage_Exception('No Job Exists: ' . $jobId);
@@ -653,7 +665,13 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
653
  $job["mailupGroupId"] = $job["mailupgroupid"];
654
  $job["send_optin_email_to_new_subscribers"] = $job["send_optin"];
655
 
656
- $tmp = new SevenLike_MailUp_Model_Lists;
 
 
 
 
 
 
657
  $tmp = $tmp->toOptionArray($storeId); // pass store id!
658
  foreach ($tmp as $t) {
659
  if ($t["value"] == $job['mailupIdList']) {
@@ -679,7 +697,7 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
679
  /**
680
  * Send the Data!
681
  */
682
- $returnCode = SevenLike_MailUp_Helper_Data::generateAndSendCustomers($customers, $job, $storeId);
683
  /**
684
  * Check return OK
685
  */
@@ -934,7 +952,7 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
934
  * @param string
935
  * @param string
936
  */
937
- public function scheduleTask($when, $type = 'sevenlike_mailup')
938
  {
939
  $write = Mage::getSingleton('core/resource')->getConnection('core_write');
940
  $write->insert(Mage::getSingleton('core/resource')->getTableName('cron_schedule'), array(
@@ -976,4 +994,190 @@ class SevenLike_MailUp_Helper_Data extends Mage_Core_Helper_Abstract
976
 
977
  return $id;
978
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
979
  }
1
  <?php
2
+
3
+ require_once dirname(__DIR__) . "/Model/MailUpWsImport.php";
4
+ require_once dirname(__DIR__) . "/Model/Wssend.php";
5
+
6
  /**
7
  * Data.php
8
  *
9
  * @todo get rid of these static methods!
10
  */
11
+ class MailUp_MailUpSync_Helper_Data extends Mage_Core_Helper_Abstract
12
  {
13
  /**
14
  * importType takes one of the following values, varying:
42
  public static function getCustomersData($customerCollection = null)
43
  {
44
  $config = Mage::getModel('mailup/config');
45
+ /* @var $config MailUp_MailUpSync_Model_Config */
46
 
47
  if ($config->isLogEnabled()) {
48
  $config->log('Getting customers data');
336
  public static function generateAndSendCustomers($mailupCustomerIds, $post = null, $storeId = NULL)
337
  {
338
  $config = Mage::getModel('mailup/config');
339
+ /* @var $config MailUp_MailUpSync_Model_Config */
340
 
341
  $wsSend = new MailUpWsSend($storeId);
342
  require_once dirname(__FILE__) . "/../Model/MailUpWsImport.php";
352
 
353
  $jobId = $post['id'];
354
  $jobModel = Mage::getModel('mailup/job')->load($post['id']);
355
+ /* @var $jobModel MailUp_MailUpSync_Model_Job */
356
 
357
  if ($accessKey === false) {
358
  Mage::throwException('no access key returned');
382
  $groupId = $wsImport->CreaGruppo($newGroup);
383
  }
384
 
385
+ // If message_id set, then pass this to define which message is sent to customers
386
+ if (isset($post['message_id']) && $post['message_id'] !== null) {
387
+ $idConfirmNL = $post['message_id'];
388
+ } else {
389
+ // Default to 0 (ignored)
390
+ $idConfirmNL = 0;
391
+ }
392
+
393
  $importProcessData = array(
394
  "idList" => $idList,
395
  "listGUID" => $listGUID,
403
  "asOptOut" => 0,
404
  "forceOptIn" => 0, // Dangerous to use as this can over-write pending/un-subscribe statuses
405
  "replaceGroups" => 0,
406
+ "idConfirmNL" => $idConfirmNL
407
  );
408
 
409
  $xmlData = '';
422
  $importProcessData["xmlDoc"] = "<subscribers>$xmlData</subscribers>";
423
  $xmlData = "";
424
  $subscribers_counter = 0;
425
+ if ($config->isLogEnabled($storeId)) {
426
  Mage::log('ImportProcessData');
427
  Mage::log($importProcessData, 0);
428
+ }
429
  $processID = $wsImport->newImportProcess($importProcessData);
430
  /**
431
  * Failure
432
  */
433
+ if($processID === FALSE || $processID < 0) {
434
  if($config->isLogEnabled($storeId)) {
435
  $config->dbLog(sprintf('newImportProcess [ERROR] [%d]', $processID), $jobId, $storeId);
436
  }
459
  "asOptOut" => 0,
460
  "forceOptIn" => 0, // Dangerous to use as this can over-write pending/un-subscribe statuses
461
  "replaceGroups" => 0,
462
+ "idConfirmNL" => $idConfirmNL
463
  );
464
 
465
  if ($config->isLogEnabled($storeId)) {
510
  protected static function _getCustomerXml($customerId, $fields_mapping, $storeId)
511
  {
512
  $config = Mage::getModel('mailup/config');
513
+ /* @var $config MailUp_MailUpSync_Model_Config */
514
  $xmlData = '';
515
  $mappedData = array();
516
  $subscriber = self::getCustomersData(array($customerId));
635
  public function runJob($jobId)
636
  {
637
  $config = Mage::getModel('mailup/config');
638
+ /* @var $config MailUp_MailUpSync_Model_Config */
639
  require_once dirname(__FILE__) . '/../Helper/Data.php';
640
  $db_read = Mage::getSingleton('core/resource')->getConnection('core_read');
641
  $db_write = Mage::getSingleton('core/resource')->getConnection('core_write');
645
  // reading customers (jobid == 0, their updates)
646
  $customer_entity_table_name = Mage::getSingleton('core/resource')->getTableName('customer_entity');
647
  $jobModel = Mage::getModel('mailup/job')->load($jobId);
648
+ /* @var $jobModel MailUp_MailUpSync_Model_Job */
649
 
650
  if( ! $jobModel) {
651
  throw new Mage_Exception('No Job Exists: ' . $jobId);
665
  $job["mailupGroupId"] = $job["mailupgroupid"];
666
  $job["send_optin_email_to_new_subscribers"] = $job["send_optin"];
667
 
668
+ // If group is 0 and there is a default group, set group to this group
669
+ $defaultGroupId = Mage::getStoreConfig('mailup_newsletter/mailup/default_group');
670
+ if ($job["mailupGroupId"] == 0 && $defaultGroupId !== null) {
671
+ $job["mailupGroupId"] = $defaultGroupId;
672
+ }
673
+
674
+ $tmp = Mage::getSingleton('mailup/source_lists');
675
  $tmp = $tmp->toOptionArray($storeId); // pass store id!
676
  foreach ($tmp as $t) {
677
  if ($t["value"] == $job['mailupIdList']) {
697
  /**
698
  * Send the Data!
699
  */
700
+ $returnCode = MailUp_MailUpSync_Helper_Data::generateAndSendCustomers($customers, $job, $storeId);
701
  /**
702
  * Check return OK
703
  */
952
  * @param string
953
  * @param string
954
  */
955
+ public function scheduleTask($when, $type = 'MailUp_MailUpSync')
956
  {
957
  $write = Mage::getSingleton('core/resource')->getConnection('core_write');
958
  $write->insert(Mage::getSingleton('core/resource')->getTableName('cron_schedule'), array(
994
 
995
  return $id;
996
  }
997
+
998
+ /**
999
+ * Get ListGuid (Alphanumeric code associated to a distribution list) for given list
1000
+ *
1001
+ * @param $listId
1002
+ * @return false|string
1003
+ */
1004
+ public function getListGuid($listId)
1005
+ {
1006
+ $wsImport = new MailUpWsImport();
1007
+ $xmlString = $wsImport->GetNlList();
1008
+ if (!$xmlString) return $this;
1009
+
1010
+ $xmlString = html_entity_decode($xmlString);
1011
+ $startLists = strpos($xmlString, '<Lists>');
1012
+ $endPos = strpos($xmlString, '</Lists>');
1013
+ $endLists = $endPos + strlen('</Lists>') - $startLists;
1014
+ $xmlLists = substr($xmlString, $startLists, $endLists);
1015
+ $xmlLists = str_replace("&", "&amp;", $xmlLists);
1016
+ $xml = simplexml_load_string($xmlLists);
1017
+
1018
+ $listGUID = false;
1019
+ foreach ($xml->List as $list) {
1020
+ if ($list['idList'] == $listId) {
1021
+ $listGUID = $list["listGUID"];
1022
+ break;
1023
+ }
1024
+ }
1025
+
1026
+ return $listGUID;
1027
+ }
1028
+
1029
+ /**
1030
+ * Clear the abandonment id, date etc. for customer with given email address
1031
+ *
1032
+ * @param $email
1033
+ */
1034
+ public function clearAbandonmentFields($email)
1035
+ {
1036
+ // Fields to be set
1037
+ $fields = array(
1038
+ 'campo22' => '0', // LatestAbandonedCartID
1039
+ 'campo21' => '0', // LatestAbandonedCartDate
1040
+ 'campo20' => '0' // LatestAbandonedCartTotal
1041
+ );
1042
+
1043
+ // Gather list parameters
1044
+ $console = Mage::getStoreConfig('mailup_newsletter/mailup/url_console');
1045
+ $listId = Mage::getStoreConfig('mailup_newsletter/mailup/list');
1046
+ $listGUID = $this->getListGuid($listId);
1047
+
1048
+ // Set endpoint of API
1049
+ $ws = "http://{$console}/frontend/XmlUpdSubscriber.aspx";
1050
+
1051
+ // Add parameters to request
1052
+ $ws .= "?ListGuid=" . rawurlencode($listGUID);
1053
+ $ws .= "&List=" . rawurlencode($listId);
1054
+ $ws .= "&Email=" . rawurlencode($email);
1055
+ $ws .= "&csvFldNames=" . join(';', array_keys($fields));
1056
+ $ws .= "&csvFldValues=" . join(';', array_values($fields));
1057
+
1058
+ // Make request
1059
+ try {
1060
+ if(Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) {
1061
+ Mage::log("Cancelling abandonment: $ws");
1062
+ }
1063
+ $result = @file_get_contents($ws);
1064
+ if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) {
1065
+ Mage::log("Cancelling abandonment result: $result");
1066
+ }
1067
+ } catch (Exception $e) {
1068
+ Mage::logException($e);
1069
+ }
1070
+ }
1071
+
1072
+ /**
1073
+ * Test all MailUp Connection details
1074
+ *
1075
+ * @param $urlConsole
1076
+ * @param $usernameWs
1077
+ * @param $passwordWs
1078
+ * @param $storeId
1079
+ * @return array Return array of messages (success or errors)
1080
+ */
1081
+ public function testConnection($urlConsole, $usernameWs, $passwordWs, $storeId)
1082
+ {
1083
+ $messages = array();
1084
+
1085
+ // Run test for url console
1086
+ if ($this->_testConnectionConsole($urlConsole) === false) {
1087
+ $messages[] = array(
1088
+ 'message' => $this->__('Error in console URL'),
1089
+ 'type' => 'error'
1090
+ );
1091
+ }
1092
+ // Run test for username and password
1093
+ if ($this->_testConnectionUserPassword($usernameWs, $passwordWs, $storeId) === false) {
1094
+ $messages[] = array(
1095
+ 'message' => $this->__('Error in username / password'),
1096
+ 'type' => 'error'
1097
+ );
1098
+ }
1099
+
1100
+ if (empty($messages)) {
1101
+ $messages[] = array(
1102
+ 'message' => $this->__('Success! Connection established with MailUp with given details'),
1103
+ 'type' => 'success'
1104
+ );
1105
+ }
1106
+
1107
+ return $messages;
1108
+ }
1109
+
1110
+ /**
1111
+ * Test configuration for common issues
1112
+ *
1113
+ * @return array Return array of messages (warnings)
1114
+ */
1115
+ public function testConfig()
1116
+ {
1117
+ $messages = array();
1118
+
1119
+ // Mysql timeout
1120
+ $timeout = ini_get('mysql.connect_timeout');
1121
+ if ($timeout !== false && $timeout < 60) {
1122
+ $messages[] = array(
1123
+ 'message' => $this->__('Config warning: mysql.connect_timeout is %d which is a bit low. ' .
1124
+ 'This may cause intermittent issues when connecting with MailUp. ' .
1125
+ 'Please contact your Web host to discuss an increase in the timeout setting.', $timeout),
1126
+ 'type' => 'warning'
1127
+ );
1128
+ }
1129
+
1130
+ return $messages;
1131
+ }
1132
+
1133
+ /**
1134
+ * Test the URL console address by making an http call
1135
+ *
1136
+ * @param $urlConsole
1137
+ * @return bool
1138
+ */
1139
+ protected function _testConnectionConsole($urlConsole)
1140
+ {
1141
+ // Set endpoint of API
1142
+ $ws = "http://{$urlConsole}/frontend/Xmlchksubscriber.aspx";
1143
+
1144
+ // Add parameters to request
1145
+ $ws .= "?ListGuid=" . rawurlencode('e347gh87347gh374hg34');
1146
+ $ws .= "&List=" . rawurlencode(1);
1147
+ $ws .= "&Email=" . rawurlencode('logintest@test.com');
1148
+
1149
+ // Make request
1150
+ $result = '';
1151
+ try {
1152
+ if(Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) {
1153
+ Mage::log("Testing Connection - console: $ws");
1154
+ }
1155
+ $result = @file_get_contents($ws);
1156
+ if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) {
1157
+ Mage::log("Testing Connection - console: $result");
1158
+ }
1159
+ } catch (Exception $e) {
1160
+ Mage::logException($e);
1161
+ }
1162
+
1163
+ // Test that request returns 1 (with an allowance for whitespace)
1164
+ return (preg_match('/^1\s*$/', $result) == 1);
1165
+ }
1166
+
1167
+ /**
1168
+ * Test username and password by making a soap login request
1169
+ *
1170
+ * @param $usernameWs
1171
+ * @param $passwordWs
1172
+ * @param $storeId
1173
+ * @return boolean
1174
+ */
1175
+ protected function _testConnectionUserPassword($usernameWs, $passwordWs, $storeId)
1176
+ {
1177
+ $wssend = new MailUpWsSend($storeId);
1178
+
1179
+ $loginSuccess = $wssend->loginFromId($usernameWs, $passwordWs);
1180
+
1181
+ return ($loginSuccess !== false);
1182
+ }
1183
  }
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Helper/Order.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Order helper methods for MailUp
4
  */
5
- class SevenLike_MailUp_Helper_Order extends Mage_Core_Helper_Abstract
6
  {
7
  /**
8
  * Filter an order collection by status/state depending on MailUp config
2
  /**
3
  * Order helper methods for MailUp
4
  */
5
+ class MailUp_MailUpSync_Helper_Order extends Mage_Core_Helper_Abstract
6
  {
7
  /**
8
  * Filter an order collection by status/state depending on MailUp config
app/code/local/MailUp/MailUpSync/Model/.DS_Store ADDED
Binary file
app/code/local/MailUp/MailUpSync/Model/Adminhtml/.DS_Store ADDED
Binary file
app/code/local/MailUp/MailUpSync/Model/Adminhtml/System/.DS_Store ADDED
Binary file
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Adminhtml/System/Clone/Mappings/Custom.php RENAMED
@@ -4,9 +4,9 @@
4
  * Provide clone model that specifies custom customer attributes as prefixes to be
5
  * cloned from single original field
6
  *
7
- * Class SevenLike_MailUp_Model_Adminhtml_System_Clone_Mappings_Custom
8
  */
9
- class SevenLike_MailUp_Model_Adminhtml_System_Clone_Mappings_Custom
10
  extends Mage_Core_Model_Config_Data
11
  {
12
  /**
4
  * Provide clone model that specifies custom customer attributes as prefixes to be
5
  * cloned from single original field
6
  *
7
+ * Class MailUp_MailUpSync_Model_Adminhtml_System_Clone_Mappings_Custom
8
  */
9
+ class MailUp_MailUpSync_Model_Adminhtml_System_Clone_Mappings_Custom
10
  extends Mage_Core_Model_Config_Data
11
  {
12
  /**
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Adminhtml/System/Source/Cron/Frequency.php RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Frequency
4
  {
5
  const HOURLY = 0;
6
  const EVERY_2_HOURS = 1;
@@ -10,7 +10,7 @@ class SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Frequency
10
 
11
  /**
12
  * Get the frequency in hours given a frequency index such as
13
- * SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Frequency::EVERY_2_HOURS
14
  *
15
  * @param int $frequencyIndex
16
  * @return null|int
1
  <?php
2
 
3
+ class MailUp_MailUpSync_Model_Adminhtml_System_Source_Cron_Frequency
4
  {
5
  const HOURLY = 0;
6
  const EVERY_2_HOURS = 1;
10
 
11
  /**
12
  * Get the frequency in hours given a frequency index such as
13
+ * MailUp_MailUpSync_Model_Adminhtml_System_Source_Cron_Frequency::EVERY_2_HOURS
14
  *
15
  * @param int $frequencyIndex
16
  * @return null|int
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Adminhtml/System/Source/Cron/Hours.php RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Hours
4
  {
5
  /**
6
  * Fetch options array
1
  <?php
2
 
3
+ class MailUp_MailUpSync_Model_Adminhtml_System_Source_Cron_Hours
4
  {
5
  /**
6
  * Fetch options array
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Adminhtml/System/Source/Fields.php RENAMED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  /**
4
- * Class SevenLike_MailUp_Model_Adminhtml_System_Source_Fields
5
  *
6
  * Cached MailUp recipient fields fetched via API
7
  *
@@ -9,7 +9,7 @@
9
  * - Within one instantiation of magento, store options in the object
10
  * - Magento's cache is used for up to 10 minutes to save hitting the API too often
11
  */
12
- class SevenLike_MailUp_Model_Adminhtml_System_Source_Fields
13
  {
14
  const CACHE_LIFETIME = 600; // 10 min
15
 
1
  <?php
2
 
3
  /**
4
+ * Class MailUp_MailUpSync_Model_Adminhtml_System_Source_Fields
5
  *
6
  * Cached MailUp recipient fields fetched via API
7
  *
9
  * - Within one instantiation of magento, store options in the object
10
  * - Magento's cache is used for up to 10 minutes to save hitting the API too often
11
  */
12
+ class MailUp_MailUpSync_Model_Adminhtml_System_Source_Fields
13
  {
14
  const CACHE_LIFETIME = 600; // 10 min
15
 
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Config.php RENAMED
@@ -4,7 +4,7 @@
4
  *
5
  * Central config model
6
  */
7
- class SevenLike_MailUp_Model_Config
8
  {
9
  const XML_CONSOLE = 'mailup_newsletter/mailup/url_console';
10
  const XML_LOG_ENABLE = 'mailup_newsletter/mailup/enable_log';
@@ -12,6 +12,7 @@ class SevenLike_MailUp_Model_Config
12
  const XML_MAILUP_USERNAME = 'mailup_newsletter/mailup/username_ws';
13
  const XML_MAILUP_PASSWORD = 'mailup_newsletter/mailup/password_ws';
14
  const XML_MAILUP_LIST_ID = 'mailup_newsletter/mailup/list';
 
15
  const XML_SUBSCRIBE_IN_CHECKOUT = 'mailup_newsletter/mailup/enable_subscribe_in_checkout';
16
  const XML_REQ_SUBSCRIPTION_CONF = 'mailup_newsletter/mailup/require_subscription_confirmation';
17
  const XML_CRON_FREQ = 'mailup_newsletter/mailup/mailup_cron_frequency';
@@ -111,7 +112,7 @@ class SevenLike_MailUp_Model_Config
111
  }
112
 
113
  $log = Mage::getModel('mailup/log');
114
- /* @var $log SevenLike_MailUp_Model_Log */
115
  $log->setData(array(
116
  'store_id' => $storeId,
117
  'job_id' => $jobId,
@@ -183,6 +184,17 @@ class SevenLike_MailUp_Model_Config
183
  {
184
  return Mage::getStoreConfig(self::XML_MAILUP_LIST_ID, $storeId);
185
  }
 
 
 
 
 
 
 
 
 
 
 
186
 
187
  /**
188
  * Get the username from Config
4
  *
5
  * Central config model
6
  */
7
+ class MailUp_MailUpSync_Model_Config
8
  {
9
  const XML_CONSOLE = 'mailup_newsletter/mailup/url_console';
10
  const XML_LOG_ENABLE = 'mailup_newsletter/mailup/enable_log';
12
  const XML_MAILUP_USERNAME = 'mailup_newsletter/mailup/username_ws';
13
  const XML_MAILUP_PASSWORD = 'mailup_newsletter/mailup/password_ws';
14
  const XML_MAILUP_LIST_ID = 'mailup_newsletter/mailup/list';
15
+ const XML_MAILUP_DEFAULT_GROUP_ID = 'mailup_newsletter/mailup/default_group';
16
  const XML_SUBSCRIBE_IN_CHECKOUT = 'mailup_newsletter/mailup/enable_subscribe_in_checkout';
17
  const XML_REQ_SUBSCRIPTION_CONF = 'mailup_newsletter/mailup/require_subscription_confirmation';
18
  const XML_CRON_FREQ = 'mailup_newsletter/mailup/mailup_cron_frequency';
112
  }
113
 
114
  $log = Mage::getModel('mailup/log');
115
+ /* @var $log MailUp_MailUpSync_Model_Log */
116
  $log->setData(array(
117
  'store_id' => $storeId,
118
  'job_id' => $jobId,
184
  {
185
  return Mage::getStoreConfig(self::XML_MAILUP_LIST_ID, $storeId);
186
  }
187
+
188
+ /**
189
+ * Get the default Group ID
190
+ *
191
+ * @param int
192
+ * @return int
193
+ */
194
+ public function getMailupDefaultGroupId($storeId = NULL)
195
+ {
196
+ return Mage::getStoreConfig(self::XML_MAILUP_DEFAULT_GROUP_ID, $storeId);
197
+ }
198
 
199
  /**
200
  * Get the username from Config
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Consoleurlvalidator.php RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class SevenLike_MailUp_Model_Consoleurlvalidator extends Mage_Core_Model_Config_Data
4
  {
5
  public function save()
6
  {
1
  <?php
2
 
3
+ class MailUp_MailUpSync_Model_Consoleurlvalidator extends Mage_Core_Model_Config_Data
4
  {
5
  public function save()
6
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Cron.php RENAMED
@@ -7,7 +7,7 @@
7
  require_once dirname(__FILE__) . "/MailUpWsImport.php";
8
  require_once dirname(__FILE__) . "/Wssend.php";
9
 
10
- class SevenLike_MailUp_Model_Cron
11
  {
12
  /**
13
  * Run the Task
@@ -48,7 +48,7 @@ class SevenLike_MailUp_Model_Cron
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 SevenLike_MailUp_Model_Job */
52
  $job = $jobModel->getData();
53
  $stmt = $db_write->query(
54
  "UPDATE {$jobsTableName}
@@ -62,8 +62,14 @@ class SevenLike_MailUp_Model_Cron
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
- $tmp = new SevenLike_MailUp_Model_Lists;
67
  $tmp = $tmp->toOptionArray($storeId); // pass store id!
68
  foreach ($tmp as $t) {
69
  if ($t["value"] == $job['mailupIdList']) {
@@ -89,7 +95,7 @@ class SevenLike_MailUp_Model_Cron
89
  /**
90
  * Send the Data!
91
  */
92
- $returnCode = SevenLike_MailUp_Helper_Data::generateAndSendCustomers($customers, $job, $storeId);
93
  /**
94
  * Check return OK
95
  */
@@ -136,7 +142,7 @@ class SevenLike_MailUp_Model_Cron
136
  {
137
  // Only run Auto Sync Jobs
138
  $job = Mage::getModel('mailup/job');
139
- /* @var $job SevenLike_MailUp_Model_Job */
140
 
141
  foreach($job->fetchAutoSyncQueuedJobsCollection() as $job) {
142
 
@@ -151,7 +157,7 @@ class SevenLike_MailUp_Model_Cron
151
  // Only run Auto Sync Jobs
152
 
153
  $job = Mage::getModel('mailup/job');
154
- /* @var $job SevenLike_MailUp_Model_Job */
155
 
156
  foreach($job->fetchManualSyncQueuedJobsCollection() as $job) {
157
 
@@ -164,9 +170,9 @@ class SevenLike_MailUp_Model_Cron
164
  public function startNextJob()
165
  {
166
  $jobModel = Mage::getModel('mailup/job');
167
- /* @var $jobModel SevenLike_MailUp_Model_Job */
168
  foreach($jobModel->fetchQueuedJobsCollection() as $job) {
169
- /* @var $job SevenLike_MailUp_Model_Job */
170
 
171
  /**
172
  * Try and Start it... if it fails, we can try the next one!
@@ -193,14 +199,14 @@ class SevenLike_MailUp_Model_Cron
193
  }
194
 
195
  /**
196
- * @var SevenLike_MailUp_Model_Config
197
  */
198
  protected $_config;
199
 
200
  /**
201
  * Get the config
202
  *
203
- * @reutrn SevenLike_MailUp_Model_Config
204
  */
205
  protected function _config()
206
  {
7
  require_once dirname(__FILE__) . "/MailUpWsImport.php";
8
  require_once dirname(__FILE__) . "/Wssend.php";
9
 
10
+ class MailUp_MailUpSync_Model_Cron
11
  {
12
  /**
13
  * Run the Task
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}
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']) {
95
  /**
96
  * Send the Data!
97
  */
98
+ $returnCode = MailUp_MailUpSync_Helper_Data::generateAndSendCustomers($customers, $job, $storeId);
99
  /**
100
  * Check return OK
101
  */
142
  {
143
  // Only run Auto Sync Jobs
144
  $job = Mage::getModel('mailup/job');
145
+ /* @var $job MailUp_MailUpSync_Model_Job */
146
 
147
  foreach($job->fetchAutoSyncQueuedJobsCollection() as $job) {
148
 
157
  // Only run Auto Sync Jobs
158
 
159
  $job = Mage::getModel('mailup/job');
160
+ /* @var $job MailUp_MailUpSync_Model_Job */
161
 
162
  foreach($job->fetchManualSyncQueuedJobsCollection() as $job) {
163
 
170
  public function startNextJob()
171
  {
172
  $jobModel = Mage::getModel('mailup/job');
173
+ /* @var $jobModel MailUp_MailUpSync_Model_Job */
174
  foreach($jobModel->fetchQueuedJobsCollection() as $job) {
175
+ /* @var $job MailUp_MailUpSync_Model_Job */
176
 
177
  /**
178
  * Try and Start it... if it fails, we can try the next one!
199
  }
200
 
201
  /**
202
+ * @var MailUp_MailUpSync_Model_Config
203
  */
204
  protected $_config;
205
 
206
  /**
207
  * Get the config
208
  *
209
+ * @reutrn MailUp_MailUpSync_Model_Config
210
  */
211
  protected function _config()
212
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Job.php RENAMED
@@ -17,8 +17,9 @@
17
  * @method void setQueueDatetime(string $dateTime) Set the Datetime the job was queued.
18
  * @method void setStartDatetime(string $dateTime) Set when the job was started
19
  * @method void setFinishDatetime(string $dateTime) Set when the job was finished / completed
 
20
  */
21
- class SevenLike_MailUp_Model_Job extends Mage_Core_Model_Abstract
22
  {
23
  const STATUS_FINISHED = 'finished';
24
  const STATUS_QUEUED = 'queued';
@@ -54,7 +55,7 @@ class SevenLike_MailUp_Model_Job extends Mage_Core_Model_Abstract
54
  /**
55
  * Mark as finished
56
  *
57
- * @return \SevenLike_MailUp_Model_Job
58
  */
59
  public function finished()
60
  {
@@ -67,7 +68,7 @@ class SevenLike_MailUp_Model_Job extends Mage_Core_Model_Abstract
67
  /**
68
  * Mark as Queued
69
  *
70
- * @return \SevenLike_MailUp_Model_Job
71
  */
72
  public function queue()
73
  {
@@ -116,12 +117,12 @@ class SevenLike_MailUp_Model_Job extends Mage_Core_Model_Abstract
116
  * Get a collection of jobs in the Queue
117
  *
118
  * @param int
119
- * @return SevenLike_MailUp_Model_Mysql4_Job_Collection
120
  */
121
  public function fetchQueuedJobsCollection($type = NULL)
122
  {
123
  $collection = $this->getCollection();
124
- /* @var $collection SevenLike_MailUp_Model_Mysql4_Job_Collection */
125
  $collection
126
  ->addFieldToSelect('*')
127
  ->addFieldToFilter('status', array('eq' => self::STATUS_QUEUED))
@@ -137,7 +138,7 @@ class SevenLike_MailUp_Model_Job extends Mage_Core_Model_Abstract
137
  /**
138
  * Get a collection of jobs in the Queue
139
  *
140
- * @return SevenLike_MailUp_Model_Mysql4_Job_Collection
141
  */
142
  public function fetchManualSyncQueuedJobsCollection()
143
  {
@@ -147,7 +148,7 @@ class SevenLike_MailUp_Model_Job extends Mage_Core_Model_Abstract
147
  /**
148
  * Get a collection of jobs in the Queue
149
  *
150
- * @return SevenLike_MailUp_Model_Mysql4_Job_Collection
151
  */
152
  public function fetchAutoSyncQueuedJobsCollection()
153
  {
@@ -162,7 +163,7 @@ class SevenLike_MailUp_Model_Job extends Mage_Core_Model_Abstract
162
  public function getJobData()
163
  {
164
  $jobTasks = Mage::getModel('mailup/sync');
165
- /* @var $jobTasks SevenLike_MailUp_Model_Sync */
166
  return $jobTasks->fetchByJobId($this->getId());
167
  }
168
 
17
  * @method void setQueueDatetime(string $dateTime) Set the Datetime the job was queued.
18
  * @method void setStartDatetime(string $dateTime) Set when the job was started
19
  * @method void setFinishDatetime(string $dateTime) Set when the job was finished / completed
20
+ * @method void setMethodId(int $methodId) Set a messageId to use for subscribed customers
21
  */
22
+ class MailUp_MailUpSync_Model_Job extends Mage_Core_Model_Abstract
23
  {
24
  const STATUS_FINISHED = 'finished';
25
  const STATUS_QUEUED = 'queued';
55
  /**
56
  * Mark as finished
57
  *
58
+ * @return \MailUp_MailUpSync_Model_Job
59
  */
60
  public function finished()
61
  {
68
  /**
69
  * Mark as Queued
70
  *
71
+ * @return \MailUp_MailUpSync_Model_Job
72
  */
73
  public function queue()
74
  {
117
  * Get a collection of jobs in the Queue
118
  *
119
  * @param int
120
+ * @return MailUp_MailUpSync_Model_Mysql4_Job_Collection
121
  */
122
  public function fetchQueuedJobsCollection($type = NULL)
123
  {
124
  $collection = $this->getCollection();
125
+ /* @var $collection MailUp_MailUpSync_Model_Mysql4_Job_Collection */
126
  $collection
127
  ->addFieldToSelect('*')
128
  ->addFieldToFilter('status', array('eq' => self::STATUS_QUEUED))
138
  /**
139
  * Get a collection of jobs in the Queue
140
  *
141
+ * @return MailUp_MailUpSync_Model_Mysql4_Job_Collection
142
  */
143
  public function fetchManualSyncQueuedJobsCollection()
144
  {
148
  /**
149
  * Get a collection of jobs in the Queue
150
  *
151
+ * @return MailUp_MailUpSync_Model_Mysql4_Job_Collection
152
  */
153
  public function fetchAutoSyncQueuedJobsCollection()
154
  {
163
  public function getJobData()
164
  {
165
  $jobTasks = Mage::getModel('mailup/sync');
166
+ /* @var $jobTasks MailUp_MailUpSync_Model_Sync */
167
  return $jobTasks->fetchByJobId($this->getId());
168
  }
169
 
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Log.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Log.php
4
  */
5
- class SevenLike_MailUp_Model_Log extends Mage_Core_Model_Abstract
6
  {
7
  const TYPE_DEBUG = 'DEBUG';
8
  const TYPE_API = 'API';
2
  /**
3
  * Log.php
4
  */
5
+ class MailUp_MailUpSync_Model_Log extends Mage_Core_Model_Abstract
6
  {
7
  const TYPE_DEBUG = 'DEBUG';
8
  const TYPE_API = 'API';
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/MailUp.php RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class SevenLike_MailUp_Model_MailUp extends Mage_Core_Model_Abstract
4
  {
5
  public function _construct()
6
  {
1
  <?php
2
 
3
+ class MailUp_MailUpSync_Model_MailUp extends Mage_Core_Model_Abstract
4
  {
5
  public function _construct()
6
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/MailUpWsImport.php RENAMED
@@ -58,7 +58,7 @@ class MailUpWsImport
58
  */
59
  protected $domResult;
60
  /**
61
- * @var SevenLike_Mailup_Model_Config
62
  */
63
  protected $_config;
64
  /**
@@ -74,7 +74,7 @@ class MailUpWsImport
74
  $this->setStoreId($storeId);
75
 
76
  $this->_config = $config = Mage::getModel('mailup/config');
77
- /* @var $config SevenLike_Mailup_Model_Config */
78
 
79
  $urlConsole = Mage::getStoreConfig('mailup_newsletter/mailup/url_console', $this->storeId);
80
  $WSDLUrl = 'http://'. $urlConsole .'/services/WSMailUpImport.asmx?WSDL';
@@ -534,23 +534,26 @@ class MailUpWsImport
534
  'eq' => $storeId
535
  ));
536
  }
537
- /*else {
538
- $customerCollection->addAttributeToFilter('store_id', array(
539
- 'eq' => Mage::app()->getDefaultStoreView()->getStoreId()
540
- ));
541
- }*/
542
  $customerCollection = $customerCollection->getSelect()->query();
543
 
544
  while ($row = $customerCollection->fetch()) {
545
  $customersFiltered[] = $row;
546
  }
547
 
548
- //se richiesto, seleziono solo quelli iscritti alla newsletter di Magento
549
  if ($request->getRequest()->getParam('mailupSubscribed') > 0) {
 
 
 
 
 
 
 
550
  $tempSubscribed = array();
551
  foreach ($customersFiltered as $customer) {
552
  $customerItem = Mage::getModel('customer/customer')->load($customer['entity_id']);
553
- if (Mage::getModel('newsletter/subscriber')->loadByCustomer($customerItem)->isSubscribed()) {
 
554
  $tempSubscribed[] = $customer;
555
  }
556
  }
@@ -1085,7 +1088,7 @@ class MailUpWsImport
1085
  public function getFieldsMapping($storeId = NULL)
1086
  {
1087
  $config = Mage::getModel('mailup/config');
1088
- /* @var $config SevenLike_Mailup_Model_Config */
1089
  return $config->getFieldsMapping($storeId);
1090
  }
1091
 
@@ -1114,7 +1117,7 @@ class MailUpWsImport
1114
  /**
1115
  * Get the config
1116
  *
1117
- * @return SevenLike_Mailup_Model_Config
1118
  */
1119
  protected function _config()
1120
  {
58
  */
59
  protected $domResult;
60
  /**
61
+ * @var MailUp_MailUpSync_Model_Config
62
  */
63
  protected $_config;
64
  /**
74
  $this->setStoreId($storeId);
75
 
76
  $this->_config = $config = Mage::getModel('mailup/config');
77
+ /* @var $config MailUp_MailUpSync_Model_Config */
78
 
79
  $urlConsole = Mage::getStoreConfig('mailup_newsletter/mailup/url_console', $this->storeId);
80
  $WSDLUrl = 'http://'. $urlConsole .'/services/WSMailUpImport.asmx?WSDL';
534
  'eq' => $storeId
535
  ));
536
  }
 
 
 
 
 
537
  $customerCollection = $customerCollection->getSelect()->query();
538
 
539
  while ($row = $customerCollection->fetch()) {
540
  $customersFiltered[] = $row;
541
  }
542
 
543
+ // if required, select only those that are (or are not) subscribed in Magento
544
  if ($request->getRequest()->getParam('mailupSubscribed') > 0) {
545
+ // Base status on option (1 -> must be subscribed. 2 -> must NOT be subscribed
546
+ if ($request->getRequest()->getParam('mailupSubscribed') == 1) {
547
+ $expectedStatus = true;
548
+ } else {
549
+ $expectedStatus = false;
550
+ }
551
+ // Filter list of customers by expected subscription status
552
  $tempSubscribed = array();
553
  foreach ($customersFiltered as $customer) {
554
  $customerItem = Mage::getModel('customer/customer')->load($customer['entity_id']);
555
+ $subscriptionStatus = Mage::getModel('newsletter/subscriber')->loadByCustomer($customerItem)->isSubscribed();
556
+ if ($subscriptionStatus === $expectedStatus) {
557
  $tempSubscribed[] = $customer;
558
  }
559
  }
1088
  public function getFieldsMapping($storeId = NULL)
1089
  {
1090
  $config = Mage::getModel('mailup/config');
1091
+ /* @var $config MailUp_MailUpSync_Model_Config */
1092
  return $config->getFieldsMapping($storeId);
1093
  }
1094
 
1117
  /**
1118
  * Get the config
1119
  *
1120
+ * @return MailUp_MailUpSync_Model_Config
1121
  */
1122
  protected function _config()
1123
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Mysql14/MailUp.php RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class SevenLike_MailUp_Model_Mysql4_MailUp extends Mage_Core_Model_Mysql4_Abstract
4
  {
5
  public function _construct()
6
  {
1
  <?php
2
 
3
+ class MailUp_MailUpSync_Model_Mysql4_MailUp extends Mage_Core_Model_Mysql4_Abstract
4
  {
5
  public function _construct()
6
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Mysql14/MailUp/Collection.php RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class SevenLike_MailUp_Model_Mysql4_MailUp_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
  {
5
  public function _construct()
6
  {
1
  <?php
2
 
3
+ class MailUp_MailUpSync_Model_Mysql4_MailUp_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
  {
5
  public function _construct()
6
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Mysql4/Job.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Job.php
4
  */
5
- class SevenLike_MailUp_Model_Mysql4_Job extends Mage_Core_Model_Mysql4_Abstract
6
  {
7
  protected function _construct()
8
  {
2
  /**
3
  * Job.php
4
  */
5
+ class MailUp_MailUpSync_Model_Mysql4_Job extends Mage_Core_Model_Mysql4_Abstract
6
  {
7
  protected function _construct()
8
  {
app/code/local/{SevenLike/MailUp/Model/Mysql4/Sync → MailUp/MailUpSync/Model/Mysql4/Job}/Collection.php RENAMED
@@ -2,10 +2,10 @@
2
  /**
3
  * Collection.php
4
  */
5
- class SevenLike_MailUp_Model_Mysql4_Sync_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
6
  {
7
  public function _construct()
8
  {
9
- $this->_init("mailup/sync");
10
  }
11
  }
2
  /**
3
  * Collection.php
4
  */
5
+ class MailUp_MailUpSync_Model_Mysql4_Job_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
6
  {
7
  public function _construct()
8
  {
9
+ $this->_init("mailup/job");
10
  }
11
  }
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Mysql4/Log.php RENAMED
@@ -11,7 +11,7 @@
11
  * @method int getJobId()
12
  * @method void setJobId(int $jobId)
13
  */
14
- class SevenLike_MailUp_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract
15
  {
16
  const TYPE_ERROR = 'ERROR';
17
  const TYPE_DEBUG = 'DEBUG';
11
  * @method int getJobId()
12
  * @method void setJobId(int $jobId)
13
  */
14
+ class MailUp_MailUpSync_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract
15
  {
16
  const TYPE_ERROR = 'ERROR';
17
  const TYPE_DEBUG = 'DEBUG';
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Mysql4/Log/Collection.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Collection.php
4
  */
5
- class SevenLike_MailUp_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
6
  {
7
  public function _construct()
8
  {
2
  /**
3
  * Collection.php
4
  */
5
+ class MailUp_MailUpSync_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
6
  {
7
  public function _construct()
8
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Mysql4/Sync.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Job.php
4
  */
5
- class SevenLike_MailUp_Model_Mysql4_Sync extends Mage_Core_Model_Mysql4_Abstract
6
  {
7
  protected function _construct()
8
  {
2
  /**
3
  * Job.php
4
  */
5
+ class MailUp_MailUpSync_Model_Mysql4_Sync extends Mage_Core_Model_Mysql4_Abstract
6
  {
7
  protected function _construct()
8
  {
app/code/local/MailUp/MailUpSync/Model/Mysql4/Sync/Collection.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Collection.php
4
+ */
5
+ class MailUp_MailUpSync_Model_Mysql4_Sync_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
6
+ {
7
+ public function _construct()
8
+ {
9
+ $this->_init("mailup/sync");
10
+ }
11
+ }
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Observer.php RENAMED
@@ -1,13 +1,13 @@
1
  <?php
2
 
3
  require_once dirname(__FILE__) . "/MailUpWsImport.php";
4
- require_once dirname(__FILE__) . "/Wssend.php";
5
- class SevenLike_MailUp_Model_Observer
6
  {
7
- const CRON_STRING_PATH = 'crontab/jobs/sevenlike_mailup/schedule/cron_expr';
8
 
9
  /**
10
- * @var SevenLike_MailUp_Model_Config
11
  */
12
  protected $_config;
13
 
@@ -22,6 +22,8 @@ class SevenLike_MailUp_Model_Observer
22
  */
23
  public function saveSystemConfig($observer)
24
  {
 
 
25
  Mage::getModel('core/config_data')
26
  ->load(self::CRON_STRING_PATH, 'path')
27
  ->setValue($this->_getSchedule())
@@ -31,6 +33,44 @@ class SevenLike_MailUp_Model_Observer
31
  Mage::app()->cleanCache();
32
 
33
  $this->configCheck();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  }
35
 
36
  /**
@@ -44,13 +84,13 @@ class SevenLike_MailUp_Model_Observer
44
  $data = Mage::app()->getRequest()->getPost('groups');
45
  $frequency = !empty($data['mailup']['fields']['mailup_cron_frequency']['value'])?
46
  $data['mailup']['fields']['mailup_cron_frequency']['value']:
47
- SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Frequency::HOURLY;
48
  $offset = !empty($data['mailup']['fields']['mailup_cron_offset']['value'])?
49
  $data['mailup']['fields']['mailup_cron_offset']['value']:
50
  0;
51
 
52
  // Get period between calls and calculate explicit hours using this and offset
53
- $period = SevenLike_MailUp_Model_Adminhtml_System_Source_Cron_Frequency::getPeriod($frequency);
54
  if ($period === null) {
55
  Mage::log("MailUp: Could not find cron frequency in valid list. Defaulted to hourly", Zend_Log::ERR);
56
  $period = 1;
@@ -83,7 +123,7 @@ class SevenLike_MailUp_Model_Observer
83
  * Observes: customer_customer_authenticated
84
  *
85
  * @param type $observer
86
- * @return \SevenLike_MailUp_Model_Observer
87
  */
88
  public function leggiUtente($observer)
89
  {
@@ -180,9 +220,9 @@ class SevenLike_MailUp_Model_Observer
180
  *
181
  * @see newsletter_subscriber_save_after
182
  * @param $observer
183
- * @return \SevenLike_MailUp_Model_Observer
184
  */
185
- public function inviaUtente($observer)
186
  {
187
  $model = $observer->getEvent()->getDataObject();
188
 
@@ -229,27 +269,11 @@ class SevenLike_MailUp_Model_Observer
229
 
230
  $console = Mage::getStoreConfig('mailup_newsletter/mailup/url_console');
231
  $listId = Mage::getStoreConfig('mailup_newsletter/mailup/list');
 
232
  $confirm = Mage::getStoreConfig('mailup_newsletter/mailup/require_subscription_confirmation');
233
 
234
  try {
235
- $wsImport = new MailUpWsImport();
236
- $xmlString = $wsImport->GetNlList();
237
- if (!$xmlString) return $this;
238
-
239
- $xmlString = html_entity_decode($xmlString);
240
- $startLists = strpos($xmlString, '<Lists>');
241
- $endPos = strpos($xmlString, '</Lists>');
242
- $endLists = $endPos + strlen('</Lists>') - $startLists;
243
- $xmlLists = substr($xmlString, $startLists, $endLists);
244
- $xmlLists = str_replace("&", "&amp;", $xmlLists);
245
- $xml = simplexml_load_string($xmlLists);
246
-
247
- foreach ($xml->List as $list) {
248
- if ($list['idList'] == $listId) {
249
- $listGUID = $list["listGUID"];
250
- break;
251
- }
252
- }
253
  if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) Mage::log("STATO ISCRIZIONE: $status");
254
  if ($status == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED ||
255
  $status == Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED) {
@@ -263,6 +287,11 @@ class SevenLike_MailUp_Model_Observer
263
  $ws .= "&Email=" . rawurlencode($model->getEmail());
264
  $ws .= "&Confirm=" . rawurlencode($confirm);
265
 
 
 
 
 
 
266
  try {
267
  if(Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) {
268
  Mage::log("mailup invio utente $ws");
@@ -314,16 +343,50 @@ class SevenLike_MailUp_Model_Observer
314
  }
315
  }
316
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  /**
318
  * Subscribe the user, during checkout.
319
- *
320
- * @return void
321
  */
322
- public function subscribeDuringCheckout()
323
  {
 
324
  if (isset($_REQUEST["mailup_subscribe2"]) && $_REQUEST["mailup_subscribe2"]) {
325
- $order_id = Mage::getSingleton("checkout/session")->getLastRealOrderId();
326
- $order = Mage::getModel("sales/order")->loadByIncrementId($order_id);
327
  try {
328
  Mage::getModel("newsletter/subscriber")->subscribe($order->getCustomerEmail());
329
  } catch (Exception $e) {}
@@ -407,7 +470,7 @@ class SevenLike_MailUp_Model_Observer
407
  *
408
  * @param int
409
  * @param int
410
- * @return boolean
411
  */
412
  private static function setCustomerForDataSync($customerId, $storeId = NULL)
413
  {
@@ -424,11 +487,11 @@ class SevenLike_MailUp_Model_Observer
424
  }
425
 
426
  $helper = Mage::helper('mailup');
427
- /* @var $helper SevenLike_Mailup_Helper_Data */
428
  $config = Mage::getModel('mailup/config');
429
- /* @var $config SevenLike_Mailup_Model_Config */
430
- $lists = Mage::getModel('mailup/lists');
431
- /* @var $lists SevenLike_MailUp_Model_Lists */
432
  $listID = $config->getMailupListId($storeId);
433
  $listGuid = $lists->getListGuid($listID, $storeId);
434
  // If list is not available, then cancel sync
@@ -439,13 +502,13 @@ class SevenLike_MailUp_Model_Observer
439
  return false;
440
  }
441
  $job = Mage::getModel('mailup/job');
442
- /* @var $job SevenLike_MailUp_Model_Job */
443
 
444
  /**
445
  * Only Sync if they are a subscriber!
446
  */
447
  if ( ! $helper->isSubscriber($customerId, $storeId)) {
448
- return;
449
  }
450
 
451
  // Set options for those already subscribed (not pending and no opt-in)
@@ -472,7 +535,7 @@ class SevenLike_MailUp_Model_Observer
472
 
473
  try {
474
  $jobTask = Mage::getModel('mailup/sync');
475
- /** @var $jobTask SevenLike_MailUp_Model_Sync */
476
  $jobTask->setData(array(
477
  'store_id' => $storeId,
478
  'customer_id' => $customerId,
@@ -504,7 +567,7 @@ class SevenLike_MailUp_Model_Observer
504
  /**
505
  * Get the config
506
  *
507
- * @reutrn SevenLike_MailUp_Model_Config
508
  */
509
  protected function _config()
510
  {
1
  <?php
2
 
3
  require_once dirname(__FILE__) . "/MailUpWsImport.php";
4
+
5
+ class MailUp_MailUpSync_Model_Observer
6
  {
7
+ const CRON_STRING_PATH = 'crontab/jobs/mailup_mailupsync/schedule/cron_expr';
8
 
9
  /**
10
+ * @var MailUp_MailUpSync_Model_Config
11
  */
12
  protected $_config;
13
 
22
  */
23
  public function saveSystemConfig($observer)
24
  {
25
+ Mage::getSingleton('adminhtml/session')->setMessages(Mage::getModel('core/message_collection'));
26
+
27
  Mage::getModel('core/config_data')
28
  ->load(self::CRON_STRING_PATH, 'path')
29
  ->setValue($this->_getSchedule())
33
  Mage::app()->cleanCache();
34
 
35
  $this->configCheck();
36
+
37
+ // If there are errors in config, do not progress further as it may be testing old data
38
+ $currentMessages = Mage::getSingleton('adminhtml/session')->getMessages();
39
+ foreach ($currentMessages->getItems() as $msg) {
40
+ if ($msg->getType() != 'success') {
41
+ return;
42
+ }
43
+ }
44
+
45
+ $messages = array();
46
+
47
+ // Close connection to avoid mysql gone away errors
48
+ $res = Mage::getSingleton('core/resource');
49
+ $res->getConnection('core_write')->closeConnection();
50
+
51
+ // Test connection
52
+ $storeId = Mage::app()->getStore();
53
+ $urlConsole = Mage::getStoreConfig('mailup_newsletter/mailup/url_console');
54
+ $usernameWs = Mage::getStoreConfig('mailup_newsletter/mailup/username_ws');
55
+ $passwordWs = Mage::getStoreConfig('mailup_newsletter/mailup/password_ws');
56
+ $retConn = Mage::helper('mailup')->testConnection($urlConsole, $usernameWs, $passwordWs, $storeId);
57
+ $messages = array_merge($messages, $retConn);
58
+
59
+ // Config tests
60
+ $retConfig = Mage::helper('mailup')->testConfig();
61
+ $messages = array_merge($messages, $retConfig);
62
+
63
+ // Re-open connection to avoid mysql gone away errors
64
+ $res->getConnection('core_write')->getConnection();
65
+
66
+ // Add messages from test
67
+ if (count($messages) > 0) {
68
+ foreach ($messages as $msg) {
69
+ $msgObj = Mage::getSingleton('core/message')->$msg['type']($msg['message']);
70
+ Mage::getSingleton('adminhtml/session')->addMessage($msgObj);
71
+ }
72
+ }
73
+
74
  }
75
 
76
  /**
84
  $data = Mage::app()->getRequest()->getPost('groups');
85
  $frequency = !empty($data['mailup']['fields']['mailup_cron_frequency']['value'])?
86
  $data['mailup']['fields']['mailup_cron_frequency']['value']:
87
+ MailUp_MailUpSync_Model_Adminhtml_System_Source_Cron_Frequency::HOURLY;
88
  $offset = !empty($data['mailup']['fields']['mailup_cron_offset']['value'])?
89
  $data['mailup']['fields']['mailup_cron_offset']['value']:
90
  0;
91
 
92
  // Get period between calls and calculate explicit hours using this and offset
93
+ $period = MailUp_MailUpSync_Model_Adminhtml_System_Source_Cron_Frequency::getPeriod($frequency);
94
  if ($period === null) {
95
  Mage::log("MailUp: Could not find cron frequency in valid list. Defaulted to hourly", Zend_Log::ERR);
96
  $period = 1;
123
  * Observes: customer_customer_authenticated
124
  *
125
  * @param type $observer
126
+ * @return \MailUp_MailUpSync_Model_Observer
127
  */
128
  public function leggiUtente($observer)
129
  {
220
  *
221
  * @see newsletter_subscriber_save_after
222
  * @param $observer
223
+ * @return \MailUp_MailUpSync_Model_Observer
224
  */
225
+ public function sendUser($observer)
226
  {
227
  $model = $observer->getEvent()->getDataObject();
228
 
269
 
270
  $console = Mage::getStoreConfig('mailup_newsletter/mailup/url_console');
271
  $listId = Mage::getStoreConfig('mailup_newsletter/mailup/list');
272
+ $defaultGroupId = Mage::getStoreConfig('mailup_newsletter/mailup/default_group');
273
  $confirm = Mage::getStoreConfig('mailup_newsletter/mailup/require_subscription_confirmation');
274
 
275
  try {
276
+ $listGUID = Mage::helper('mailup')->getListGuid($listId);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  if (Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) Mage::log("STATO ISCRIZIONE: $status");
278
  if ($status == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED ||
279
  $status == Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED) {
287
  $ws .= "&Email=" . rawurlencode($model->getEmail());
288
  $ws .= "&Confirm=" . rawurlencode($confirm);
289
 
290
+ // If there is a default group defined, use it
291
+ if ($defaultGroupId !== null) {
292
+ $ws .= "&Group=" . rawurlencode($defaultGroupId);
293
+ }
294
+
295
  try {
296
  if(Mage::getStoreConfig('mailup_newsletter/mailup/enable_log')) {
297
  Mage::log("mailup invio utente $ws");
343
  }
344
  }
345
 
346
+ /**
347
+ * Called on completion of an order (saved during one-page checkout)
348
+ * NOTE: If another checkout is used, this will not be called!
349
+ */
350
+ public function onCheckoutSaveOrder()
351
+ {
352
+ $order_id = Mage::getSingleton("checkout/session")->getLastRealOrderId();
353
+ $order = Mage::getModel("sales/order")->loadByIncrementId($order_id);
354
+
355
+ $this->clearAbandonment($order);
356
+ $this->subscribeDuringCheckout($order);
357
+ }
358
+
359
+ /**
360
+ * If customer already subscribed, or pending, then set abandoned cart details to null
361
+ *
362
+ * @param Mage_Sales_Model_Order $order
363
+ */
364
+ public function clearAbandonment($order)
365
+ {
366
+ // Get subscriber status
367
+ $email = $order->getCustomerEmail();
368
+ $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
369
+ if ($subscriber === null) {
370
+ return;
371
+ }
372
+ $status = $subscriber->getStatus();
373
+
374
+ // Check status and make API request to clear abandonment fields
375
+ if ($status == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED ||
376
+ $status == Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED) {
377
+ Mage::helper("mailup")->clearAbandonmentFields($email);
378
+ }
379
+ }
380
+
381
  /**
382
  * Subscribe the user, during checkout.
383
+ *
384
+ * @param Mage_Sales_Model_Order $order
385
  */
386
+ public function subscribeDuringCheckout($order)
387
  {
388
+ // If subscription option chosen, then subscribe
389
  if (isset($_REQUEST["mailup_subscribe2"]) && $_REQUEST["mailup_subscribe2"]) {
 
 
390
  try {
391
  Mage::getModel("newsletter/subscriber")->subscribe($order->getCustomerEmail());
392
  } catch (Exception $e) {}
470
  *
471
  * @param int
472
  * @param int
473
+ * @return boolean|null
474
  */
475
  private static function setCustomerForDataSync($customerId, $storeId = NULL)
476
  {
487
  }
488
 
489
  $helper = Mage::helper('mailup');
490
+ /* @var $helper MailUp_MailUpSync_Helper_Data */
491
  $config = Mage::getModel('mailup/config');
492
+ /* @var $config MailUp_MailUpSync_Model_Config */
493
+ $lists = Mage::getSingleton('mailup/source_lists');
494
+ /* @var $lists MailUp_MailUpSync_Model_Source_Lists */
495
  $listID = $config->getMailupListId($storeId);
496
  $listGuid = $lists->getListGuid($listID, $storeId);
497
  // If list is not available, then cancel sync
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)
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,
567
  /**
568
  * Get the config
569
  *
570
+ * @reutrn MailUp_MailUpSync_Model_Config
571
  */
572
  protected function _config()
573
  {
app/code/local/MailUp/MailUpSync/Model/Source/Groups.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Groups
4
+ */
5
+
6
+ /**
7
+ * Source for groups per list
8
+ */
9
+ class MailUp_MailUpSync_Model_Source_Groups
10
+ {
11
+ /**
12
+ * @var array
13
+ */
14
+ protected $_cache = array();
15
+
16
+ /**
17
+ * Get groups as array of options
18
+ *
19
+ * @param int|null $storeId
20
+ * @param int|null $listId
21
+ * @return array
22
+ */
23
+ public function toOptionArray($storeId = null, $listId = null)
24
+ {
25
+ $websiteCode = Mage::app()->getRequest()->getParam('website');
26
+ $storeCode = Mage::app()->getRequest()->getParam('store');
27
+
28
+ // Get store
29
+ if (isset($storeId) && $storeId == false) {
30
+ $storeId = Mage::app()->getStore($storeCode)->getId();
31
+ } elseif ($websiteCode) {
32
+ $storeId = Mage::app()
33
+ ->getWebsite($websiteCode)
34
+ ->getDefaultGroup()
35
+ ->getDefaultStoreId();
36
+ } else {
37
+ $storeId = NULL;
38
+ }
39
+
40
+ // Get List ID
41
+ if ($listId === null) {
42
+ $listId = Mage::getStoreConfig('mailup_newsletter/mailup/list', $storeId);
43
+ }
44
+
45
+ // Create select
46
+ $selectLists = array();
47
+ $selectLists[0] = array('value' => '', 'label'=>'-- No groups available --');
48
+
49
+ // Only attempt to get groups if there is a list specified
50
+ if (Mage::getStoreConfig('mailup_newsletter/mailup/list', $storeId)) {
51
+ // Get groups from list source (which gets both)
52
+ $sourcelist = Mage::getModel('mailup/source_lists');
53
+ $groups = $sourcelist->getListGroups($listId, $storeId);
54
+
55
+ // Put groups into option array
56
+ if ($groups !== false) {
57
+ $selectLists[0] = array('value' => '0', 'label'=>'-- Select a group (if any) --');
58
+ foreach ($groups as $index => $groupName) {
59
+ $selectLists[] = array(
60
+ 'value' => $index,
61
+ 'label' => $groupName
62
+ );
63
+ }
64
+ }
65
+ }
66
+
67
+ return $selectLists;
68
+ }
69
+
70
+ }
app/code/local/{SevenLike/MailUp/Model → MailUp/MailUpSync/Model/Source}/Lists.php RENAMED
@@ -2,10 +2,10 @@
2
  /**
3
  * Lists.php
4
  */
5
- require_once dirname(__FILE__) . "/MailUpWsImport.php";
6
- require_once dirname(__FILE__) . "/Wssend.php";
7
 
8
- class SevenLike_MailUp_Model_Lists
9
  {
10
  /**
11
  * @var array
@@ -54,7 +54,7 @@ class SevenLike_MailUp_Model_Lists
54
  //$storeId = Mage::app()->getDefaultStoreView()->getStoreId();
55
  }
56
 
57
- //genero la select per Magento
58
  $selectLists = array();
59
 
60
  if (Mage::getStoreConfig('mailup_newsletter/mailup/url_console', $storeId)
@@ -65,7 +65,7 @@ class SevenLike_MailUp_Model_Lists
65
  $accessKey = $wsSend->loginFromId();
66
 
67
  if ($accessKey !== false) {
68
- require_once dirname(__FILE__) . "/MailUpWsImport.php";
69
  $wsImport = new MailUpWsImport($storeId);
70
 
71
  $xmlString = $wsImport->GetNlList();
@@ -110,8 +110,8 @@ class SevenLike_MailUp_Model_Lists
110
  }
111
 
112
  /**
113
- *
114
  * Get an array of list data, and its groups.
 
115
  * @param $listId
116
  * @param $storeId
117
  * @return bool|array
@@ -165,7 +165,7 @@ class SevenLike_MailUp_Model_Lists
165
  }
166
 
167
  // Attempt to make call to get lists from API
168
- require_once dirname(__FILE__) . "/MailUpWsImport.php";
169
  $wsImport = new MailUpWsImport($storeId);
170
  $xmlString = $wsImport->GetNlList();
171
  if (!$xmlString) {
@@ -244,14 +244,14 @@ class SevenLike_MailUp_Model_Lists
244
  }
245
 
246
  /**
247
- * @var SevenLike_MailUp_Model_Config
248
  */
249
  protected $_config;
250
 
251
  /**
252
  * Get the config
253
  *
254
- * @reutrn SevenLike_MailUp_Model_Config
255
  */
256
  protected function _config()
257
  {
2
  /**
3
  * Lists.php
4
  */
5
+ require_once dirname(__DIR__) . "/MailUpWsImport.php";
6
+ require_once dirname(__DIR__) . "/Wssend.php";
7
 
8
+ class MailUp_MailUpSync_Model_Source_Lists
9
  {
10
  /**
11
  * @var array
54
  //$storeId = Mage::app()->getDefaultStoreView()->getStoreId();
55
  }
56
 
57
+ // Create select
58
  $selectLists = array();
59
 
60
  if (Mage::getStoreConfig('mailup_newsletter/mailup/url_console', $storeId)
65
  $accessKey = $wsSend->loginFromId();
66
 
67
  if ($accessKey !== false) {
68
+ require_once dirname(__DIR__) . "/MailUpWsImport.php";
69
  $wsImport = new MailUpWsImport($storeId);
70
 
71
  $xmlString = $wsImport->GetNlList();
110
  }
111
 
112
  /**
 
113
  * Get an array of list data, and its groups.
114
+ *
115
  * @param $listId
116
  * @param $storeId
117
  * @return bool|array
165
  }
166
 
167
  // Attempt to make call to get lists from API
168
+ require_once dirname(__DIR__) . "/MailUpWsImport.php";
169
  $wsImport = new MailUpWsImport($storeId);
170
  $xmlString = $wsImport->GetNlList();
171
  if (!$xmlString) {
244
  }
245
 
246
  /**
247
+ * @var MailUp_MailUpSync_Model_Config
248
  */
249
  protected $_config;
250
 
251
  /**
252
  * Get the config
253
  *
254
+ * @reutrn MailUp_MailUpSync_Model_Config
255
  */
256
  protected function _config()
257
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Source/Store.php RENAMED
@@ -4,7 +4,7 @@
4
  *
5
  * Central config model
6
  */
7
- class SevenLike_MailUp_Model_Source_Store
8
  {
9
  /**
10
  * Options getter
4
  *
5
  * Central config model
6
  */
7
+ class MailUp_MailUpSync_Model_Source_Store
8
  {
9
  /**
10
  * Options getter
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Subscriber.php RENAMED
@@ -4,14 +4,14 @@
4
  *
5
  * Override Magento subscriber to allow us to enable / disable the Notifications
6
  */
7
- class SevenLike_MailUp_Model_Subscriber extends Mage_Newsletter_Model_Subscriber
8
  {
9
  /**
10
  * Send Success Email
11
  *
12
  * @override
13
  * @todo make this per store scope!
14
- * @return SevenLike_MailUp_Model_Subscriber
15
  */
16
  public function sendConfirmationSuccessEmail()
17
  {
@@ -30,7 +30,7 @@ class SevenLike_MailUp_Model_Subscriber extends Mage_Newsletter_Model_Subscriber
30
  *
31
  * @override
32
  * @todo make this per store scope!
33
- * @return SevenLike_MailUp_Model_Subscriber
34
  */
35
  public function sendConfirmationRequestEmail()
36
  {
@@ -48,7 +48,7 @@ class SevenLike_MailUp_Model_Subscriber extends Mage_Newsletter_Model_Subscriber
48
  *
49
  * @override
50
  * @todo make this per store scope!
51
- * @return SevenLike_MailUp_Model_Subscriber
52
  */
53
  public function sendUnsubscriptionEmail()
54
  {
@@ -64,7 +64,7 @@ class SevenLike_MailUp_Model_Subscriber extends Mage_Newsletter_Model_Subscriber
64
  /**
65
  * Get the config
66
  *
67
- * @return SevenLike_MailUp_Model_Config
68
  */
69
  protected function _getConfig()
70
  {
4
  *
5
  * Override Magento subscriber to allow us to enable / disable the Notifications
6
  */
7
+ class MailUp_MailUpSync_Model_Subscriber extends Mage_Newsletter_Model_Subscriber
8
  {
9
  /**
10
  * Send Success Email
11
  *
12
  * @override
13
  * @todo make this per store scope!
14
+ * @return MailUp_MailUpSync_Model_Subscriber
15
  */
16
  public function sendConfirmationSuccessEmail()
17
  {
30
  *
31
  * @override
32
  * @todo make this per store scope!
33
+ * @return MailUp_MailUpSync_Model_Subscriber
34
  */
35
  public function sendConfirmationRequestEmail()
36
  {
48
  *
49
  * @override
50
  * @todo make this per store scope!
51
+ * @return MailUp_MailUpSync_Model_Subscriber
52
  */
53
  public function sendUnsubscriptionEmail()
54
  {
64
  /**
65
  * Get the config
66
  *
67
+ * @return MailUp_MailUpSync_Model_Config
68
  */
69
  protected function _getConfig()
70
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Sync.php RENAMED
@@ -6,7 +6,7 @@
6
  * @method int getCustomerId()
7
  * @method int getJobId()
8
  */
9
- class SevenLike_MailUp_Model_Sync extends Mage_Core_Model_Abstract
10
  {
11
  /**
12
  * Constructor
@@ -72,7 +72,7 @@ class SevenLike_MailUp_Model_Sync extends Mage_Core_Model_Abstract
72
  /**
73
  * Get a collection of items which need Synced
74
  *
75
- * @return SevenLike_MailUp_Model_Mysql4_Sync_Collection
76
  */
77
  public function getSyncItemsCollection()
78
  {
@@ -87,7 +87,7 @@ class SevenLike_MailUp_Model_Sync extends Mage_Core_Model_Abstract
87
  $customerEntityTable = Mage::getSingleton('core/resource')->getTableName('customer_entity');
88
  //$customerEntityTable = $this->getTable('customer/entity');
89
  $collection = $this->getCollection();
90
- /* @var $collection SevenLike_MailUp_Model_Mysql4_Sync_Collection */
91
 
92
  $collection
93
  ->addFieldToSelect('*')
@@ -102,7 +102,7 @@ class SevenLike_MailUp_Model_Sync extends Mage_Core_Model_Abstract
102
  /**
103
  * Get Sync entries for a particular job.
104
  *
105
- * @return SevenLike_MailUp_Model_Mysql4_Sync_Collection
106
  */
107
  public function fetchByJobId($jobId)
108
  {
@@ -116,7 +116,7 @@ class SevenLike_MailUp_Model_Sync extends Mage_Core_Model_Abstract
116
  /**
117
  * Get the job model.
118
  *
119
- * @return SevenLike_Mailup_Model_Job
120
  */
121
  public function getJob()
122
  {
6
  * @method int getCustomerId()
7
  * @method int getJobId()
8
  */
9
+ class MailUp_MailUpSync_Model_Sync extends Mage_Core_Model_Abstract
10
  {
11
  /**
12
  * Constructor
72
  /**
73
  * Get a collection of items which need Synced
74
  *
75
+ * @return MailUp_MailUpSync_Model_Mysql4_Sync_Collection
76
  */
77
  public function getSyncItemsCollection()
78
  {
87
  $customerEntityTable = Mage::getSingleton('core/resource')->getTableName('customer_entity');
88
  //$customerEntityTable = $this->getTable('customer/entity');
89
  $collection = $this->getCollection();
90
+ /* @var $collection MailUp_MailUpSync_Model_Mysql4_Sync_Collection */
91
 
92
  $collection
93
  ->addFieldToSelect('*')
102
  /**
103
  * Get Sync entries for a particular job.
104
  *
105
+ * @return MailUp_MailUpSync_Model_Mysql4_Sync_Collection
106
  */
107
  public function fetchByJobId($jobId)
108
  {
116
  /**
117
  * Get the job model.
118
  *
119
+ * @return MailUp_MailUpSync_Model_Job
120
  */
121
  public function getJob()
122
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Webserviceusernamevalidator.php RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class SevenLike_MailUp_Model_Webserviceusernamevalidator extends Mage_Core_Model_Config_Data
4
  {
5
  public function save()
6
  {
1
  <?php
2
 
3
+ class MailUp_MailUpSync_Model_Webserviceusernamevalidator extends Mage_Core_Model_Config_Data
4
  {
5
  public function save()
6
  {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Ws.php RENAMED
File without changes
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/Model/Wssend.php RENAMED
@@ -11,7 +11,7 @@ class MailUpWsSend
11
  */
12
  protected $storeId;
13
  /**
14
- * @var SevenLike_MailUp_Model_Config
15
  */
16
  protected $_config;
17
 
@@ -73,15 +73,36 @@ class MailUpWsSend
73
  }
74
 
75
  /**
76
- * @return $accessKey | false
 
 
 
 
 
77
  */
78
- public function loginFromId()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  {
80
  try {
81
  //login with webservice user
82
- $loginData = array ('user' => Mage::getStoreConfig('mailup_newsletter/mailup/username_ws', $this->storeId),
83
- 'pwd' => Mage::getStoreConfig('mailup_newsletter/mailup/password_ws', $this->storeId),
84
- 'consoleId' => substr(Mage::getStoreConfig('mailup_newsletter/mailup/username_ws', $this->storeId), 1));
85
 
86
  $result = get_object_vars($this->soapClient->LoginFromId($loginData));
87
  $xml = simplexml_load_string($result['LoginFromIdResult']);
@@ -395,7 +416,7 @@ class MailUpWsSend
395
  /**
396
  * Get the config
397
  *
398
- * @reutrn SevenLike_MailUp_Model_Config
399
  */
400
  protected function _config()
401
  {
11
  */
12
  protected $storeId;
13
  /**
14
+ * @var MailUp_MailUpSync_Model_Config
15
  */
16
  protected $_config;
17
 
73
  }
74
 
75
  /**
76
+ * Login, returning access key or false on failing to login
77
+ *
78
+ * @param null $user
79
+ * @param null $pwd
80
+ * @param null $consoleId
81
+ * @return false|string Access key or false
82
  */
83
+ public function loginFromId($user=null, $pwd=null, $consoleId=null)
84
+ {
85
+ // login with webservice user
86
+ $user = ($user !== null) ? $user : Mage::getStoreConfig('mailup_newsletter/mailup/username_ws', $this->storeId);
87
+ $pwd = ($pwd !== null) ? $pwd : Mage::getStoreConfig('mailup_newsletter/mailup/password_ws', $this->storeId);
88
+ $consoleId = ($consoleId !== null) ? $consoleId : substr($user, 1);
89
+
90
+ return $this->_loginFromId($user, $pwd, $consoleId);
91
+ }
92
+
93
+ /**
94
+ * Login, returning access key or false on failing to login
95
+ *
96
+ * @param null $user
97
+ * @param null $pwd
98
+ * @param null $consoleId
99
+ * @return string|false Access key or false
100
+ */
101
+ protected function _loginFromId($user, $pwd, $consoleId)
102
  {
103
  try {
104
  //login with webservice user
105
+ $loginData = array ('user' => $user, 'pwd' => $pwd, 'consoleId' => $consoleId);
 
 
106
 
107
  $result = get_object_vars($this->soapClient->LoginFromId($loginData));
108
  $xml = simplexml_load_string($result['LoginFromIdResult']);
416
  /**
417
  * Get the config
418
  *
419
+ * @reutrn MailUp_MailUpSync_Model_Config
420
  */
421
  protected function _config()
422
  {
app/code/local/MailUp/MailUpSync/controllers/Adminhtml/ConfigurationController.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once dirname(__FILE__) . "/../../Model/MailUpWsImport.php";
4
+ require_once dirname(__FILE__) . "/../../Model/Wssend.php";
5
+ class MailUp_MailUpSync_Adminhtml_ConfigurationController extends Mage_Adminhtml_Controller_Action
6
+ {
7
+ public function indexAction()
8
+ {
9
+ $url = Mage::getModel('adminhtml/url');
10
+ $url = $url->getUrl("adminhtml/system_config/edit", array(
11
+ "section" => "mailup_newsletter"
12
+ ));
13
+ Mage::app()->getResponse()->setRedirect($url);
14
+ }
15
+
16
+ /**
17
+ * Get groups for given list
18
+ */
19
+ public function getgroupsAction()
20
+ {
21
+ // Get passed list ID to get groups for
22
+ $listId = $this->getRequest()->getParam('list');
23
+ if ($listId === null) {
24
+ $output = '<option>-- Could not find list --</option>';
25
+ } else {
26
+ $groups = Mage::getSingleton('mailup/source_groups')->toOptionArray(null, $listId);
27
+
28
+ // Render output directly (as output is so simple)
29
+ $output = '';
30
+ foreach ($groups as $group) {
31
+ $output .= "<option value=\"{$group['value']}\">{$group['label']}</option>\n";
32
+ }
33
+ }
34
+
35
+ $this->getResponse()->setBody($output);
36
+ }
37
+
38
+ /**
39
+ * Run connection-to-mailup test other system configurations that area relevant
40
+ */
41
+ public function testconnectionAction()
42
+ {
43
+ // Get login details from AJAX
44
+ $urlConsole = $this->getRequest()->getParam('url_console');
45
+ $usernameWs = $this->getRequest()->getParam('username_ws');
46
+ $passwordWs = $this->getRequest()->getParam('password_ws');
47
+
48
+ // Ensure that all required fields are given
49
+ if ($urlConsole === null || $usernameWs === null || $passwordWs === null) {
50
+ $class = 'notice';
51
+ $message = $this->__('Please fill in MailUp console URL, Username and Password before testing');
52
+ $output = '<ul class="messages"><li class="' . $class . '-msg"><ul><li>' . $message . '</li></ul></li></ul>';
53
+ $this->getResponse()->setBody($output);
54
+ return;
55
+ }
56
+
57
+ $messages = array();
58
+
59
+ // Close connection to avoid mysql gone away errors
60
+ $res = Mage::getSingleton('core/resource');
61
+ $res->getConnection('core_write')->closeConnection();
62
+
63
+ // Test connection
64
+ $storeId = Mage::app()->getStore();
65
+ $retConn = Mage::helper('mailup')->testConnection($urlConsole, $usernameWs, $passwordWs, $storeId);
66
+ $messages = array_merge($messages, $retConn);
67
+
68
+ // Config tests
69
+ $retConfig = Mage::helper('mailup')->testConfig();
70
+ $messages = array_merge($messages, $retConfig);
71
+
72
+ // Re-open connection to avoid mysql gone away errors
73
+ $res->getConnection('core_write')->getConnection();
74
+
75
+ // Connect up the messages to be returned as ajax
76
+ $renderedMessages = array();
77
+ if (count($messages) > 0) {
78
+ foreach ($messages as $msg) {
79
+ $renderedMessages[] = '<li class="' . $msg['type'] . '-msg"><ul><li>' . $msg['message'] . '</li></ul></li>';
80
+ }
81
+ }
82
+ $output = '<ul class="messages">' . implode("\n", $renderedMessages) . '</ul>';
83
+ $this->getResponse()->setBody($output);
84
+ }
85
+ }
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/Adminhtml/FieldsmappingController.php RENAMED
@@ -4,7 +4,7 @@
4
  */
5
  require_once dirname(__FILE__) . "/../../Model/MailUpWsImport.php";
6
  require_once dirname(__FILE__) . "/../../Model/Wssend.php";
7
- class SevenLike_MailUp_Adminhtml_FieldsMappingController extends Mage_Adminhtml_Controller_Action
8
  {
9
  public function indexAction() {
10
  $this->loadLayout()->renderLayout();
4
  */
5
  require_once dirname(__FILE__) . "/../../Model/MailUpWsImport.php";
6
  require_once dirname(__FILE__) . "/../../Model/Wssend.php";
7
+ class MailUp_MailUpSync_Adminhtml_FieldsMappingController extends Mage_Adminhtml_Controller_Action
8
  {
9
  public function indexAction() {
10
  $this->loadLayout()->renderLayout();
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/Adminhtml/FilterController.php RENAMED
@@ -4,7 +4,7 @@ require_once dirname(__FILE__) . "/../../Model/Wssend.php";
4
  /**
5
  * FilterController.php
6
  */
7
- class SevenLike_MailUp_Adminhtml_FilterController extends Mage_Adminhtml_Controller_Action
8
  {
9
  /**
10
  * split customers into batches
@@ -44,11 +44,13 @@ class SevenLike_MailUp_Adminhtml_FilterController extends Mage_Adminhtml_Control
44
  }
45
 
46
  $config = Mage::getModel('mailup/config');
47
- /* @var $config SevenLike_Mailup_Model_Config */
48
  //$subscriber = Mage::getModel('newsletter/subscriber');
49
  /* @var $subscriber Mage_Newsletter_Model_Subscriber */
50
 
51
  $sendOptinEmail = isset($post['send_optin_email_to_new_subscribers']) && ($post['send_optin_email_to_new_subscribers'] == 1);
 
 
52
  $mailupCustomerIds = Mage::getSingleton('core/session')->getMailupCustomerIds();
53
  //$totalCustomers = count($mailupCustomerIds);
54
  $batches = $this->_getBatches($mailupCustomerIds, $storeId);
@@ -67,7 +69,7 @@ class SevenLike_MailUp_Adminhtml_FilterController extends Mage_Adminhtml_Control
67
  "newGroupName" => $post["mailupNewGroupName"]
68
  ));
69
  }
70
-
71
  /**
72
  * Makes batches if required. Separate the jobs into max amount of customers.
73
  * Create a new job for each batch.
@@ -94,17 +96,20 @@ class SevenLike_MailUp_Adminhtml_FilterController extends Mage_Adminhtml_Control
94
  }
95
 
96
  $job = Mage::getModel('mailup/job');
97
- /* @var $job SevenLike_MailUp_Model_Job */
98
  $job->setData(array(
99
  "mailupgroupid" => $post['mailupGroupId'],
100
  "send_optin" => $sendOptin,
101
- 'as_pending' => $asPending,
102
  "status" => "queued",
103
  "queue_datetime" => gmdate("Y-m-d H:i:s"),
104
  'store_id' => $storeId,
105
  'list_id' => $post['mailupIdList'],
106
  'list_guid' => $post['mailupListGUID'],
107
  ));
 
 
 
108
  try {
109
  $job->save();
110
  $config->dbLog(
@@ -131,7 +136,7 @@ class SevenLike_MailUp_Adminhtml_FilterController extends Mage_Adminhtml_Control
131
  //$customer = Mage::getModel('customer/customer');
132
  /* @var $customer Mage_Customer_Model_Customer */
133
  $jobTask = Mage::getModel('mailup/sync');
134
- /* @var $jobTask SevenLike_MailUp_Model_Sync */
135
  try {
136
  $jobTask->setData(array(
137
  "customer_id" => $customerId,
@@ -155,7 +160,7 @@ class SevenLike_MailUp_Adminhtml_FilterController extends Mage_Adminhtml_Control
155
  */
156
  $cronDelay = (int) ($batchNumber * 15) + 2;
157
  $db_write->insert(Mage::getSingleton('core/resource')->getTableName('cron_schedule'), array(
158
- "job_code" => "sevenlike_mailup",
159
  "status" => "pending",
160
  "created_at" => gmdate("Y-m-d H:i:s"),
161
  "scheduled_at" => gmdate("Y-m-d H:i:s", strtotime("+{$cronDelay}minutes"))
@@ -202,7 +207,7 @@ class SevenLike_MailUp_Adminhtml_FilterController extends Mage_Adminhtml_Control
202
  protected function _getBatches($mailupCustomerIds, $storeId)
203
  {
204
  $helper = Mage::helper('mailup');
205
- /* @var $helper SevenLike_Mailup_Helper_Data */
206
  $totalCustomers = count($mailupCustomerIds);
207
  $batches = array_chunk($mailupCustomerIds, self::BATCH_SIZE);
208
  //$totalBatches = count($customerIdBatches);
@@ -236,14 +241,14 @@ class SevenLike_MailUp_Adminhtml_FilterController extends Mage_Adminhtml_Control
236
  }
237
 
238
  /**
239
- * @var SevenLike_MailUp_Model_Config
240
  */
241
  protected $_config;
242
 
243
  /**
244
  * Get the config
245
  *
246
- * @reutrn SevenLike_MailUp_Model_Config
247
  */
248
  protected function _config()
249
  {
@@ -269,7 +274,7 @@ class SevenLike_MailUp_Adminhtml_FilterController extends Mage_Adminhtml_Control
269
  $mailupCustomerIds = Mage::getSingleton('core/session')->getMailupCustomerIds();
270
 
271
  //require_once(dirname(__FILE__) . '/../Helper/Data.php');
272
- $customersData = SevenLike_MailUp_Helper_Data::getCustomersData();
273
 
274
  //CSV Column names
275
  $file = '"Email","First Name","Last Name"';
@@ -409,7 +414,7 @@ class SevenLike_MailUp_Adminhtml_FilterController extends Mage_Adminhtml_Control
409
  $running_processes = $db->fetchOne(
410
  "SELECT count(*)
411
  FROM $cron_schedule_table
412
- WHERE job_code='sevenlike_mailup' AND status='running'"
413
  );
414
  if ($running_processes) {
415
  Mage::getSingleton("adminhtml/session")->addNotice($this->__("A MailUp import process is running."));
@@ -419,7 +424,7 @@ class SevenLike_MailUp_Adminhtml_FilterController extends Mage_Adminhtml_Control
419
  $scheduled_processes = $db->fetchOne(
420
  "SELECT count(*)
421
  FROM $cron_schedule_table
422
- WHERE job_code='sevenlike_mailup' AND status='pending'"
423
  );
424
  if ($scheduled_processes) {
425
  Mage::getSingleton("adminhtml/session")->addNotice($this->__("A MailUp import process is schedules and will be executed soon."));
@@ -429,7 +434,7 @@ class SevenLike_MailUp_Adminhtml_FilterController extends Mage_Adminhtml_Control
429
 
430
  public function testCronAction()
431
  {
432
- $cron = new SevenLike_MailUp_Model_Cron();
433
  $cron->run();
434
  }
435
 
4
  /**
5
  * FilterController.php
6
  */
7
+ class MailUp_MailUpSync_Adminhtml_FilterController extends Mage_Adminhtml_Controller_Action
8
  {
9
  /**
10
  * split customers into batches
44
  }
45
 
46
  $config = Mage::getModel('mailup/config');
47
+ /* @var $config MailUp_MailUpSync_Model_Config */
48
  //$subscriber = Mage::getModel('newsletter/subscriber');
49
  /* @var $subscriber Mage_Newsletter_Model_Subscriber */
50
 
51
  $sendOptinEmail = isset($post['send_optin_email_to_new_subscribers']) && ($post['send_optin_email_to_new_subscribers'] == 1);
52
+ // Only save message_id if passed and if opt_in is true
53
+ $sendMessageId = ($sendOptinEmail && isset($post['message_id'])) ? $post['message_id'] : null;
54
  $mailupCustomerIds = Mage::getSingleton('core/session')->getMailupCustomerIds();
55
  //$totalCustomers = count($mailupCustomerIds);
56
  $batches = $this->_getBatches($mailupCustomerIds, $storeId);
69
  "newGroupName" => $post["mailupNewGroupName"]
70
  ));
71
  }
72
+
73
  /**
74
  * Makes batches if required. Separate the jobs into max amount of customers.
75
  * Create a new job for each batch.
96
  }
97
 
98
  $job = Mage::getModel('mailup/job');
99
+ /* @var $job MailUp_MailUpSync_Model_Job */
100
  $job->setData(array(
101
  "mailupgroupid" => $post['mailupGroupId'],
102
  "send_optin" => $sendOptin,
103
+ 'as_pending' => $asPending,
104
  "status" => "queued",
105
  "queue_datetime" => gmdate("Y-m-d H:i:s"),
106
  'store_id' => $storeId,
107
  'list_id' => $post['mailupIdList'],
108
  'list_guid' => $post['mailupListGUID'],
109
  ));
110
+ if ($sendMessageId) {
111
+ $job->setMessageId($sendMessageId);
112
+ }
113
  try {
114
  $job->save();
115
  $config->dbLog(
136
  //$customer = Mage::getModel('customer/customer');
137
  /* @var $customer Mage_Customer_Model_Customer */
138
  $jobTask = Mage::getModel('mailup/sync');
139
+ /* @var $jobTask MailUp_MailUpSync_Model_Sync */
140
  try {
141
  $jobTask->setData(array(
142
  "customer_id" => $customerId,
160
  */
161
  $cronDelay = (int) ($batchNumber * 15) + 2;
162
  $db_write->insert(Mage::getSingleton('core/resource')->getTableName('cron_schedule'), array(
163
+ "job_code" => "mailup_mailupsync",
164
  "status" => "pending",
165
  "created_at" => gmdate("Y-m-d H:i:s"),
166
  "scheduled_at" => gmdate("Y-m-d H:i:s", strtotime("+{$cronDelay}minutes"))
207
  protected function _getBatches($mailupCustomerIds, $storeId)
208
  {
209
  $helper = Mage::helper('mailup');
210
+ /* @var $helper MailUp_MailUpSync_Helper_Data */
211
  $totalCustomers = count($mailupCustomerIds);
212
  $batches = array_chunk($mailupCustomerIds, self::BATCH_SIZE);
213
  //$totalBatches = count($customerIdBatches);
241
  }
242
 
243
  /**
244
+ * @var MailUp_MailUpSync_Model_Config
245
  */
246
  protected $_config;
247
 
248
  /**
249
  * Get the config
250
  *
251
+ * @reutrn MailUp_MailUpSync_Model_Config
252
  */
253
  protected function _config()
254
  {
274
  $mailupCustomerIds = Mage::getSingleton('core/session')->getMailupCustomerIds();
275
 
276
  //require_once(dirname(__FILE__) . '/../Helper/Data.php');
277
+ $customersData = MailUp_MailUpSync_Helper_Data::getCustomersData();
278
 
279
  //CSV Column names
280
  $file = '"Email","First Name","Last Name"';
414
  $running_processes = $db->fetchOne(
415
  "SELECT count(*)
416
  FROM $cron_schedule_table
417
+ WHERE job_code='mailup_mailupsync' AND status='running'"
418
  );
419
  if ($running_processes) {
420
  Mage::getSingleton("adminhtml/session")->addNotice($this->__("A MailUp import process is running."));
424
  $scheduled_processes = $db->fetchOne(
425
  "SELECT count(*)
426
  FROM $cron_schedule_table
427
+ WHERE job_code='mailup_mailupsync' AND status='pending'"
428
  );
429
  if ($scheduled_processes) {
430
  Mage::getSingleton("adminhtml/session")->addNotice($this->__("A MailUp import process is schedules and will be executed soon."));
434
 
435
  public function testCronAction()
436
  {
437
+ $cron = new MailUp_MailUpSync_Model_Cron();
438
  $cron->run();
439
  }
440
 
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/Adminhtml/LogController.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * LogController.php
4
  */
5
- class SevenLike_MailUp_Adminhtml_LogController extends Mage_Adminhtml_Controller_Action
6
  {
7
  /**
8
  * Default Action
2
  /**
3
  * LogController.php
4
  */
5
+ class MailUp_MailUpSync_Adminhtml_LogController extends Mage_Adminhtml_Controller_Action
6
  {
7
  /**
8
  * Default Action
app/code/local/MailUp/MailUpSync/controllers/Adminhtml/MailupbackendController.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MailUp_MailUpSync_Adminhtml_MailupbackendController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ /**
5
+ * Default Action
6
+ */
7
+ public function indexAction()
8
+ {
9
+ $this->loadLayout();
10
+ $this->_title($this->__("MailUp Jobs"));
11
+ $this->renderLayout();
12
+ }
13
+
14
+ /**
15
+ * Run The Job
16
+ */
17
+ public function runjobAction()
18
+ {
19
+ /** @var $session Mage_Admin_Model_Session */
20
+ $session = Mage::getSingleton('adminhtml/session');
21
+ $id = $this->getRequest()->getParam('id');
22
+
23
+ if( ! $id) {
24
+ $session->addError(
25
+ Mage::helper('mailup')->__('Invalid Entity')
26
+ );
27
+ }
28
+
29
+ $entity = Mage::getModel('mailup/job')->load($id);
30
+ if($entity) {
31
+ Mage::helper('mailup')->runJob($entity->getId());
32
+ }
33
+
34
+ $session->addSuccess(
35
+ Mage::helper('mailup')->__("Run Job [{$entity->getId()}]")
36
+ );
37
+
38
+ $this->_redirect('*/*/index');
39
+ }
40
+
41
+ /**
42
+ * Delete a job
43
+ */
44
+ public function deleteAction()
45
+ {
46
+ /** @var $session Mage_Admin_Model_Session */
47
+ $session = Mage::getSingleton('adminhtml/session');
48
+ $id = $this->getRequest()->getParam('id');
49
+
50
+ if( ! $id) {
51
+ $session->addError(
52
+ Mage::helper('mailup')->__('Invalid Entity')
53
+ );
54
+ }
55
+
56
+ $entity = Mage::getModel('mailup/job')->load($id);
57
+ $entity->delete();
58
+
59
+ $session->addSuccess(
60
+ Mage::helper('mailup')->__("Job [{$entity->getId()}] [Deleted]")
61
+ );
62
+
63
+ $this->_redirect('*/*/index');
64
+ }
65
+ }
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/Adminhtml/SyncController.php RENAMED
@@ -1,5 +1,5 @@
1
  <?php
2
- class SevenLike_MailUp_Adminhtml_SyncController extends Mage_Adminhtml_Controller_Action
3
  {
4
  /**
5
  * Default Action
1
  <?php
2
+ class MailUp_MailUpSync_Adminhtml_SyncController extends Mage_Adminhtml_Controller_Action
3
  {
4
  /**
5
  * Default Action
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/Adminhtml/ViewdatatransferlogController.php RENAMED
@@ -2,7 +2,7 @@
2
 
3
  require_once dirname(__FILE__) . "/../../Model/MailUpWsImport.php";
4
  require_once dirname(__FILE__) . "/../../Model/Wssend.php";
5
- class SevenLike_MailUp_Adminhtml_ViewdatatransferlogController extends Mage_Adminhtml_Controller_Action
6
  {
7
  public function indexAction() {
8
  $this->loadLayout()->renderLayout();
2
 
3
  require_once dirname(__FILE__) . "/../../Model/MailUpWsImport.php";
4
  require_once dirname(__FILE__) . "/../../Model/Wssend.php";
5
+ class MailUp_MailUpSync_Adminhtml_ViewdatatransferlogController extends Mage_Adminhtml_Controller_Action
6
  {
7
  public function indexAction() {
8
  $this->loadLayout()->renderLayout();
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/IndexController.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * IndexController.php
4
  */
5
- class SevenLike_MailUp_IndexController extends Mage_Core_Controller_Front_Action
6
  {
7
  /**
8
  * Predispatch: should set layout area
@@ -12,7 +12,7 @@ class SevenLike_MailUp_IndexController extends Mage_Core_Controller_Front_Action
12
  public function preDispatch()
13
  {
14
  $config = Mage::getModel('mailup/config');
15
- /* @var $config SevenLike_MailUp_Model_Config */
16
 
17
  //if( ! $config->isTestMode()) {
18
  // die('Access Denied.');
2
  /**
3
  * IndexController.php
4
  */
5
+ class MailUp_MailUpSync_IndexController extends Mage_Core_Controller_Front_Action
6
  {
7
  /**
8
  * Predispatch: should set layout area
12
  public function preDispatch()
13
  {
14
  $config = Mage::getModel('mailup/config');
15
+ /* @var $config MailUp_MailUpSync_Model_Config */
16
 
17
  //if( ! $config->isTestMode()) {
18
  // die('Access Denied.');
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/TestController.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * TestController.php
4
  */
5
- class SevenLike_MailUp_TestController extends Mage_Core_Controller_Front_Action
6
  {
7
  /**
8
  * Predispatch: should set layout area
@@ -15,7 +15,7 @@ class SevenLike_MailUp_TestController extends Mage_Core_Controller_Front_Action
15
  public function preDispatch()
16
  {
17
  $config = Mage::getModel('mailup/config');
18
- /* @var $config SevenLike_MailUp_Model_Config */
19
 
20
  if( ! $config->isTestMode()) {
21
  die('Access Denied.');
@@ -78,10 +78,10 @@ class SevenLike_MailUp_TestController extends Mage_Core_Controller_Front_Action
78
  public function modelsAction()
79
  {
80
  $jobTask = Mage::getModel('mailup/sync');
81
- /* @var $jobTask SevenLike_MailUp_Model_Sync */
82
 
83
  $job = Mage::getModel('mailup/job');
84
- /* @var $job SevenLike_MailUp_Model_Job */
85
 
86
  $tasks = $jobTask->getSyncItemsCollection();
87
  foreach($tasks as $task) {
2
  /**
3
  * TestController.php
4
  */
5
+ class MailUp_MailUpSync_TestController extends Mage_Core_Controller_Front_Action
6
  {
7
  /**
8
  * Predispatch: should set layout area
15
  public function preDispatch()
16
  {
17
  $config = Mage::getModel('mailup/config');
18
+ /* @var $config MailUp_MailUpSync_Model_Config */
19
 
20
  if( ! $config->isTestMode()) {
21
  die('Access Denied.');
78
  public function modelsAction()
79
  {
80
  $jobTask = Mage::getModel('mailup/sync');
81
+ /* @var $jobTask MailUp_MailUpSync_Model_Sync */
82
 
83
  $job = Mage::getModel('mailup/job');
84
+ /* @var $job MailUp_MailUpSync_Model_Job */
85
 
86
  $tasks = $jobTask->getSyncItemsCollection();
87
  foreach($tasks as $task) {
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/controllers/WebhookController.php RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class SevenLike_MailUp_WebhookController extends Mage_Core_Controller_Front_Action
4
  {
5
  public function indexAction()
6
  {
1
  <?php
2
 
3
+ class MailUp_MailUpSync_WebhookController extends Mage_Core_Controller_Front_Action
4
  {
5
  public function indexAction()
6
  {
app/code/local/MailUp/MailUpSync/data/mailup_setup/upgrade-2.6.1-2.7.0.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Update Mailup
4
+ */
5
+ $installer = $this;
6
+ $this->startSetup();
7
+
8
+ /**
9
+ * Rename sync jobs to remove sevenlike reference
10
+ */
11
+ $cron_schedule_table = Mage::getSingleton("core/resource")->getTableName("cron_schedule");
12
+ $installer->run("UPDATE {$cron_schedule_table} SET job_code='mailup_mailupsync' WHERE job_code='sevenlike_mailup'");
13
+
14
+ $this->endSetup();
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/etc/config.xml RENAMED
@@ -1,9 +1,9 @@
1
  <?xml version="1.0"?>
2
  <config>
3
  <modules>
4
- <SevenLike_MailUp>
5
- <version>2.6.1</version>
6
- </SevenLike_MailUp>
7
  </modules>
8
  <!-- frontend -->
9
  <frontend>
@@ -11,7 +11,7 @@
11
  <mailup>
12
  <use>standard</use>
13
  <args>
14
- <module>SevenLike_MailUp</module>
15
  <frontName>mailup</frontName>
16
  </args>
17
  </mailup>
@@ -20,7 +20,7 @@
20
  <modules>
21
  <mailup>
22
  <files>
23
- <default>SevenLike_MailUp.csv</default>
24
  </files>
25
  </mailup>
26
  </modules>
@@ -38,11 +38,11 @@
38
  <!-- models -->
39
  <models>
40
  <mailup>
41
- <class>SevenLike_MailUp_Model</class>
42
  <resourceModel>mailup_mysql4</resourceModel>
43
  </mailup>
44
  <mailup_mysql4>
45
- <class>SevenLike_MailUp_Model_Mysql4</class>
46
  <entities>
47
  <job>
48
  <table>mailup_sync_jobs</table>
@@ -58,26 +58,26 @@
58
  <!-- Override Subscriber so we can disable Notifiactions -->
59
  <newsletter>
60
  <rewrite>
61
- <subscriber>SevenLike_MailUp_Model_Subscriber</subscriber>
62
  </rewrite>
63
  </newsletter>
64
  </models>
65
  <!-- blocks -->
66
  <blocks>
67
  <mailup>
68
- <class>SevenLike_MailUp_Block</class>
69
  </mailup>
70
  </blocks>
71
  <helpers>
72
  <mailup>
73
- <class>SevenLike_MailUp_Helper</class>
74
  </mailup>
75
  </helpers>
76
  <!-- resources -->
77
  <resources>
78
  <mailup_setup>
79
  <setup>
80
- <module>SevenLike_MailUp</module>
81
  </setup>
82
  <connection>
83
  <use>core_setup</use>
@@ -100,25 +100,25 @@
100
  <observers>
101
  <mailup_observer>
102
  <type>singleton</type>
103
- <class>SevenLike_MailUp_Model_Observer</class>
104
  <method>beforeSave</method>
105
  </mailup_observer>
106
  </observers>
107
  </newsletter_subscriber_save_before>
108
  <newsletter_subscriber_save_after>
109
  <observers>
110
- <mailupinviautente_observer>
111
  <type>singleton</type>
112
- <class>SevenLike_MailUp_Model_Observer</class>
113
- <method>inviaUtente</method>
114
- </mailupinviautente_observer>
115
  </observers>
116
  </newsletter_subscriber_save_after>
117
  <customer_customer_authenticated>
118
  <observers>
119
  <mailupleggiutente_observer>
120
  <type>singleton</type>
121
- <class>SevenLike_MailUp_Model_Observer</class>
122
  <method>leggiUtente</method>
123
  </mailupleggiutente_observer>
124
  </observers>
@@ -127,7 +127,7 @@
127
  <observers>
128
  <mailupconfigsave_observer>
129
  <type>singleton</type>
130
- <class>SevenLike_MailUp_Model_Observer</class>
131
  <method>saveSystemConfig</method>
132
  </mailupconfigsave_observer>
133
  </observers>
@@ -136,7 +136,7 @@
136
  <observers>
137
  <mailupconfigtest_observer>
138
  <type>singleton</type>
139
- <class>SevenLike_MailUp_Model_Observer</class>
140
  <method>configCheck</method>
141
  </mailupconfigtest_observer>
142
  </observers>
@@ -145,25 +145,34 @@
145
  <observers>
146
  <mailup_subscribe_during_checkout>
147
  <type>singleton</type>
148
- <class>SevenLike_MailUp_Model_Observer</class>
149
- <method>subscribeDuringCheckout</method>
150
  </mailup_subscribe_during_checkout>
151
  </observers>
152
  </controller_action_postdispatch_checkout_onepage_saveOrder>
 
 
 
 
 
 
 
 
 
153
  <customer_save_after>
154
  <observers>
155
- <mailup_customer_save_after>
156
  <type>singleton</type>
157
- <class>SevenLike_MailUp_Model_Observer</class>
158
- <method>prepareCustomerForDataSync</method>
159
- </mailup_customer_save_after>
160
  </observers>
161
  </customer_save_after>
162
  <sales_order_save_after>
163
  <observers>
164
  <mailup_sales_order_save_after>
165
  <type>singleton</type>
166
- <class>SevenLike_MailUp_Model_Observer</class>
167
  <method>prepareOrderForDataSync</method>
168
  </mailup_sales_order_save_after>
169
  </observers>
@@ -176,7 +185,7 @@
176
  <mailup>
177
  <use>admin</use>
178
  <args>
179
- <module>SevenLike_MailUp</module>
180
  <frontName>mailup</frontName>
181
  </args>
182
  </mailup>
@@ -327,7 +336,7 @@
327
  <modules>
328
  <mailup>
329
  <files>
330
- <default>SevenLike_MailUp.csv</default>
331
  </files>
332
  </mailup>
333
  </modules>
@@ -344,19 +353,19 @@
344
  -->
345
 
346
  <!--
347
- <sevenlike_mailup_manualsync>
348
  <run><model>mailup/Cron::run</model></run>
349
- </sevenlike_mailup_manualsync>
350
  -->
351
 
352
- <sevenlike_mailup_autosync>
353
  <run><model>mailup/Cron::autoSync</model></run>
354
- </sevenlike_mailup_autosync>
355
 
356
- <sevenlike_mailup>
357
  <!--<schedule><cron_expr>*/15 * * * *</cron_expr></schedule>-->
358
  <run><model>mailup/Cron::run</model></run>
359
- </sevenlike_mailup>
360
  <!-- not in use? never implemented.. -->
361
  <mailup_connectionproblemsredo>
362
  <schedule><cron_expr>*/30 * * * *</cron_expr></schedule>
@@ -364,4 +373,4 @@
364
  </mailup_connectionproblemsredo>
365
  </jobs>
366
  </crontab>
367
- </config>
1
  <?xml version="1.0"?>
2
  <config>
3
  <modules>
4
+ <MailUp_MailUpSync>
5
+ <version>2.7.0</version>
6
+ </MailUp_MailUpSync>
7
  </modules>
8
  <!-- frontend -->
9
  <frontend>
11
  <mailup>
12
  <use>standard</use>
13
  <args>
14
+ <module>MailUp_MailUpSync</module>
15
  <frontName>mailup</frontName>
16
  </args>
17
  </mailup>
20
  <modules>
21
  <mailup>
22
  <files>
23
+ <default>MailUp_MailUpSync.csv</default>
24
  </files>
25
  </mailup>
26
  </modules>
38
  <!-- models -->
39
  <models>
40
  <mailup>
41
+ <class>MailUp_MailUpSync_Model</class>
42
  <resourceModel>mailup_mysql4</resourceModel>
43
  </mailup>
44
  <mailup_mysql4>
45
+ <class>MailUp_MailUpSync_Model_Mysql4</class>
46
  <entities>
47
  <job>
48
  <table>mailup_sync_jobs</table>
58
  <!-- Override Subscriber so we can disable Notifiactions -->
59
  <newsletter>
60
  <rewrite>
61
+ <subscriber>MailUp_MailUpSync_Model_Subscriber</subscriber>
62
  </rewrite>
63
  </newsletter>
64
  </models>
65
  <!-- blocks -->
66
  <blocks>
67
  <mailup>
68
+ <class>MailUp_MailUpSync_Block</class>
69
  </mailup>
70
  </blocks>
71
  <helpers>
72
  <mailup>
73
+ <class>MailUp_MailUpSync_Helper</class>
74
  </mailup>
75
  </helpers>
76
  <!-- resources -->
77
  <resources>
78
  <mailup_setup>
79
  <setup>
80
+ <module>MailUp_MailUpSync</module>
81
  </setup>
82
  <connection>
83
  <use>core_setup</use>
100
  <observers>
101
  <mailup_observer>
102
  <type>singleton</type>
103
+ <class>MailUp_MailUpSync_Model_Observer</class>
104
  <method>beforeSave</method>
105
  </mailup_observer>
106
  </observers>
107
  </newsletter_subscriber_save_before>
108
  <newsletter_subscriber_save_after>
109
  <observers>
110
+ <mailupsenduser_observer>
111
  <type>singleton</type>
112
+ <class>MailUp_MailUpSync_Model_Observer</class>
113
+ <method>sendUser</method>
114
+ </mailupsenduser_observer>
115
  </observers>
116
  </newsletter_subscriber_save_after>
117
  <customer_customer_authenticated>
118
  <observers>
119
  <mailupleggiutente_observer>
120
  <type>singleton</type>
121
+ <class>MailUp_MailUpSync_Model_Observer</class>
122
  <method>leggiUtente</method>
123
  </mailupleggiutente_observer>
124
  </observers>
127
  <observers>
128
  <mailupconfigsave_observer>
129
  <type>singleton</type>
130
+ <class>MailUp_MailUpSync_Model_Observer</class>
131
  <method>saveSystemConfig</method>
132
  </mailupconfigsave_observer>
133
  </observers>
136
  <observers>
137
  <mailupconfigtest_observer>
138
  <type>singleton</type>
139
+ <class>MailUp_MailUpSync_Model_Observer</class>
140
  <method>configCheck</method>
141
  </mailupconfigtest_observer>
142
  </observers>
145
  <observers>
146
  <mailup_subscribe_during_checkout>
147
  <type>singleton</type>
148
+ <class>MailUp_MailUpSync_Model_Observer</class>
149
+ <method>onCheckoutSaveOrder</method>
150
  </mailup_subscribe_during_checkout>
151
  </observers>
152
  </controller_action_postdispatch_checkout_onepage_saveOrder>
153
+ <controller_action_postdispatch_checkout_multishipping_saveOrder>
154
+ <observers>
155
+ <mailup_checkout_order_save>
156
+ <type>singleton</type>
157
+ <class>MailUp_MailUpSync_Model_Observer</class>
158
+ <method>onCheckoutSaveOrder</method>
159
+ </mailup_checkout_order_save>
160
+ </observers>
161
+ </controller_action_postdispatch_checkout_multishipping_saveOrder>
162
  <customer_save_after>
163
  <observers>
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>
171
  <sales_order_save_after>
172
  <observers>
173
  <mailup_sales_order_save_after>
174
  <type>singleton</type>
175
+ <class>MailUp_MailUpSync_Model_Observer</class>
176
  <method>prepareOrderForDataSync</method>
177
  </mailup_sales_order_save_after>
178
  </observers>
185
  <mailup>
186
  <use>admin</use>
187
  <args>
188
+ <module>MailUp_MailUpSync</module>
189
  <frontName>mailup</frontName>
190
  </args>
191
  </mailup>
336
  <modules>
337
  <mailup>
338
  <files>
339
+ <default>MailUp_MailUpSync.csv</default>
340
  </files>
341
  </mailup>
342
  </modules>
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
  <!--<schedule><cron_expr>*/15 * * * *</cron_expr></schedule>-->
367
  <run><model>mailup/Cron::run</model></run>
368
+ </MailUp_MailUpSync>
369
  <!-- not in use? never implemented.. -->
370
  <mailup_connectionproblemsredo>
371
  <schedule><cron_expr>*/30 * * * *</cron_expr></schedule>
373
  </mailup_connectionproblemsredo>
374
  </jobs>
375
  </crontab>
376
+ </config>
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/etc/system.xml RENAMED
@@ -14,16 +14,16 @@
14
  <mailup_newsletter>
15
  <class>mailup-tab</class>
16
  <!--<header_css>internetware-tab</header_css>-->
17
- <label><![CDATA[Settings & Field Mapping]]></label>
18
- <tab>mailup_tab</tab>
19
- <frontend_type>text</frontend_type>
20
- <sort_order>99999</sort_order>
21
- <show_in_default>1</show_in_default>
22
- <show_in_website>1</show_in_website>
23
- <show_in_store>1</show_in_store>
24
-
25
  <groups>
26
- <!-- main config section -->
27
  <mailup translate="label">
28
  <label>MailUp Extension Settings</label>
29
  <frontend_type>text</frontend_type>
@@ -32,7 +32,7 @@
32
  <show_in_website>1</show_in_website>
33
  <show_in_store>1</show_in_store>
34
  <fields>
35
- <url_console translate="comment">
36
  <label>Admin Console URL</label>
37
  <frontend_type>text</frontend_type>
38
  <sort_order>10</sort_order>
@@ -42,7 +42,7 @@
42
  <comment>It's the domain portion of the URL to your MailUp Admin console (e.g. g4a0.s03.it)</comment>
43
  <backend_model>mailup/consoleurlvalidator</backend_model>
44
  </url_console>
45
- <username_ws translate="comment">
46
  <label>Web Service Username</label>
47
  <frontend_type>text</frontend_type>
48
  <sort_order>20</sort_order>
@@ -51,7 +51,7 @@
51
  <show_in_store>1</show_in_store>
52
  <backend_model>mailup/webserviceusernamevalidator</backend_model>
53
  </username_ws>
54
- <password_ws translate="comment">
55
  <label>Web Service Password</label>
56
  <frontend_type>password</frontend_type>
57
  <sort_order>40</sort_order>
@@ -60,15 +60,34 @@
60
  <show_in_store>1</show_in_store>
61
  <comment>For assistance visit http://help.mailup.com/x/PgAy</comment>
62
  </password_ws>
63
- <list translate="label comment">
 
 
 
 
 
 
 
 
 
64
  <label>List</label>
65
  <frontend_type>select</frontend_type>
66
- <source_model>mailup/lists</source_model>
67
  <sort_order>60</sort_order>
68
  <show_in_default>1</show_in_default>
69
  <show_in_website>1</show_in_website>
70
  <show_in_store>1</show_in_store>
71
  </list>
 
 
 
 
 
 
 
 
 
 
72
  <enable_subscribe_in_checkout tranlate="label comment">
73
  <label>Enable subscription checkbox during checkout</label>
74
  <frontend_type>select</frontend_type>
@@ -88,6 +107,16 @@
88
  <show_in_store>1</show_in_store>
89
  <comment>Defines whether double opt-in is required</comment>
90
  </require_subscription_confirmation>
 
 
 
 
 
 
 
 
 
 
91
  <enable_cron_export tranlate="label comment">
92
  <label>Enable Automatic Data Export to MailUp</label>
93
  <frontend_type>select</frontend_type>
@@ -97,6 +126,16 @@
97
  <show_in_website>1</show_in_website>
98
  <show_in_store>1</show_in_store>
99
  </enable_cron_export>
 
 
 
 
 
 
 
 
 
 
100
  <server_timezone translate="label comment">
101
  <label>Server Timezone</label>
102
  <frontend_type>label</frontend_type>
@@ -143,29 +182,9 @@
143
  <show_in_website>1</show_in_website>
144
  <show_in_store>1</show_in_store>
145
  </enable_log>
146
- <disablenewslettersuccesses translate="label">
147
- <label>Disable Newsletter Subscription Notification</label>
148
- <frontend_type>select</frontend_type>
149
- <source_model>adminhtml/system_config_source_yesno</source_model>
150
- <sort_order>120</sort_order>
151
- <show_in_default>1</show_in_default>
152
- <show_in_website>1</show_in_website>
153
- <show_in_store>1</show_in_store>
154
- <comment>Disables the default notification sent by Magento</comment>
155
- </disablenewslettersuccesses>
156
- <qualifying_order_statuses>
157
- <label>Order Statuses to Match For Customer Totals</label>
158
- <frontend_type>multiselect</frontend_type>
159
- <source_model>adminhtml/system_config_source_order_status</source_model>
160
- <sort_order>130</sort_order>
161
- <show_in_default>1</show_in_default>
162
- <show_in_website>1</show_in_website>
163
- <show_in_store>1</show_in_store>
164
- <comment>If none set, those that are complete, closed or processing will be matched</comment>
165
- </qualifying_order_statuses>
166
  </fields>
167
  </mailup>
168
- <!-- mapping section -->
169
  <mailup_mapping translate="label">
170
  <label>MailUp Field Mapping</label>
171
  <frontend_type>text</frontend_type>
14
  <mailup_newsletter>
15
  <class>mailup-tab</class>
16
  <!--<header_css>internetware-tab</header_css>-->
17
+ <label><![CDATA[Settings & Field Mapping]]></label>
18
+ <tab>mailup_tab</tab>
19
+ <frontend_type>text</frontend_type>
20
+ <sort_order>99999</sort_order>
21
+ <show_in_default>1</show_in_default>
22
+ <show_in_website>1</show_in_website>
23
+ <show_in_store>1</show_in_store>
24
+
25
  <groups>
26
+ <!-- main config section -->
27
  <mailup translate="label">
28
  <label>MailUp Extension Settings</label>
29
  <frontend_type>text</frontend_type>
32
  <show_in_website>1</show_in_website>
33
  <show_in_store>1</show_in_store>
34
  <fields>
35
+ <url_console translate="label comment">
36
  <label>Admin Console URL</label>
37
  <frontend_type>text</frontend_type>
38
  <sort_order>10</sort_order>
42
  <comment>It's the domain portion of the URL to your MailUp Admin console (e.g. g4a0.s03.it)</comment>
43
  <backend_model>mailup/consoleurlvalidator</backend_model>
44
  </url_console>
45
+ <username_ws translate="label comment">
46
  <label>Web Service Username</label>
47
  <frontend_type>text</frontend_type>
48
  <sort_order>20</sort_order>
51
  <show_in_store>1</show_in_store>
52
  <backend_model>mailup/webserviceusernamevalidator</backend_model>
53
  </username_ws>
54
+ <password_ws translate="label comment">
55
  <label>Web Service Password</label>
56
  <frontend_type>password</frontend_type>
57
  <sort_order>40</sort_order>
60
  <show_in_store>1</show_in_store>
61
  <comment>For assistance visit http://help.mailup.com/x/PgAy</comment>
62
  </password_ws>
63
+ <check translate="label">
64
+ <label>Test Connection</label>
65
+ <frontend_type>button</frontend_type>
66
+ <frontend_model>mailup/adminhtml_system_config_form_testbutton</frontend_model>
67
+ <sort_order>50</sort_order>
68
+ <show_in_default>1</show_in_default>
69
+ <show_in_website>1</show_in_website>
70
+ <show_in_store>1</show_in_store>
71
+ </check>
72
+ <list translate="label">
73
  <label>List</label>
74
  <frontend_type>select</frontend_type>
75
+ <source_model>mailup/source_lists</source_model>
76
  <sort_order>60</sort_order>
77
  <show_in_default>1</show_in_default>
78
  <show_in_website>1</show_in_website>
79
  <show_in_store>1</show_in_store>
80
  </list>
81
+ <default_group translate="label comment">
82
+ <label>Default Group</label>
83
+ <frontend_type>select</frontend_type>
84
+ <source_model>mailup/source_groups</source_model>
85
+ <sort_order>65</sort_order>
86
+ <show_in_default>1</show_in_default>
87
+ <show_in_website>1</show_in_website>
88
+ <show_in_store>1</show_in_store>
89
+ <comment>Used as default group in all subscriptions that do not have a manual group set</comment>
90
+ </default_group>
91
  <enable_subscribe_in_checkout tranlate="label comment">
92
  <label>Enable subscription checkbox during checkout</label>
93
  <frontend_type>select</frontend_type>
107
  <show_in_store>1</show_in_store>
108
  <comment>Defines whether double opt-in is required</comment>
109
  </require_subscription_confirmation>
110
+ <disablenewslettersuccesses translate="label">
111
+ <label>Disable Magento Newsletter Subscription Notification</label>
112
+ <frontend_type>select</frontend_type>
113
+ <source_model>adminhtml/system_config_source_yesno</source_model>
114
+ <sort_order>78</sort_order>
115
+ <show_in_default>1</show_in_default>
116
+ <show_in_website>1</show_in_website>
117
+ <show_in_store>1</show_in_store>
118
+ <comment>Disables the default notification sent by Magento if set to "Yes"</comment>
119
+ </disablenewslettersuccesses>
120
  <enable_cron_export tranlate="label comment">
121
  <label>Enable Automatic Data Export to MailUp</label>
122
  <frontend_type>select</frontend_type>
126
  <show_in_website>1</show_in_website>
127
  <show_in_store>1</show_in_store>
128
  </enable_cron_export>
129
+ <qualifying_order_statuses>
130
+ <label>Order Statuses to Match For Customer Totals</label>
131
+ <frontend_type>multiselect</frontend_type>
132
+ <source_model>adminhtml/system_config_source_order_status</source_model>
133
+ <sort_order>83</sort_order>
134
+ <show_in_default>1</show_in_default>
135
+ <show_in_website>1</show_in_website>
136
+ <show_in_store>1</show_in_store>
137
+ <comment>If none set, those that are complete, closed or processing will be matched</comment>
138
+ </qualifying_order_statuses>
139
  <server_timezone translate="label comment">
140
  <label>Server Timezone</label>
141
  <frontend_type>label</frontend_type>
182
  <show_in_website>1</show_in_website>
183
  <show_in_store>1</show_in_store>
184
  </enable_log>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  </fields>
186
  </mailup>
187
+ <!-- mapping section -->
188
  <mailup_mapping translate="label">
189
  <label>MailUp Field Mapping</label>
190
  <frontend_type>text</frontend_type>
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-install-0.1.0.php RENAMED
File without changes
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-install-2.3.0.php RENAMED
File without changes
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-install-2.4.0.php RENAMED
File without changes
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-0.1.0-1.0.0.php RENAMED
File without changes
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-0.3.0-1.0.0.php RENAMED
File without changes
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-1.0.0-1.5.2.php RENAMED
File without changes
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-2.1.3-2.2.0.php RENAMED
File without changes
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-2.2.0-2.3.0.php RENAMED
File without changes
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-2.2.1-2.3.0.php RENAMED
File without changes
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-2.3.0-2.3.1.php RENAMED
File without changes
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-2.3.1-2.3.2.php RENAMED
File without changes
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-2.3.2-2.4.0.php RENAMED
File without changes
app/code/local/{SevenLike/MailUp → MailUp/MailUpSync}/sql/mailup_setup/mysql4-upgrade-2.4.0-2.4.1.php RENAMED
File without changes
app/code/local/MailUp/MailUpSync/sql/mailup_setup/mysql4-upgrade-2.6.1-2.7.0.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Install
4
+ */
5
+ $installer = $this;
6
+ $this->startSetup();
7
+
8
+ /**
9
+ * Alter jobs Table - add column for message_id
10
+ */
11
+ $installer->run("
12
+ ALTER TABLE {$installer->getTable('mailup/job')}
13
+ ADD COLUMN `message_id` int AFTER `as_pending`
14
+ ");
15
+
16
+ $this->endSetup();
app/code/local/SevenLike/MailUp/Model/Mysql4/Job/Collection.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- /**
3
- * Collection.php
4
- */
5
- class SevenLike_MailUp_Model_Mysql4_Job_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
6
- {
7
- public function _construct()
8
- {
9
- $this->_init("mailup/job");
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
app/code/local/SevenLike/MailUp/controllers/Adminhtml/ConfigurationController.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- require_once dirname(__FILE__) . "/../../Model/MailUpWsImport.php";
4
- require_once dirname(__FILE__) . "/../../Model/Wssend.php";
5
- class SevenLike_MailUp_Adminhtml_ConfigurationController extends Mage_Adminhtml_Controller_Action
6
- {
7
- public function indexAction()
8
- {
9
- $url = Mage::getModel('adminhtml/url');
10
- $url = $url->getUrl("adminhtml/system_config/edit", array(
11
- "section" => "mailup_newsletter"
12
- ));
13
- Mage::app()->getResponse()->setRedirect($url);
14
- }
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/SevenLike/MailUp/controllers/Adminhtml/MailupbackendController.php DELETED
@@ -1,220 +0,0 @@
1
- <?php
2
- class SevenLike_MailUp_Adminhtml_MailupbackendController extends Mage_Adminhtml_Controller_Action
3
- {
4
- /**
5
- * Default Action
6
- */
7
- public function indexAction()
8
- {
9
- $this->loadLayout();
10
- $this->_title($this->__("MailUp Jobs"));
11
- $this->renderLayout();
12
- }
13
-
14
- /**
15
- * Run The Job
16
- */
17
- public function runjobAction()
18
- {
19
- /** @var $session Mage_Admin_Model_Session */
20
- $session = Mage::getSingleton('adminhtml/session');
21
- $id = $this->getRequest()->getParam('id');
22
-
23
- if( ! $id) {
24
- $session->addError(
25
- Mage::helper('mailup')->__('Invalid Entity')
26
- );
27
- }
28
-
29
- $entity = Mage::getModel('mailup/job')->load($id);
30
- if($entity) {
31
- Mage::helper('mailup')->runJob($entity->getId());
32
- }
33
-
34
- $session->addSuccess(
35
- Mage::helper('mailup')->__("Run Job [{$entity->getId()}]")
36
- );
37
-
38
- $this->_redirect('*/*/index');
39
- }
40
-
41
- /**
42
- * Delete a job
43
- */
44
- public function deleteAction()
45
- {
46
- /** @var $session Mage_Admin_Model_Session */
47
- $session = Mage::getSingleton('adminhtml/session');
48
- $id = $this->getRequest()->getParam('id');
49
-
50
- if( ! $id) {
51
- $session->addError(
52
- Mage::helper('mailup')->__('Invalid Entity')
53
- );
54
- }
55
-
56
- $entity = Mage::getModel('mailup/job')->load($id);
57
- $entity->delete();
58
-
59
- $session->addSuccess(
60
- Mage::helper('mailup')->__("Job [{$entity->getId()}] [Deleted]")
61
- );
62
-
63
- $this->_redirect('*/*/index');
64
- }
65
-
66
- /**
67
- * Start the process, if we've already run NewImportProcess
68
- * and we have a process ID we can Start it.
69
- */
70
- public function startProcessAction()
71
- {
72
- /** @var $session Mage_Admin_Model_Session */
73
- $session = Mage::getSingleton('adminhtml/session');
74
- $id = $this->getRequest()->getParam('id');
75
-
76
- if( ! $id) {
77
- $session->addError(
78
- Mage::helper('mailup')->__('Invalid Entity')
79
- );
80
- }
81
-
82
- $job = Mage::getModel('mailup/job')->load($id);
83
- /* @var $job SevenLike_MailUp_Model_Job */
84
-
85
- if( ! $job->getProcessId()) {
86
- $session->addError(
87
- Mage::helper('mailup')->__("Can't Run, There's no Process ID [{$job->getId()}]")
88
- );
89
- $this->_redirect('*/*/index');
90
- return;
91
- }
92
- require_once dirname(__FILE__) . "/../../Model/MailUpWsImport.php";
93
- require_once dirname(__FILE__) . "/../../Model/Wssend.php";
94
-
95
- $wsSend = new MailUpWsSend($job->getStoreId());
96
- $wsImport = new MailUpWsImport($job->getStoreId());
97
- $accessKey = $wsSend->loginFromId();
98
-
99
- //StartProcess(int idList, int listGUID, int idProcess)
100
- /*$return = (string)$wsImport->startProcess(array(
101
- 'idList' => $job->getListid(),
102
- 'listGUID' => $job->getListGuid(),
103
- 'idProcess' => $job->getProcessId()
104
- ));
105
-
106
- $session->addSuccess(
107
- Mage::helper('mailup')->__("Job Processed [{$job->getId()}] [{$return}]")
108
- );*/
109
-
110
- $session->addSuccess(
111
- Mage::helper('mailup')->__("Start Process [DISABLED]")
112
- );
113
-
114
- $this->_redirect('*/*/index');
115
- }
116
-
117
- /**
118
- * Start the process, if we've already run NewImportProcess
119
- * and we have a process ID we can Start it.
120
- */
121
- public function getProcessDetailAction()
122
- {
123
- /** @var $session Mage_Admin_Model_Session */
124
- $session = Mage::getSingleton('adminhtml/session');
125
- $id = $this->getRequest()->getParam('id');
126
-
127
- if( ! $id) {
128
- $session->addError(
129
- Mage::helper('mailup')->__('Invalid Entity')
130
- );
131
- }
132
-
133
- $job = Mage::getModel('mailup/job')->load($id);
134
- /* @var $job SevenLike_MailUp_Model_Job */
135
-
136
- if( ! $job->getProcessId()) {
137
- $session->addError(
138
- Mage::helper('mailup')->__("Can't Run, There's no Process ID [{$job->getId()}]")
139
- );
140
- $this->_redirect('*/*/index');
141
- return;
142
- }
143
- require_once dirname(__FILE__) . "/../../Model/MailUpWsImport.php";
144
- require_once dirname(__FILE__) . "/../../Model/Wssend.php";
145
-
146
- $wsSend = new MailUpWsSend($job->getStoreId());
147
- $wsImport = new MailUpWsImport($job->getStoreId());
148
- $accessKey = $wsSend->loginFromId();
149
-
150
- //StartProcess(int idList, int listGUID, int idProcess)
151
- /*$return = $wsImport->getProcessDetail(array(
152
- 'idList' => $job->getListid(),
153
- 'listGUID' => $job->getListGuid(),
154
- 'idProcess' => $job->getProcessId()
155
- ));
156
-
157
- $session->addSuccess(
158
- Mage::helper('mailup')->__("Process Detail [{$job->getId()}] [{$return}]")
159
- );*/
160
-
161
- $session->addSuccess(
162
- Mage::helper('mailup')->__("Process Detail [DISABLED]")
163
- );
164
-
165
- $this->_redirect('*/*/index');
166
- }
167
-
168
- /**
169
- * Get a list of processes we've added using NewImportProcess.
170
- * We want to get a list and then go over them Starting each one, one at a time
171
- * use
172
- * StartProcess.
173
- */
174
- public function getCurrentProcessesAction()
175
- {
176
- /** @var $session Mage_Admin_Model_Session */
177
- $session = Mage::getSingleton('adminhtml/session');
178
- $id = $this->getRequest()->getParam('id');
179
-
180
- if( ! $id) {
181
- $session->addError(
182
- Mage::helper('mailup')->__('Invalid Entity')
183
- );
184
- }
185
-
186
- $job = Mage::getModel('mailup/job')->load($id);
187
- /* @var $job SevenLike_MailUp_Model_Job */
188
-
189
- if( ! $job->getProcessId()) {
190
- $session->addError(
191
- Mage::helper('mailup')->__("Can't Run, There's no Process ID [{$job->getId()}]")
192
- );
193
- $this->_redirect('*/*/index');
194
- return;
195
- }
196
- require_once dirname(__FILE__) . "/../../Model/MailUpWsImport.php";
197
- require_once dirname(__FILE__) . "/../../Model/Wssend.php";
198
-
199
- /*$wsSend = new MailUpWsSend($job->getStoreId());
200
- $wsImport = new MailUpWsImport($job->getStoreId());
201
- $accessKey = $wsSend->loginFromId();
202
-
203
- //StartProcess(int idList, int listGUID, int idProcess)
204
- $return = $wsImport->getProcessDetail(array(
205
- 'idList' => $job->getListid(),
206
- 'listGUID' => $job->getListGuid(),
207
- 'idProcess' => $job->getProcessId()
208
- ));*/
209
-
210
- /*$session->addSuccess(
211
- Mage::helper('mailup')->__("Process Detail [{$job->getId()}] [{$return}]")
212
- );*/
213
-
214
- $session->addSuccess(
215
- Mage::helper('mailup')->__("Process Detail [DISABLED]")
216
- );
217
-
218
- $this->_redirect('*/*/index');
219
- }
220
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/layout/mailup.xml CHANGED
@@ -24,57 +24,67 @@
24
  <mailup_adminhtml_filter_index>
25
  <update handle="mailup_adminhtml_index"/>
26
  <reference name="content">
27
- <block type="mailup/filters" name="filter" template="sevenlike/mailup/filter.phtml"/>
28
  </reference>
29
  <reference name="head">
30
- <action method="addCss"><stylesheet>sevenlike/mailup/mailup.css</stylesheet></action>
31
  </reference>
32
  </mailup_adminhtml_filter_index>
33
 
34
  <mailup_adminhtml_filter_confirm>
35
  <update handle="mailup_adminhtml_confirm"/>
36
  <reference name="content">
37
- <block type="adminhtml/template" name="filter" template="sevenlike/mailup/confirm.phtml"/>
38
  </reference>
39
  <reference name="head">
40
- <action method="addCss"><stylesheet>sevenlike/mailup/mailup.css</stylesheet></action>
41
  </reference>
42
  </mailup_adminhtml_filter_confirm>
43
 
44
  <mailup_adminhtml_fieldsmapping_index>
45
  <update handle="mailup_adminhtml_index" />
46
  <reference name="content">
47
- <block type="adminhtml/template" name="fieldsmapping" template="sevenlike/mailup/fieldsmapping.phtml" />
48
  </reference>
49
  <reference name="head">
50
- <action method="addCss"><stylesheet>sevenlike/mailup/mailup.css</stylesheet></action>
51
  </reference>
52
  </mailup_adminhtml_fieldsmapping_index>
53
 
54
  <mailup_adminhtml_viewdatatransferlog_index>
55
  <update handle="mailup_adminhtml_index" />
56
  <reference name="content">
57
- <block type="adminhtml/template" name="viewdatatransferlog" template="sevenlike/mailup/viewdatatransferlog.phtml" />
58
  </reference>
59
  <reference name="head">
60
- <action method="addCss"><stylesheet>sevenlike/mailup/mailup.css</stylesheet></action>
61
  </reference>
62
  </mailup_adminhtml_viewdatatransferlog_index>
63
 
64
  <mailup_adminhtml_viewdatatransferlog_search>
65
  <update handle="mailup_adminhtml_index" />
66
  <reference name="content">
67
- <block type="adminhtml/template" name="viewdatatransferlog" template="sevenlike/mailup/viewdatatransferlog.phtml" />
68
  </reference>
69
  <reference name="head">
70
- <action method="addCss"><stylesheet>sevenlike/mailup/mailup.css</stylesheet></action>
71
  </reference>
72
  </mailup_adminhtml_viewdatatransferlog_search>
 
 
 
 
 
 
 
 
 
 
73
 
74
  <!-- works but need a better image.. -->
75
  <!--<default>
76
  <reference name="head">
77
- <action method="addCss"><stylesheet>sevenlike/mailup/mailup.css</stylesheet></action>
78
  </reference>
79
  </default>-->
80
 
24
  <mailup_adminhtml_filter_index>
25
  <update handle="mailup_adminhtml_index"/>
26
  <reference name="content">
27
+ <block type="mailup/filters" name="filter" template="mailup/mailupsync/filter.phtml"/>
28
  </reference>
29
  <reference name="head">
30
+ <action method="addCss"><stylesheet>mailup/mailupsync/mailup.css</stylesheet></action>
31
  </reference>
32
  </mailup_adminhtml_filter_index>
33
 
34
  <mailup_adminhtml_filter_confirm>
35
  <update handle="mailup_adminhtml_confirm"/>
36
  <reference name="content">
37
+ <block type="adminhtml/template" name="filter" template="mailup/mailupsync/confirm.phtml"/>
38
  </reference>
39
  <reference name="head">
40
+ <action method="addCss"><stylesheet>mailup/mailupsync/mailup.css</stylesheet></action>
41
  </reference>
42
  </mailup_adminhtml_filter_confirm>
43
 
44
  <mailup_adminhtml_fieldsmapping_index>
45
  <update handle="mailup_adminhtml_index" />
46
  <reference name="content">
47
+ <block type="adminhtml/template" name="fieldsmapping" template="mailup/mailupsync/fieldsmapping.phtml" />
48
  </reference>
49
  <reference name="head">
50
+ <action method="addCss"><stylesheet>mailup/mailupsync/mailup.css</stylesheet></action>
51
  </reference>
52
  </mailup_adminhtml_fieldsmapping_index>
53
 
54
  <mailup_adminhtml_viewdatatransferlog_index>
55
  <update handle="mailup_adminhtml_index" />
56
  <reference name="content">
57
+ <block type="adminhtml/template" name="viewdatatransferlog" template="mailup/mailupsync/viewdatatransferlog.phtml" />
58
  </reference>
59
  <reference name="head">
60
+ <action method="addCss"><stylesheet>mailup/mailupsync/mailup.css</stylesheet></action>
61
  </reference>
62
  </mailup_adminhtml_viewdatatransferlog_index>
63
 
64
  <mailup_adminhtml_viewdatatransferlog_search>
65
  <update handle="mailup_adminhtml_index" />
66
  <reference name="content">
67
+ <block type="adminhtml/template" name="viewdatatransferlog" template="mailup/mailupsync/viewdatatransferlog.phtml" />
68
  </reference>
69
  <reference name="head">
70
+ <action method="addCss"><stylesheet>mailup/mailupsync/mailup.css</stylesheet></action>
71
  </reference>
72
  </mailup_adminhtml_viewdatatransferlog_search>
73
+
74
+ <adminhtml_system_config_edit>
75
+ <reference name="head">
76
+ <action method="addJs"><stylesheet>mailup/admin.js</stylesheet></action>
77
+ </reference>
78
+ <reference name="content">
79
+ <block type="adminhtml/template" name="mailupsysconfigjavascript" template="mailup/mailupsync/sysconfigjavascript.phtml" />
80
+ </reference>
81
+ </adminhtml_system_config_edit>
82
+
83
 
84
  <!-- works but need a better image.. -->
85
  <!--<default>
86
  <reference name="head">
87
+ <action method="addCss"><stylesheet>mailup/mailupsync/mailup.css</stylesheet></action>
88
  </reference>
89
  </default>-->
90
 
app/design/adminhtml/default/default/template/{sevenlike/mailup → mailup/mailupsync}/confirm.phtml RENAMED
@@ -72,7 +72,7 @@ $xml = simplexml_load_string($xmlLists);
72
  <td class="a-right">
73
  <div id="mailuploading" class="mailuploading"><?php echo $this->__("Please wait for the next step to load") ?></div>
74
  <button id="mailupback" onclick="back_form.submit()" class="scalable back" type="button"><span><?php echo $this->__('Reset filters')?></span></button>
75
- <button onclick="$$('.content-header-floating').invoke('setStyle', {visibility:'hidden'});document.getElementById('mailupsend').style.display='none';document.getElementById('mailupback').style.display='none';document.getElementById('mailuploading').style.display='block';editForm.submit()"
76
  class="scalable save" type="button" id="mailupsend">
77
  <span><?php echo $this->__('Send to MailUp')?></span>
78
  </button>
@@ -146,8 +146,14 @@ $xml = simplexml_load_string($xmlLists);
146
  }
147
  }
148
  @asort($groups);
 
149
  foreach ($groups as $tmpid=>$tmpname) {
150
- echo '<option value="'.$tmpid.'">'.htmlspecialchars($tmpname).'</option>';
 
 
 
 
 
151
  }
152
  ?>
153
  </select>
@@ -184,7 +190,22 @@ $xml = simplexml_load_string($xmlLists);
184
  </tr>
185
  <tr>
186
  <td>
187
- <input type="checkbox" name="send_optin_email_to_new_subscribers" value="1"<?php if($listId == Mage::getStoreConfig('mailup_newsletter/mailup/require_subscription_confirmation', $storeId)): ?> checked="checked" <?php endif ?> /> <?php echo $this->__('Send opt-in email to new subscribers') ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  </td>
189
  </tr>
190
  </table>
@@ -195,4 +216,22 @@ $xml = simplexml_load_string($xmlLists);
195
  </div>
196
  <script type="text/javascript">
197
  var editForm = new varienForm('edit_form');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  </script>
72
  <td class="a-right">
73
  <div id="mailuploading" class="mailuploading"><?php echo $this->__("Please wait for the next step to load") ?></div>
74
  <button id="mailupback" onclick="back_form.submit()" class="scalable back" type="button"><span><?php echo $this->__('Reset filters')?></span></button>
75
+ <button onclick="if (!editForm.validate()){return false;} $$('.content-header-floating').invoke('setStyle', {visibility:'hidden'});document.getElementById('mailupsend').style.display='none';document.getElementById('mailupback').style.display='none';document.getElementById('mailuploading').style.display='block';editForm.submit()"
76
  class="scalable save" type="button" id="mailupsend">
77
  <span><?php echo $this->__('Send to MailUp')?></span>
78
  </button>
146
  }
147
  }
148
  @asort($groups);
149
+ $defaultGroupId = Mage::getStoreConfig('mailup_newsletter/mailup/default_group');
150
  foreach ($groups as $tmpid=>$tmpname) {
151
+ echo '<option value="'.$tmpid.'"';
152
+ // If there is a default group set in config, pre-select this
153
+ if ($tmpid == $defaultGroupId) {
154
+ echo ' selected="selected"';
155
+ }
156
+ echo '>'.htmlspecialchars($tmpname).'</option>';
157
  }
158
  ?>
159
  </select>
190
  </tr>
191
  <tr>
192
  <td>
193
+ <input type="checkbox" name="send_optin_email_to_new_subscribers" id="send_optin" value="1"<?php if($listId == Mage::getStoreConfig('mailup_newsletter/mailup/require_subscription_confirmation', $storeId)): ?> checked="checked" <?php endif ?> /> <label for="send_optin" ><?php echo $this->__('Send opt-in email to new subscribers') ?></label>
194
+ </td>
195
+ </tr>
196
+ <tr>
197
+ <td>
198
+ <label id="message_id_label" class="istrz1" for="message_id"><?php echo $this->__('Message ID (optional)'); ?></label>
199
+ </td>
200
+ </tr>
201
+ <tr>
202
+ <td>
203
+ <input type="text" name="message_id" id="message_id" size="60" class="inptptx2 validate-digits" />
204
+ </td>
205
+ </tr>
206
+ <tr>
207
+ <td>
208
+ <p><a href="http://help.mailup.com/x/PYMd"><?php echo $this->__('See the documentation for details') ?></a></p>
209
  </td>
210
  </tr>
211
  </table>
216
  </div>
217
  <script type="text/javascript">
218
  var editForm = new varienForm('edit_form');
219
+
220
+ // Show/hide Message ID option box
221
+ var optin = $('send_optin');
222
+ displayIfSelected($('message_id'), optin);
223
+ displayIfSelected($('message_id_label'), optin);
224
+
225
+ optin.addEventListener('change', function(){
226
+ displayIfSelected($('message_id'), optin);
227
+ displayIfSelected($('message_id_label'), optin);
228
+ });
229
+
230
+ function displayIfSelected(toShow, ifSelected) {
231
+ if (ifSelected.checked) {
232
+ toShow.show();
233
+ } else {
234
+ toShow.hide();
235
+ }
236
+ }
237
  </script>
app/design/adminhtml/default/default/template/{sevenlike/mailup → mailup/mailupsync}/fieldsmapping.phtml RENAMED
File without changes
app/design/adminhtml/default/default/template/{sevenlike/mailup → mailup/mailupsync}/filter.phtml RENAMED
@@ -113,10 +113,10 @@ if ($accessKey === false || strlen(Mage::getStoreConfig('mailup_newsletter/mailu
113
  <strong><?php echo $this->__('Sold products')?></strong>
114
  </td>
115
  </tr>
116
- <?php //imposto il filtro per clienti: 0 = tutti, 1 = che hanno acquistato, 2 = che non hanno mai acquistato ?>
117
  <tr>
118
  <td class="input-ele spdnpg1">
119
- <input type="radio" name="mailupCustomers" id="mailupCustomersAll" value="0" <?php if (isset($mailupCustomers) && $mailupCustomers == 0) { echo 'checked="checked"'; } ?>
120
  onclick="customerDependentFilters(false);" />&nbsp;<label for="mailupCustomersAll"><?php echo $this->__('All customers')?></label>
121
  </td>
122
 
@@ -136,13 +136,17 @@ if ($accessKey === false || strlen(Mage::getStoreConfig('mailup_newsletter/mailu
136
  </td>
137
  </tr>
138
  <tr>
 
 
 
 
139
  <td>
140
  <input type="radio" name="mailupSubscribed" id="mailupSubscribedOptIn"
141
  value="1" <?php if (isset($mailupSubscribed) && $mailupSubscribed == 1) { echo 'checked="checked"'; } ?> />&nbsp;<label for="mailupSubscribedOptIn"><?php echo $this->__("Opted-in Only"); ?></label>
142
  </td>
143
- <td colspan="2">
144
- <input type="radio" name="mailupSubscribed" id="mailupSubscribedAllCustomers"
145
- value="0" <?php if (isset($mailupCustomers) && $mailupCustomers == 0) { echo 'checked="checked"'; } ?> />&nbsp;<label for="mailupSubscribedAllCustomers"><?php echo $this->__("All customers")?></label>
146
  </td>
147
  </tr>
148
  </table>
113
  <strong><?php echo $this->__('Sold products')?></strong>
114
  </td>
115
  </tr>
116
+ <?php // Customer filter : 0 = all , 1 = who bought , 2 = who have never purchased ?>
117
  <tr>
118
  <td class="input-ele spdnpg1">
119
+ <input type="radio" name="mailupCustomers" id="mailupCustomersAll" value="0" <?php if (!isset($mailupCustomers) || (isset($mailupCustomers) && $mailupCustomers == 0)) { echo 'checked="checked"'; } ?>
120
  onclick="customerDependentFilters(false);" />&nbsp;<label for="mailupCustomersAll"><?php echo $this->__('All customers')?></label>
121
  </td>
122
 
136
  </td>
137
  </tr>
138
  <tr>
139
+ <td>
140
+ <input type="radio" name="mailupSubscribed" id="mailupSubscribedAllCustomers"
141
+ value="0" <?php if (!isset($mailupSubscribed) || (isset($mailupSubscribed) && $mailupSubscribed == 0)) { echo 'checked="checked"'; } ?> />&nbsp;<label for="mailupSubscribedAllCustomers"><?php echo $this->__("All customers")?></label>
142
+ </td>
143
  <td>
144
  <input type="radio" name="mailupSubscribed" id="mailupSubscribedOptIn"
145
  value="1" <?php if (isset($mailupSubscribed) && $mailupSubscribed == 1) { echo 'checked="checked"'; } ?> />&nbsp;<label for="mailupSubscribedOptIn"><?php echo $this->__("Opted-in Only"); ?></label>
146
  </td>
147
+ <td>
148
+ <input type="radio" name="mailupSubscribed" id="mailupSubscribedNonOptIn"
149
+ value="2" <?php if (isset($mailupSubscribed) && $mailupSubscribed == 2) { echo 'checked="checked"'; } ?> />&nbsp;<label for="mailupSubscribedNonOptIn"><?php echo $this->__("Non Opted-in Only"); ?></label>
150
  </td>
151
  </tr>
152
  </table>
app/design/adminhtml/default/default/template/mailup/mailupsync/sysconfigjavascript.phtml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is solely to instantiate the javascript in system config with values that can only be generated via php
4
+ */
5
+ ?>
6
+ <script language="JavaScript">
7
+ // Initialise observer so that when list is changed, groups are reloaded
8
+ urlList = '<?php echo Mage::getModel('adminhtml/url')->getUrl("mailup/adminhtml_configuration/getgroups"); ?>';
9
+ document.observe("dom:loaded", function() {
10
+ initListObserver(urlList);
11
+ });
12
+ // Initialise observer to run self-test
13
+ urlTest = '<?php echo Mage::getModel('adminhtml/url')->getUrl("mailup/adminhtml_configuration/testconnection"); ?>';
14
+ document.observe("dom:loaded", function() {
15
+ initSelfTestObserver(urlTest);
16
+ });
17
+ </script>
app/design/adminhtml/default/default/template/{sevenlike/mailup → mailup/mailupsync}/viewdatatransferlog.phtml RENAMED
File without changes
app/design/frontend/base/default/layout/mailup.xml CHANGED
File without changes
app/design/frontend/base/default/template/mailup/customer/account/dashboard/info.phtml CHANGED
@@ -28,7 +28,7 @@
28
  case Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED:
29
  echo $this->__('You are currently subscribed to "General Subscription"'); break;
30
  case Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED:
31
- echo $this->__('Check your email to confirm your subscription to our newsletter.'); break;
32
  default:
33
  echo $this->__('You are currently not subscribed to any newsletter.');
34
  }
28
  case Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED:
29
  echo $this->__('You are currently subscribed to "General Subscription"'); break;
30
  case Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED:
31
+ echo Mage::helper("mailup")->__('Check your email to confirm your subscription to our newsletter.'); break;
32
  default:
33
  echo $this->__('You are currently not subscribed to any newsletter.');
34
  }
app/design/frontend/base/default/template/mailup/index.phtml CHANGED
File without changes
app/design/frontend/base/default/template/mailup/subscribe.phtml CHANGED
File without changes
app/design/frontend/enterprise/default/layout/mailup.xml CHANGED
File without changes
app/design/frontend/enterprise/default/template/mailup/customer/account/dashboard/info.phtml CHANGED
@@ -19,7 +19,7 @@
19
  case Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED:
20
  echo $this->__('You are currently subscribed to "General Subscription"'); break;
21
  case Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED:
22
- echo $this->__('Check your email to confirm your subscription to our newsletter.'); break;
23
  default:
24
  echo $this->__('You are currently not subscribed to any newsletter.');
25
  }
19
  case Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED:
20
  echo $this->__('You are currently subscribed to "General Subscription"'); break;
21
  case Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED:
22
+ echo Mage::helper("mailup")->__('Check your email to confirm your subscription to our newsletter.'); break;
23
  default:
24
  echo $this->__('You are currently not subscribed to any newsletter.');
25
  }
app/design/frontend/enterprise/default/template/mailup/subscribe.phtml CHANGED
File without changes
app/etc/modules/MailUp_MailUpSync.xml ADDED
@@ -0,0 +1 @@
 
0
  <modules>
1
  <MailUp_MailUpSync>
2
  <active>true</active>
3
  <codePool>local</codePool>
4
  <depends>
5
  <Mage_Newsletter />
6
  </depends>
7
  </MailUp_MailUpSync>
8
  </modules>
1
+ <?xml version="1.0"?>
2
  <modules>
3
  <MailUp_MailUpSync>
4
  <active>true</active>
5
  <codePool>local</codePool>
6
  <depends>
7
  <Mage_Newsletter />
8
  </depends>
9
  </MailUp_MailUpSync>
10
  </modules>
app/etc/modules/SevenLike_MailUp.xml DELETED
@@ -1 +0,0 @@
1
- <?xml version="1.0"?>
2
  <modules>
3
  <SevenLike_MailUp>
4
  <active>true</active>
5
  <codePool>local</codePool>
6
  <depends>
7
  <Mage_Newsletter />
8
  </depends>
9
  </SevenLike_MailUp>
10
  </modules>
 
0
  <modules>
1
  <SevenLike_MailUp>
2
  <active>true</active>
3
  <codePool>local</codePool>
4
  <depends>
5
  <Mage_Newsletter />
6
  </depends>
7
  </SevenLike_MailUp>
8
  </modules>
app/locale/en_US/{SevenLike_MailUp.csv → MailUp_MailUpSync.csv} RENAMED
@@ -84,4 +84,8 @@ Filters,"Sync/segment Customers"
84
  "MailUp fields mapping is not complete","MailUp fields mapping is not complete, please <a href=''>click here</a> to fill the missing information"
85
  "Filtered customers preview","Filtered customers preview (max 25)"
86
  "Members have been sent correctly","Customers segmented successfully. The data export to MailUp will start within 5 minutes. The duration of the export process depends on the total amount of data being transferred."
87
- "A MailUp import process is schedules and will be executed soon.","A MailUp import process is scheduled and will be executed soon."
 
 
 
 
84
  "MailUp fields mapping is not complete","MailUp fields mapping is not complete, please <a href=''>click here</a> to fill the missing information"
85
  "Filtered customers preview","Filtered customers preview (max 25)"
86
  "Members have been sent correctly","Customers segmented successfully. The data export to MailUp will start within 5 minutes. The duration of the export process depends on the total amount of data being transferred."
87
+ "A MailUp import process is schedules and will be executed soon.","A MailUp import process is scheduled and will be executed soon."
88
+ "Check your email to confirm your subscription to our newsletter.","Check your email to confirm your subscription to our newsletter."
89
+ "Default Group","Default Group"
90
+ "Used as default group in all subscriptions that do not have a manual group set","Used as default group in all subscriptions that do not have a manual group set"
91
+ "Config warning: mysql.connect_timeout is %d which is a bit low. This may cause intermittent issues when connecting with MailUp. Please contact your Web host to discuss an increase in the timeout setting.'","Config warning: mysql.connect_timeout is %d which is a bit low. This may cause intermittent issues when connecting with MailUp. Please contact your Web host to discuss an increase in the timeout setting.'"
app/locale/it_IT/{SevenLike_MailUp.csv → MailUp_MailUpSync.csv} RENAMED
@@ -1,3 +1,5 @@
 
 
1
  "Members have been sent correctly","Segmentazione completata con successo. L'esportazione verso MailUp verra' attivata nei prossimi 5 minuti. La durata totale dell'esportazione dipende dal volume dei dati trasferiti."
2
  "Warning: no member has been selected","Attenzione: non hai inviato nessun iscritto"
3
  "WARNING: before proceeding you must correctly configure the settings of MailUp access in System->Configuration->Newsletter->MailUp","ATTENZIONE: prima di procedere devi configurare correttamente i parametri per accedere a MailUp in Sistema->Configurazione->Newsletter->MailUp"
@@ -103,4 +105,40 @@
103
  "Filtered customers preview","Anteprima dei clienti filtrati (max 25)"
104
  "A MailUp import process is running.","L'importazione verso MailUp è in esecuzione."
105
  "A MailUp import process is schedules and will be executed soon.","L'importazione verso MailUp è schedulata e inizierà a breve."
106
- "Please wait for the next step to load","Attendere il caricamento della prossima schermata"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Yes","Sì"
2
+ "No","No"
3
  "Members have been sent correctly","Segmentazione completata con successo. L'esportazione verso MailUp verra' attivata nei prossimi 5 minuti. La durata totale dell'esportazione dipende dal volume dei dati trasferiti."
4
  "Warning: no member has been selected","Attenzione: non hai inviato nessun iscritto"
5
  "WARNING: before proceeding you must correctly configure the settings of MailUp access in System->Configuration->Newsletter->MailUp","ATTENZIONE: prima di procedere devi configurare correttamente i parametri per accedere a MailUp in Sistema->Configurazione->Newsletter->MailUp"
105
  "Filtered customers preview","Anteprima dei clienti filtrati (max 25)"
106
  "A MailUp import process is running.","L'importazione verso MailUp è in esecuzione."
107
  "A MailUp import process is schedules and will be executed soon.","L'importazione verso MailUp è schedulata e inizierà a breve."
108
+ "Please wait for the next step to load","Attendere il caricamento della prossima schermata"
109
+ "Check your email to confirm your subscription to our newsletter.","Controlla la posta elettronica e conferma l'iscrizione alla newsletter."
110
+ "Default Group","Gruppo regular"
111
+ "Used as default group in all subscriptions that do not have a manual group set","Usato come gruppo predefinito nelle iscrizioni per le quali non e' stato specificato un gruppo."
112
+ "View MailUp Tasks","View MailUp Tasks"
113
+ "View Task Data","View Task Data"
114
+ "View Logs","View Logs"
115
+ "MailUp Scheduled Tasks","MailUp Scheduled Tasks"
116
+ "Settings & Field Mapping","Settings & Field Mapping"
117
+ "It's the domain portion of the URL to your MailUp Admin console","It's the domain portion of the URL to your MailUp Admin console"
118
+ "Test Connection","Test Connection"
119
+ "For assistance visit","For assistance visit"
120
+ "Please fill in MailUp console URL, Username and Password before testing","Please fill in MailUp console URL, Username and Password before testing"
121
+ "Success! Connection established with MailUp with given details”,"Success! Connection established with MailUp with given details”
122
+ "Error in username / password”,"Error in username / password”
123
+ "Error in console URL”,"Error in console URL"
124
+ "Config warning: mysql.connect_timeout is %d which is a bit low. This may cause intermittent issues when connecting with Mailup", "Config warning: mysql.connect_timeout is %d which is a bit low. This may cause intermittent issues when connecting with Mailup"
125
+ "List","List"
126
+ "Require Subscription Confirmation","Require Subscription Confirmation"
127
+ "Defines whether double opt-in is required","Defines whether double opt-in is required"
128
+ "Server Timezone","Server Timezone"
129
+ "Export Offset (in hours)","Export Offset (in hours)"
130
+ "Webhook Crypt Key","Webhook Crypt Key"
131
+ "Enable Module Debugging Log","Enable Module Debugging Log"
132
+ "Disable Newsletter Subscription Notification","Disable Newsletter Subscription Notification"
133
+ "Disables the default notification sent by Magento","Disables the default notification sent by Magento"
134
+ "Order Statuses to Match For Customer Totals","Order Statuses to Match For Customer Totals"
135
+ "If none set, those that are complete, closed or processing will be matched","If none set, those that are complete, closed or processing will be matched"
136
+ "Hourly","Hourly"
137
+ "Daily","Daily"
138
+ "Every %d hours","Every %d hours"
139
+ "Matching Magento customer attributes (on the left) with MailUp attributes (on the right)","Matching Magento customer attributes (on the left) with MailUp attributes (on the right)"
140
+ "Matching custom Magento customer attributes (on the left) with MailUp attributes (on the right)","Matching custom Magento customer attributes (on the left) with MailUp attributes (on the right)"
141
+ "MailUp Field Mapping","MailUp Field Mapping"
142
+ "Custom Customer Attributes","Custom Customer Attributes"
143
+ "Message ID (optional)","Message ID (optional)"
144
+ "See the documentation for details","See the documentation for details"
js/mailup/admin.js ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * MailUp admin javascript
3
+ *
4
+ * Javascript to be run on admin pages
5
+ */
6
+
7
+ /**
8
+ * Setup Ajax in system config for loading groups
9
+ */
10
+ function initListObserver(url) {
11
+ $('mailup_newsletter_mailup_list').observe('change', function (event) {
12
+ var currentGroupSelected = $('mailup_newsletter_mailup_default_group').value;
13
+ var updater = new Ajax.Updater('mailup_newsletter_mailup_default_group', url, {
14
+ method: 'get',
15
+ onSuccess: function () {
16
+ $('mailup_newsletter_mailup_default_group').value = currentGroupSelected;
17
+ },
18
+ parameters: {list: $('mailup_newsletter_mailup_list').value}
19
+ });
20
+ }); // End of mailup list change
21
+ }
22
+
23
+ function initSelfTestObserver(url) {
24
+ $('mailup_selftest_button').observe('click', function (event) {
25
+ var request = new Ajax.Request(url, {
26
+ method: 'get',
27
+ onFailure: function(transport) {$('messages').update('<ul class="messages"><li class="error-msg"><ul><li>Error checking connection details</li></ul></li></ul>')},
28
+ onComplete: function(transport) {
29
+ $('messages').update(transport.responseText);
30
+ Element.hide('loading-mask');
31
+ },
32
+ parameters: {
33
+ url_console: $('mailup_newsletter_mailup_url_console').value,
34
+ username_ws: $('mailup_newsletter_mailup_username_ws').value,
35
+ password_ws: $('mailup_newsletter_mailup_password_ws').value
36
+ }
37
+ });
38
+ }); // End of mailup selftest button click change
39
+ }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MailUp</name>
4
- <version>2.6.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,16 @@
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: Updates pending message in customer dashboard on subscription&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-05-28</date>
53
- <time>15:38:38</time>
54
- <contents><target name="magelocal"><dir name="SevenLike"><dir name="MailUp"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="Grid.php" hash="6af78ed4eaf0e5e4589080af6e287f1b"/></dir><file name="Log.php" hash="b81d437533b23160e0b9f85844cd45e3"/><dir name="Mailup"><file name="Grid.php" hash="94dccf2de2027ea2d7ba470482c6e56e"/></dir><file name="Mailupbackend.php" hash="142d7d788b131fc32dbf395dd51d1b7f"/><dir name="Sync"><file name="Grid.php" hash="ca011e2cd4012bc6dc27886d07507cf0"/></dir><file name="Sync.php" hash="0c44aecfe6ddbd227e442fd124bd33b2"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Timezone.php" hash="c6140fcdd82a4e336be9c6f2ffa49949"/></dir></dir></dir></dir></dir><dir name="Checkout"><file name="Subscribe.php" hash="9cd1c87df8a23f93d8bf0995e13652f2"/></dir><file name="Filters.php" hash="f881a202a8d2e3c34b3f1b4094852b2c"/><file name="Index.php" hash="7d5c46e16c94b50f6236d8d0027066d0"/></dir><dir name="Helper"><file name="Customer.php" hash="c2657e1af95b572d536d892e1bf74b9c"/><file name="Data.php" hash="3d1af6565f71ed9c52739537b17e9bc5"/><file name="Order.php" hash="919848a9fd6952f1df90c4b73500ed61"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Clone"><dir name="Mappings"><file name="Custom.php" hash="43d286b59d67ef1a0f15cc74f46f95a1"/></dir></dir><dir name="Source"><dir name="Cron"><file name="Frequency.php" hash="0bdd434c98ce97bfe7db1d79a96c1b25"/><file name="Hours.php" hash="99b0428a6e88248bf15007396f48b0fc"/></dir><file name="Fields.php" hash="f692f935af7c3ca442a5945a16d6e450"/></dir><file name=".DS_Store" hash="699eb0995de74828d9f23655e826e581"/></dir><file name=".DS_Store" hash="173bd8294aed6b0b02e19ffb8e68cbd5"/></dir><file name="Config.php" hash="5fb0bb4c012ee7dde1f37b71f3a350f4"/><file name="Consoleurlvalidator.php" hash="2cd27b9d21570e39ef6a5a0bbf3f97c5"/><file name="Cron.php" hash="db67d877c077536d660051535cc66060"/><file name="Job.php" hash="6739a5df8b10248d91d3f2e3dd1ca894"/><file name="Lists.php" hash="c7e14b69d39ff8d9c78fb972168b7860"/><file name="Log.php" hash="9e15739c03264cf839a1460ac29f6def"/><file name="MailUp.php" hash="1b552b40a7bf6f4c915667adbe164140"/><file name="MailUpWsImport.php" hash="edfd6d6df0892ebc0f83350bd1825ca3"/><dir name="Mysql14"><dir name="MailUp"><file name="Collection.php" hash="256485c1ba69eff42ae109d3218c89ff"/></dir><file name="MailUp.php" hash="d06606483ac4c35e42f9cb449a36c1c5"/></dir><dir name="Mysql4"><dir name="Job"><file name="Collection.php" hash="9cdb99926ae73a9c6d5bafee0f2d6042"/></dir><file name="Job.php" hash="244a509b404abb9fc47755aaff8463d9"/><dir name="Log"><file name="Collection.php" hash="4589959dac703289c9a6fdf58a0436a6"/></dir><file name="Log.php" hash="e96fdf661e3060499fa6c6d6f8a69177"/><dir name="Sync"><file name="Collection.php" hash="e05d869a6b953a0a45fec482e4e74562"/></dir><file name="Sync.php" hash="971e196c7c19f215955aac740218be22"/></dir><file name="Observer.php" hash="33653314f7d37536372f920189828c2c"/><dir name="Source"><file name="Store.php" hash="de1b07b5bd94ae4292377dff5a153340"/></dir><file name="Subscriber.php" hash="877fe0e81d86e8b9b0d9c23ccd5378f2"/><file name="Sync.php" hash="7736a7e1fb38aad61c4e6a5aa89294a2"/><file name="Webserviceusernamevalidator.php" hash="9650aed034726d621968f18371d554bc"/><file name="Ws.php" hash="21ef21afcf35867d0ec8ff345babeab6"/><file name="Wssend.php" hash="2aa70db9b522d262b45f63c8cfcd1bbc"/><file name=".DS_Store" hash="6f2c4920df9dd2405271ef9b6495cacc"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ConfigurationController.php" hash="240d526f2c944b93b78d00d85d4b6c47"/><file name="FieldsmappingController.php" hash="66f0598c537f9518433b99cb7aa9acfe"/><file name="FilterController.php" hash="18812ae48db6286c9a6e0a71e791dc11"/><file name="LogController.php" hash="1300abf084a62b9ed2b00e7f2a632c29"/><file name="MailupbackendController.php" hash="963646cb267f4f4e05efd09be387b834"/><file name="SyncController.php" hash="94e0f9d8f42b609e9b08822d1766f9f8"/><file name="ViewdatatransferlogController.php" hash="eec948994f2d1491ead736578deabf92"/></dir><file name="IndexController.php" hash="d7dfe7ee526df542d7810936a496a1fc"/><file name="TestController.php" hash="bfe840edde428a33526724d812a29661"/><file name="WebhookController.php" hash="ef72fa5602b3f9fec0eae41eb34638a1"/></dir><dir name="etc"><file name="config.xml" hash="a14a8d920fc8e493c54568ac861f4534"/><file name="system.xml" hash="ba559125f849eab3e7491f80b35d6993"/></dir><dir name="sql"><dir name="mailup_setup"><file name="mysql4-install-0.1.0.php" hash="8e52462c1d0d28f39c1c3f67c3748d26"/><file name="mysql4-install-2.3.0.php" hash="9532dac8b7bbc85f4e13d44816213076"/><file name="mysql4-install-2.4.0.php" hash="df3247d77cf4dff79c7dbf305e5ad9b8"/><file name="mysql4-upgrade-0.1.0-1.0.0.php" hash="8e52462c1d0d28f39c1c3f67c3748d26"/><file name="mysql4-upgrade-0.3.0-1.0.0.php" hash="97e4f8e3ba9e2ab4d5c5757efb3a47de"/><file name="mysql4-upgrade-1.0.0-1.5.2.php" hash="4fda0e9178a6cba85631f4f24faaf71b"/><file name="mysql4-upgrade-2.1.3-2.2.0.php" hash="9d4c89357d75bc526c0a38c8b7108611"/><file name="mysql4-upgrade-2.2.0-2.3.0.php" hash="6b838a9491a8a3d8cd66ec8399667fe3"/><file name="mysql4-upgrade-2.2.1-2.3.0.php" hash="6b838a9491a8a3d8cd66ec8399667fe3"/><file name="mysql4-upgrade-2.3.0-2.3.1.php" hash="d7b7aac558c7bbfcd9f5657342bb8d5d"/><file name="mysql4-upgrade-2.3.1-2.3.2.php" hash="841257c7988bd63828d2fdeaa087eaca"/><file name="mysql4-upgrade-2.3.2-2.4.0.php" hash="df3247d77cf4dff79c7dbf305e5ad9b8"/><file name="mysql4-upgrade-2.4.0-2.4.1.php" hash="812b65d636b1e15d3804c21d134de572"/></dir></dir><file name=".DS_Store" hash="e49cca224ac24efb7898b1adf5d52aaf"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mailup.xml" hash="1e83a4178884228b5346571152dede1d"/></dir><dir name="template"><dir name="sevenlike"><dir name="mailup"><file name="confirm.phtml" hash="1f2af2e10a35f639044e3a4fbd865788"/><file name="fieldsmapping.phtml" hash="b0b22c19bc6f9c97b22754dc7a0103ba"/><file name="filter.phtml" hash="9938d917ad94034d581069b08d93c3ca"/><file name="viewdatatransferlog.phtml" hash="fcc13d34146e22630d1a170888b2cc73"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="mailup.xml" hash="e1bdb69f2ad9a1c67d06e786e08905bd"/></dir><dir name="template"><dir name="mailup"><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="1ecb6cf1173e15ba491279f6967498f2"/></dir></dir></dir><file name="index.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="subscribe.phtml" hash="3316f1a2e166179d2631a4a568059d66"/></dir></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="layout"><file name="mailup.xml" hash="1251bb9bdafdb8c5799ff3f78fa960d6"/></dir><dir name="template"><dir name="mailup"><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="6b5e29196f0176c1c76e560f9f8346cb"/></dir></dir></dir><file name="subscribe.phtml" hash="a102e2e0dc4c836bc78eb044bf13e172"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="SevenLike_MailUp.xml" hash="28e0d7aac3e7e87c416a779c40b48c3f"/></dir></target><target name="magelocale"><dir name="en_US"><file name="SevenLike_MailUp.csv" hash="ed0b8d49915f1b1d6c40541fe65c45d4"/></dir><dir name="it_IT"><file name="SevenLike_MailUp.csv" hash="746c5012c1659dc21dbeb9e50cb4deb7"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="sevenlike"><dir name="mailup"><dir name="images"><file name="MailUp_300_200_transparent_small.png" hash="fcaf7d0876af346b01e40f3c1eeaa721"/><file name="titoli.png" hash="95a7996cd77d3413fd048018095aec6e"/></dir><file name="mailup.css" hash="cd3e7f45f619c6172de923d688d21dc3"/></dir></dir><dir name="images"><file name="MailUp_300_200_transparent_small.png" hash="fcaf7d0876af346b01e40f3c1eeaa721"/></dir></dir></dir></dir></target></contents>
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.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/academic.php">Academic Free License (AFL)</license>
7
  <channel>community</channel>
46
  &lt;/ul&gt;&#xD;
47
  &lt;p&gt;&lt;br /&gt;Ad esempio un sito di ecommerce potrebbe alimentare il DB di MailUp con informazioni sugli acquisti e MailUp potr&amp;agrave; quindi inviare, ad esempio dopo 7 giorni dall'acquisto, un messaggio di costumer satisfaction oppure l'invito ad acquistare un prodotto correlato.&lt;/p&gt;</description>
48
  <notes>&lt;ul&gt;&#xD;
49
+ &lt;li&gt;NEW: Specify default group for new subscribers to be added to&lt;/li&gt;&#xD;
50
+ &lt;li&gt;NEW: Segmenting customers:&lt;ul&gt;&lt;li&gt;You can choose a custom subscription message ID&lt;/li&gt;&lt;li&gt;Can chose all customers who have not opted-in&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&#xD;
51
+ &lt;li&gt;NEW: Connection check for url, username and password to make entering your details easier&lt;/li&gt;&#xD;
52
+ &lt;li&gt;Improvement: Shopping-cart abandonment fields cleared immediately after order&lt;/li&gt;&#xD;
53
+ &lt;li&gt;Improvement: Task and log lists now show most recent first&lt;/li&gt;&#xD;
54
  &lt;/ul&gt;</notes>
55
  <authors><author><name>Mailup</name><user>Mailup</user><email>sales@mailup.com</email></author></authors>
56
+ <date>2014-09-12</date>
57
+ <time>16:10:36</time>
58
+ <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="01c984f3c7ed4a89f18cb7736665e8b3"/></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="upgrade-2.6.1-2.7.0.php" hash="525fb58aa0ecf97693806d81149793e0"/></dir></dir><dir name="etc"><file name="config.xml" hash="e9e571b43809a8820d087e7047264089"/><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>
59
  <compatible/>
60
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
61
  </package>
skin/adminhtml/default/default/images/MailUp_300_200_transparent_small.png CHANGED
File without changes
skin/adminhtml/default/default/{sevenlike/mailup → mailup/mailupsync}/images/MailUp_300_200_transparent_small.png RENAMED
File without changes
skin/adminhtml/default/default/{sevenlike/mailup → mailup/mailupsync}/images/titoli.png RENAMED
File without changes
skin/adminhtml/default/default/{sevenlike/mailup → mailup/mailupsync}/mailup.css RENAMED
File without changes