e-mark_mail - Version 1.3.0

Version Notes

First Release

Download this release

Release Info

Developer E-mark
Extension e-mark_mail
Version 1.3.0
Comparing to
See all releases


Code changes from version 0.9.0 to 1.3.0

Files changed (84) hide show
  1. app/code/community/Emark/Cartalert/Block/Adminhtml/Cartalert.php +19 -0
  2. app/code/community/Emark/Cartalert/Block/Adminhtml/Cartalert/Edit.php +33 -0
  3. app/code/community/Emark/Cartalert/Block/Adminhtml/Cartalert/Edit/Form.php +78 -0
  4. app/code/community/Emark/Cartalert/Block/Adminhtml/Cartalert/Grid.php +113 -0
  5. app/code/community/Emark/Cartalert/Block/Adminhtml/History.php +12 -0
  6. app/code/community/Emark/Cartalert/Block/Adminhtml/History/Edit.php +21 -0
  7. app/code/community/Emark/Cartalert/Block/Adminhtml/History/Edit/Form.php +38 -0
  8. app/code/community/Emark/Cartalert/Block/Adminhtml/History/Grid.php +98 -0
  9. app/code/community/Emark/Cartalert/Block/Rewrite/FrontCheckoutOnepage.data.php +5 -0
  10. app/code/community/Emark/Cartalert/Block/Rewrite/FrontCheckoutOnepage.php +5 -0
  11. app/code/community/Emark/Cartalert/Helper/Data.php +6 -0
  12. app/code/community/Emark/Cartalert/Model/Cartalert.php +243 -0
  13. app/code/community/Emark/Cartalert/Model/History.php +9 -0
  14. app/code/community/Emark/Cartalert/Model/Mysql4/Cartalert.php +169 -0
  15. app/code/community/Emark/Cartalert/Model/Mysql4/Cartalert/Collection.php +16 -0
  16. app/code/community/Emark/Cartalert/Model/Mysql4/History.php +8 -0
  17. app/code/community/Emark/Cartalert/Model/Mysql4/History/Collection.php +10 -0
  18. app/code/community/Emark/Cartalert/Model/Observer.php +64 -0
  19. app/code/community/Emark/Cartalert/Model/Source/Discount.php +21 -0
  20. app/code/community/Emark/Cartalert/Model/Source/Step.php +21 -0
  21. app/code/community/Emark/Cartalert/controllers/Adminhtml/CartalertController.php +199 -0
  22. app/code/community/Emark/Cartalert/controllers/Adminhtml/HistoryController.php +68 -0
  23. app/code/community/Emark/Cartalert/controllers/RecoverController.php +59 -0
  24. app/code/community/Emark/Cartalert/etc/config.xml +229 -0
  25. app/code/community/Emark/Cartalert/etc/system.xml +153 -0
  26. app/code/community/Emark/Cartalert/sql/emark_cartalert_setup/mysql4-install-0.1.0.php +60 -0
  27. app/code/community/Emark/Mail/Block/Admin/Newsletter/Subscriber/Grid.php +36 -0
  28. app/code/community/Emark/Mail/Block/Admin/System/Config/Form/Field/Customerlabels.php +22 -0
  29. app/code/community/Emark/Mail/Block/Admin/System/Config/Form/Field/Label.php +89 -0
  30. app/code/community/Emark/Mail/Block/Admin/System/Config/Form/Field/Label2.php +65 -0
  31. app/code/community/Emark/Mail/Block/Admin/System/Config/Form/Field/Subscriberlabels.php +36 -0
  32. app/code/community/Emark/Mail/Helper/Api.php +286 -0
  33. app/code/community/Emark/Mail/Helper/Connectfields.php +172 -0
  34. app/code/community/Emark/Mail/Helper/Customer.php +184 -0
  35. app/code/community/Emark/Mail/Helper/Data.php +11 -0
  36. app/code/community/Emark/Mail/Model/Admin/Apidatabase.php +96 -0
  37. app/code/community/Emark/Mail/Model/Admin/Apipassword.php +16 -0
  38. app/code/community/Emark/Mail/Model/Admin/Apiurl.php +12 -0
  39. app/code/community/Emark/Mail/Model/Admin/Apiuser.php +13 -0
  40. app/code/community/Emark/Mail/Model/Admin/Connectfields.php +30 -0
  41. app/code/community/Emark/Mail/Model/Customer.php +57 -0
  42. app/code/community/Emark/Mail/Model/Customer/Register/Observer.php +49 -0
  43. app/code/community/Emark/Mail/Model/Subscriber.php +96 -0
  44. app/code/community/Emark/Mail/controllers/Admin/CustomerController.php +60 -0
  45. app/code/community/Emark/Mail/controllers/Admin/Newsletter/SubscriberController.php +68 -0
  46. app/code/community/Emark/Mail/controllers/Admin/SyncController.php +65 -0
  47. app/code/community/Emark/Mail/etc/adminhtml.xml +40 -0
  48. app/code/community/Emark/Mail/etc/config.xml +115 -0
  49. app/code/community/Emark/Mail/etc/system.xml +108 -0
  50. app/code/{local/EM → community/Emark}/Mbbwebservice/Helper/Config.php +3 -3
  51. app/code/community/Emark/Mbbwebservice/Helper/Data.php +6 -0
  52. app/code/{local/EM → community/Emark}/Mbbwebservice/Model/Email/Template.php +14 -10
  53. app/code/{local/EM → community/Emark}/Mbbwebservice/Model/Mail.php +1 -1
  54. app/code/{local/EM → community/Emark}/Mbbwebservice/Model/Observer.php +24 -12
  55. app/code/{local/EM → community/Emark}/Mbbwebservice/etc/config.xml +14 -17
  56. app/code/{local/EM → community/Emark}/Mbbwebservice/etc/system.xml +22 -4
  57. app/code/local/EM/Mbbwebservice/Helper/Data.php +0 -6
  58. app/etc/modules/EM_Mbbwebservice.xml +0 -9
  59. app/etc/modules/Emark_Cartalert.xml +12 -0
  60. app/etc/modules/Emark_Mail.xml +9 -0
  61. app/etc/modules/Emark_Mbbwebservice.xml +9 -0
  62. app/locale/en_US/Emark_Cartalert.csv +80 -0
  63. app/locale/en_US/Emark_Mail.csv +20 -0
  64. app/locale/en_US/template/email/abandoned_cart_alert.html +52 -0
  65. app/locale/en_US/template/email/abandoned_cart_alert2.html +52 -0
  66. app/locale/en_US/template/email/abandoned_cart_alert3.html +53 -0
  67. app/locale/es_ES/Emark_Cartalert.csv +80 -0
  68. app/locale/es_ES/template/email/abandoned_cart_alert.html +51 -0
  69. app/locale/es_ES/template/email/abandoned_cart_alert2.html +51 -0
  70. app/locale/es_ES/template/email/abandoned_cart_alert3.html +52 -0
  71. app/locale/fr_FR/Emark_Cartalert.csv +80 -0
  72. app/locale/fr_FR/template/email/abandoned_cart_alert.html +52 -0
  73. app/locale/fr_FR/template/email/abandoned_cart_alert2.html +54 -0
  74. app/locale/fr_FR/template/email/abandoned_cart_alert3.html +52 -0
  75. app/locale/it_IT/Emark_Cartalert.csv +80 -0
  76. app/locale/it_IT/template/email/abandoned_cart_alert.html +54 -0
  77. app/locale/it_IT/template/email/abandoned_cart_alert2.html +55 -0
  78. app/locale/it_IT/template/email/abandoned_cart_alert3.html +55 -0
  79. app/locale/nl_NL/Emark_Cartalert.csv +80 -0
  80. app/locale/nl_NL/Emark_Mail.csv +20 -0
  81. app/locale/nl_NL/template/email/abandoned_cart_alert.html +52 -0
  82. app/locale/nl_NL/template/email/abandoned_cart_alert2.html +52 -0
  83. app/locale/nl_NL/template/email/abandoned_cart_alert3.html +53 -0
  84. package.xml +19 -25
app/code/community/Emark/Cartalert/Block/Adminhtml/Cartalert.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Emark_Cartalert_Block_Adminhtml_Cartalert extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+
7
+ $this->_addButton('generate', array(
8
+ 'label' => Mage::helper('emark_cartalert')->__('Update Queue Now'),
9
+ 'onclick' => "location.href='".$this->getUrl('*/*/generate')."';return false;",
10
+ 'class' => '',
11
+ ));
12
+
13
+ $this->_controller = 'adminhtml_cartalert';
14
+ $this->_blockGroup = 'emark_cartalert';
15
+ $this->_headerText = Mage::helper('emark_cartalert')->__('Alerts Queue');
16
+ $this->_addButtonLabel = Mage::helper('emark_cartalert')->__('Add Alert');
17
+ parent::__construct();
18
+ }
19
+ }
app/code/community/Emark/Cartalert/Block/Adminhtml/Cartalert/Edit.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Emark_Cartalert_Block_Adminhtml_Cartalert_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+
9
+ $this->_objectId = 'id'; // ?
10
+ $this->_blockGroup = 'emark_cartalert';
11
+ $this->_controller = 'adminhtml_cartalert';
12
+
13
+ $this->_removeButton('reset');
14
+
15
+ $this->_addButton('send', array(
16
+ 'label' => Mage::helper('emark_cartalert')->__('Save and Send Out'),
17
+ 'onclick' => 'sendAndDelete()',
18
+ 'class' => 'save',
19
+ ), -100);
20
+
21
+ $this->_formScripts[] = "
22
+ function sendAndDelete(){
23
+ $('edit_form').action += 'send/edit';
24
+ editForm.submit();
25
+ }
26
+ ";
27
+ }
28
+
29
+ public function getHeaderText()
30
+ {
31
+ return Mage::helper('emark_cartalert')->__('Abandoned Cart Alert');
32
+ }
33
+ }
app/code/community/Emark/Cartalert/Block/Adminhtml/Cartalert/Edit/Form.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Emark_Cartalert_Block_Adminhtml_Cartalert_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array(
8
+ 'id' => 'edit_form',
9
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
+ 'method' => 'post'));
11
+
12
+ $form->setUseContainer(true);
13
+ $this->setForm($form);
14
+ $hlp = Mage::helper('emark_cartalert');
15
+
16
+ $fldInfo = $form->addFieldset('emark_cartalert_info', array('legend'=> $hlp->__('Alert Variables')));
17
+
18
+ $fldInfo->addField('store_id', 'select', array(
19
+ 'label' => $hlp->__('Store View'),
20
+ 'class' => 'required-entry',
21
+ 'required' => true,
22
+ 'name' => 'store_id',
23
+ 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm()
24
+ ));
25
+
26
+ $fldInfo->addField('follow_up', 'select', array(
27
+ 'label' => $hlp->__('Follow Up'),
28
+ 'name' => 'follow_up',
29
+ 'options' => array(
30
+ 'first' => $hlp->__('First'),
31
+ 'second' => $hlp->__('Second'),
32
+ 'third' => $hlp->__('Third'),
33
+ ),
34
+ ));
35
+
36
+ $fldInfo->addField('sheduled_at', 'date', array(
37
+ 'label' => $hlp->__('Alert Will Be Sent On'),
38
+ 'image' => $this->getSkinUrl('images/grid-cal.gif'),
39
+ 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
40
+ 'name' => 'sheduled_at',
41
+ ));
42
+
43
+ $fldInfo->addField('customer_email', 'text', array(
44
+ 'label' => $hlp->__('Customer E-mail'),
45
+ 'class' => 'required-entry validate-email',
46
+ 'required' => true,
47
+ 'name' => 'customer_email',
48
+ ));
49
+ $fldInfo->addField('customer_fname', 'text', array(
50
+ 'label' => $hlp->__('Customer First Name'),
51
+ 'class' => 'required-entry',
52
+ 'required' => true,
53
+ 'name' => 'customer_fname',
54
+ ));
55
+ $fldInfo->addField('customer_lname', 'text', array(
56
+ 'label' => $hlp->__('Customer Last Name'),
57
+ 'name' => 'customer_lname',
58
+ ));
59
+
60
+ $fldInfo->addField('products', 'textarea', array(
61
+ 'label' => $hlp->__('Products'),
62
+ 'class' => 'required-entry',
63
+ 'required' => true,
64
+ 'name' => 'products',
65
+ 'style' => 'width:35em;height:15em;',
66
+ ));
67
+ $fldInfo->addField('is_preprocessed', 'hidden', array(
68
+ 'name' => 'is_preprocessed',
69
+ 'value' => 1,
70
+ ));
71
+
72
+ if ( Mage::registry('cartalert_data') ) {
73
+ $form->setValues(Mage::registry('cartalert_data')->getData());
74
+ }
75
+
76
+ return parent::_prepareForm();
77
+ }
78
+ }
app/code/community/Emark/Cartalert/Block/Adminhtml/Cartalert/Grid.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Emark
4
+ */
5
+ class Emark_Cartalert_Block_Adminhtml_Cartalert_Grid extends Mage_Adminhtml_Block_Widget_Grid
6
+ {
7
+ public function __construct()
8
+ {
9
+ parent::__construct();
10
+ $this->setId('cartalertGrid');
11
+ $this->setDefaultSort('cartalert_id');
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('emark_cartalert/cartalert')->getCollection();
17
+ $this->setCollection($collection);
18
+ return parent::_prepareCollection();
19
+ }
20
+
21
+ protected function _prepareColumns()
22
+ {
23
+ $hlp = Mage::helper('emark_cartalert');
24
+ $this->addColumn('cartalert_id', array(
25
+ 'header' => $hlp->__('ID'),
26
+ 'align' => 'right',
27
+ 'width' => '50px',
28
+ 'index' => 'cartalert_id',
29
+ ));
30
+
31
+ $this->addColumn('abandoned_at', array(
32
+ 'header' => $hlp->__('Abandoned At'),
33
+ 'index' => 'abandoned_at',
34
+ 'type' => 'datetime',
35
+ 'width' => '150px',
36
+ 'gmtoffset' => true,
37
+ 'default' => ' ---- ',
38
+ ));
39
+
40
+ $this->addColumn('sheduled_at', array(
41
+ 'header' => $hlp->__('Scheduled At'),
42
+ 'index' => 'sheduled_at',
43
+ 'type' => 'datetime',
44
+ 'width' => '150px',
45
+ 'gmtoffset' => true,
46
+ 'default' => ' ---- ',
47
+ ));
48
+
49
+ $this->addColumn('follow_up', array(
50
+ 'header' => $hlp->__('Follow Up'),
51
+ 'index' => 'follow_up',
52
+ 'type' => 'options',
53
+ 'options' => array(
54
+ 'first' => $hlp->__('First'),
55
+ 'second' => $hlp->__('Second'),
56
+ 'third' => $hlp->__('Third'),
57
+ ),
58
+ 'width' => '100px',
59
+ ));
60
+
61
+ $this->addColumn('status', array(
62
+ 'header' => $hlp->__('Status'),
63
+ 'index' => 'status',
64
+ 'type' => 'options',
65
+ 'options' => array(
66
+ 'pending' => $hlp->__('Pending'),
67
+ 'invalid' => $hlp->__('Not Sent'),
68
+ ),
69
+ 'width' => '100px',
70
+ ));
71
+
72
+ $this->addColumn('customer_email', array(
73
+ 'header' => $hlp->__('Customer E-mail'),
74
+ 'index' => 'customer_email',
75
+ ));
76
+
77
+ $this->addColumn('customer_fname', array(
78
+ 'header' => $hlp->__('Customer First Name'),
79
+ 'index' => 'customer_fname',
80
+ ));
81
+
82
+ $this->addColumn('customer_lname', array(
83
+ 'header' => $hlp->__('Customer Last Name'),
84
+ 'index' => 'customer_lname',
85
+ ));
86
+
87
+ return parent::_prepareColumns();
88
+ }
89
+
90
+ public function getRowUrl($row)
91
+ {
92
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
93
+ }
94
+
95
+ protected function _prepareMassaction(){
96
+ $this->setMassactionIdField('cartalert_id');
97
+ $this->getMassactionBlock()->setFormFieldName('cartalert');
98
+
99
+ $this->getMassactionBlock()->addItem('send', array(
100
+ 'label' => Mage::helper('emark_cartalert')->__('Send and Save to History'),
101
+ 'url' => $this->getUrl('*/*/massSend'),
102
+ 'confirm' => Mage::helper('emark_cartalert')->__('Are you sure?')
103
+ ));
104
+ $this->getMassactionBlock()->addItem('delete', array(
105
+ 'label' => Mage::helper('emark_cartalert')->__('Delete'),
106
+ 'url' => $this->getUrl('*/*/massDelete'),
107
+ 'confirm' => Mage::helper('emark_cartalert')->__('Are you sure?')
108
+ ));
109
+
110
+ return $this;
111
+ }
112
+
113
+ }
app/code/community/Emark/Cartalert/Block/Adminhtml/History.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Emark_Cartalert_Block_Adminhtml_History extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->_controller = 'adminhtml_history';
8
+ $this->_blockGroup = 'emark_cartalert';
9
+ $this->_headerText = Mage::helper('emark_cartalert')->__('Sent Alerts');
10
+ $this->_removeButton('add');
11
+ }
12
+ }
app/code/community/Emark/Cartalert/Block/Adminhtml/History/Edit.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Emark_Cartalert_Block_Adminhtml_History_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+
9
+ $this->_objectId = 'id'; // ?
10
+ $this->_blockGroup = 'emark_cartalert';
11
+ $this->_controller = 'adminhtml_history';
12
+
13
+ $this->_removeButton('reset');
14
+ $this->_removeButton('save');
15
+ }
16
+
17
+ public function getHeaderText()
18
+ {
19
+ return Mage::helper('emark_cartalert')->__('Sent Alert');
20
+ }
21
+ }
app/code/community/Emark/Cartalert/Block/Adminhtml/History/Edit/Form.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Emark_Cartalert_Block_Adminhtml_History_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
3
+ {
4
+ protected function _prepareForm()
5
+ {
6
+ $form = new Varien_Data_Form(array(
7
+ 'id' => 'edit_form',
8
+ 'action' => '',
9
+ 'method' => 'post'));
10
+
11
+ $form->setUseContainer(true);
12
+ $this->setForm($form);
13
+ $hlp = Mage::helper('emark_cartalert');
14
+
15
+ $fldInfo = $form->addFieldset('emark_cartalert_info', array('legend'=> $hlp->__('Alert Variables')));
16
+
17
+ $fldInfo->addField('customer_email', 'text', array(
18
+ 'label' => $hlp->__('Customer E-mail'),
19
+ 'name' => 'customer_email',
20
+ ));
21
+ $fldInfo->addField('customer_name', 'text', array(
22
+ 'label' => $hlp->__('Customer Name'),
23
+ 'name' => 'customer_name',
24
+ ));
25
+
26
+ $fldInfo->addField('txt', 'textarea', array(
27
+ 'label' => $hlp->__('Message'),
28
+ 'name' => 'txt',
29
+ 'style' => 'width:35em;height:15em;',
30
+ ));
31
+
32
+ if ( Mage::registry('history_data') ) {
33
+ $form->setValues(Mage::registry('history_data')->getData());
34
+ }
35
+
36
+ return parent::_prepareForm();
37
+ }
38
+ }
app/code/community/Emark/Cartalert/Block/Adminhtml/History/Grid.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @author Emark
4
+ */
5
+ class Emark_Cartalert_Block_Adminhtml_History_Grid extends Mage_Adminhtml_Block_Widget_Grid
6
+ {
7
+ public function __construct()
8
+ {
9
+ parent::__construct();
10
+ $this->setId('historyGrid');
11
+ $this->setDefaultSort('id');
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('emark_cartalert/history')->getCollection();
17
+ $this->setCollection($collection);
18
+ return parent::_prepareCollection();
19
+ }
20
+
21
+ protected function _prepareColumns()
22
+ {
23
+ $hlp = Mage::helper('emark_cartalert');
24
+ $this->addColumn('id', array(
25
+ 'header' => $hlp->__('ID'),
26
+ 'align' => 'right',
27
+ 'width' => '50px',
28
+ 'index' => 'id',
29
+ ));
30
+
31
+ $this->addColumn('sent_at', array(
32
+ 'header' => $hlp->__('Sent On'),
33
+ 'index' => 'sent_at',
34
+ 'type' => 'datetime',
35
+ 'width' => '150px',
36
+ 'gmtoffset' => true,
37
+ 'default' => ' ---- ',
38
+ ));
39
+
40
+ $this->addColumn('recovered_at', array(
41
+ 'header' => $hlp->__('Recovered On'),
42
+ 'index' => 'recovered_at',
43
+ 'type' => 'datetime',
44
+ 'width' => '150px',
45
+ 'gmtoffset' => true,
46
+ 'default' => ' ---- ',
47
+ ));
48
+
49
+ $this->addColumn('recovered_from', array(
50
+ 'header' => $hlp->__('Remote IP'),
51
+ 'index' => 'recovered_from',
52
+ 'width' => '150px',
53
+ ));
54
+
55
+ $this->addColumn('follow_up', array(
56
+ 'header' => $hlp->__('Follow Up'),
57
+ 'index' => 'follow_up',
58
+ 'type' => 'options',
59
+ 'options' => array(
60
+ 'first' => $hlp->__('First'),
61
+ 'second' => $hlp->__('Second'),
62
+ 'third' => $hlp->__('Third'),
63
+ ),
64
+ 'width' => '100px',
65
+ ));
66
+
67
+ $this->addColumn('customer_email', array(
68
+ 'header' => $hlp->__('Customer E-mail'),
69
+ 'index' => 'customer_email',
70
+ ));
71
+
72
+ $this->addColumn('customer_name', array(
73
+ 'header' => $hlp->__('Customer Name'),
74
+ 'index' => 'customer_name',
75
+ ));
76
+
77
+ return parent::_prepareColumns();
78
+ }
79
+
80
+ public function getRowUrl($row)
81
+ {
82
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
83
+ }
84
+
85
+ protected function _prepareMassaction(){
86
+ $this->setMassactionIdField('id');
87
+ $this->getMassactionBlock()->setFormFieldName('cartalert');
88
+
89
+ $this->getMassactionBlock()->addItem('delete', array(
90
+ 'label' => Mage::helper('emark_cartalert')->__('Delete'),
91
+ 'url' => $this->getUrl('*/*/massDelete'),
92
+ 'confirm' => Mage::helper('emark_cartalert')->__('Are you sure?')
93
+ ));
94
+
95
+ return $this;
96
+ }
97
+
98
+ }
app/code/community/Emark/Cartalert/Block/Rewrite/FrontCheckoutOnepage.data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Emark_Cartalert_Block_Rewrite_FrontCheckoutOnepage extends Mage_Checkout_Block_Onepage
3
+ {
4
+
5
+ }
app/code/community/Emark/Cartalert/Block/Rewrite/FrontCheckoutOnepage.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Emark_Cartalert_Block_Rewrite_FrontCheckoutOnepage extends Mage_Checkout_Block_Onepage
3
+ {
4
+
5
+ }
app/code/community/Emark/Cartalert/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Emark_Cartalert_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/community/Emark/Cartalert/Model/Cartalert.php ADDED
@@ -0,0 +1,243 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cartalert module observer
4
+ *
5
+ * @author Emark
6
+ */
7
+ class Emark_Cartalert_Model_Cartalert extends Mage_Core_Model_Abstract
8
+ {
9
+ public function _construct()
10
+ {
11
+ parent::_construct();
12
+ $this->_init('emark_cartalert/cartalert');
13
+ }
14
+
15
+ public function generate($now){
16
+ return $this->getResource()->generate($now);
17
+ }
18
+
19
+ public function preprocess($store=null){
20
+ if ($this->getIsPreprocessed())
21
+ return $this;
22
+ $this->setIsPreprocessed(1);
23
+ if (!strpos($this->getProducts(),'##'))
24
+ return $this; // new or custom
25
+
26
+ if (!$store)
27
+ $store = Mage::app()->getStore($this->getStoreId());
28
+
29
+ $baseUrl = $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
30
+
31
+ $visibility = Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds();
32
+ $status = Mage::getSingleton('catalog/product_status')->getVisibleStatusIds();
33
+ $items = array();
34
+ $prod = explode('##,', substr($this->getProducts(), 0, -2));
35
+ for ($i=0, $n=sizeof($prod); $i<$n; $i+=2){
36
+ $product = Mage::getModel('catalog/product')
37
+ ->setStoreId($this->getStoreId())
38
+ ->load($prod[$i]);
39
+ if(in_array($product->getStatus(),$status)/*&&in_array($product->getVisibility(),$visibility)*/&&$product->isSaleable())
40
+ {
41
+ $url = $baseUrl . 'catalog/product/view/id/'.$prod[$i];
42
+ $name = $prod[$i+1];
43
+ $imageTag = '';$hasImage = $product->getData('small_image');
44
+ if((isset($hasImage))&&($hasImage!= 'no_selection'))
45
+ {
46
+ $imageTag ='<br><img src="'.Mage::helper('catalog/image')->init($product ,
47
+ 'small_image')->resize(75).'" border="0" />';
48
+ }
49
+ $items[$prod[$i]] = '<a href="'.$url.'">'.$name.$imageTag.'</a>'; //to omit duplicates
50
+ }
51
+ }
52
+
53
+ $this->setProducts(join("<br />\n", $items));
54
+ $this->setIsPreprocessed(1);
55
+ return $this;
56
+ }
57
+
58
+ // return bool
59
+ public function send(){
60
+ $storeId = $this->getStoreId();
61
+ $store = Mage::app()->getStore($storeId);
62
+
63
+ $translate = Mage::getSingleton('core/translate');
64
+ /* @var $translate Mage_Core_Model_Translate */
65
+ $translate->setTranslateInline(false);
66
+
67
+ $oldStore = Mage::app()->getStore();
68
+ Mage::app()->setCurrentStore($store);
69
+
70
+ $this->preprocess($store);
71
+
72
+ $history = Mage::getModel('emark_cartalert/history');
73
+ $tpl = Mage::getModel('core/email_template');
74
+
75
+ if(strlen($this->getProducts())>0)
76
+ {
77
+ try {
78
+ $history->setSentAt(now())
79
+ ->setCustomerName($this->getCustomerName())
80
+ ->setCustomerEmail($this->getCustomerEmail())
81
+ ->setTxt($this->getProducts())
82
+ ->setQuoteId($this->getQuoteId())
83
+ ->setCustomerId($this->getCustomerId())
84
+ ->setRecoverCode(md5(uniqid()))
85
+ ->setFollowUp($this->getFollowUp())
86
+ ->save();
87
+
88
+ $url = $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
89
+
90
+ //added in 1.2.1
91
+ $templateCode = 'catalog/emark_cartalert/template';
92
+ if ('second' == $this->getFollowUp())
93
+ $templateCode .= '2';
94
+ elseif ('third' == $this->getFollowUp())
95
+ $templateCode .= '3';
96
+
97
+ // added in 0.2.2
98
+ $couponCode = '';
99
+ if ($this->getFollowUp() == Mage::getStoreConfig('catalog/emark_cartalert/coupon_step', $store)) {
100
+ $couponCode = $this->_createCoupon($store);
101
+ }
102
+
103
+ $tplVars = array(
104
+ 'website_name' => $store->getWebsite()->getName(),
105
+ 'group_name' => $store->getGroup()->getName(),
106
+ 'store_name' => $store->getName(),
107
+ 'store_url' => $url,
108
+ 'products' => $this->getProducts(),
109
+ 'customer_name'=> $this->getCustomerName(),
110
+ 'recover_url' => $url . 'alerts/recover/cart/id/'.$history->getId().'/code/'.$history->getRecoverCode(),
111
+ 'real_quote' => $history->getQuoteId(),
112
+ 'coupon' => $couponCode,
113
+ 'coupon_days' => Mage::getStoreConfig('catalog/emark_cartalert/coupon_days', $store),
114
+ );
115
+ if(version_compare(Mage::getVersion(), '1.7', '<'))
116
+ {
117
+ $tplVars['logo_url'] = Mage::getDesign()->getSkinUrl('images/logo_email.gif', array('_area'=>'frontend'));
118
+ $tplVars['logo_alt'] = '';
119
+ }
120
+
121
+ $tpl->setDesignConfig(array('area'=>'frontend', 'store'=>$storeId))
122
+ ->sendTransactional(
123
+ Mage::getStoreConfig($templateCode, $store),
124
+ Mage::getStoreConfig('catalog/emark_cartalert/identity', $store),
125
+ $this->getCustomerEmail(),
126
+ $this->getCustomerName(),
127
+ $tplVars
128
+ );
129
+ $bccEmail = Mage::getStoreConfig('catalog/emark_cartalert/bcc');
130
+ if($bccEmail)
131
+ {
132
+ $tpl->setDesignConfig(array('area'=>'frontend', 'store'=>$storeId))
133
+ ->sendTransactional(
134
+ Mage::getStoreConfig($templateCode, $store),
135
+ Mage::getStoreConfig('catalog/emark_cartalert/identity', $store),
136
+ $bccEmail,
137
+ $this->getCustomerName(),
138
+ $tplVars
139
+ );
140
+ }
141
+ }
142
+ catch (Exception $e){
143
+ //todo: remove coupon if any
144
+ $history->delete();
145
+ }
146
+ }
147
+
148
+ Mage::app()->setCurrentStore($oldStore);
149
+
150
+ $translate->setTranslateInline(true);
151
+
152
+ if(strlen($this->getProducts())>0)
153
+ {
154
+ $isSent = $tpl->getSentSuccess();
155
+ if (!$isSent){
156
+ $this->setStatus('invalid')->save();
157
+ }
158
+
159
+ return $isSent;
160
+ }
161
+ else
162
+ {
163
+ return 1;
164
+ }
165
+ }
166
+
167
+ public function getCustomerName(){
168
+ if (!$this->getCustomerFname() && !$this->getCustomerFname())
169
+ return Mage::helper('emark_cartalert')->__('Friend');
170
+ return $this->getCustomerFname() . ' ' . $this->getCustomerLname();
171
+ }
172
+
173
+ protected function _createCoupon($store)
174
+ {
175
+ $couponData = array();
176
+ $couponData['name'] = 'Alert #' . $this->getId();
177
+ $couponData['is_active'] = 1;
178
+ $couponData['website_ids'] = array(0 => $store->getWebsiteId());
179
+ $couponData['coupon_code'] = strtoupper($this->getId() . uniqid()); // todo check for uniq in DB
180
+ $couponData['uses_per_coupon'] = 1;
181
+ $couponData['uses_per_customer'] = 1;
182
+ $couponData['from_date'] = ''; //current date
183
+
184
+ $days = Mage::getStoreConfig('catalog/emark_cartalert/coupon_days', $store);
185
+ $date = date('Y-m-d', Mage::getModel('core/date')->timestamp(time() + $days*24*3600));
186
+ $couponData['to_date'] = $date;
187
+
188
+ $couponData['uses_per_customer'] = 1;
189
+ $couponData['simple_action'] = Mage::getStoreConfig('catalog/emark_cartalert/coupon_type', $store);
190
+ $couponData['discount_amount'] = Mage::getStoreConfig('catalog/emark_cartalert/coupon_amount', $store);
191
+ $couponData['conditions'] = array(
192
+ 1 => array(
193
+ 'type' => 'salesrule/rule_condition_combine',
194
+ 'aggregator' => 'all',
195
+ 'value' => 1,
196
+ 'new_child' =>'',
197
+ )
198
+ );
199
+
200
+ $couponData['actions'] = array(
201
+ 1 => array(
202
+ 'type' => 'salesrule/rule_condition_product_combine',
203
+ 'aggregator' => 'all',
204
+ 'value' => 1,
205
+ 'new_child' =>'',
206
+ )
207
+ );
208
+
209
+ //create for all customer groups
210
+ $couponData['customer_group_ids'] = array();
211
+
212
+ $customerGroups = Mage::getResourceModel('customer/group_collection')
213
+ ->load();
214
+
215
+ $found = false;
216
+ foreach ($customerGroups as $group) {
217
+ if (0 == $group->getId()) {
218
+ $found = true;
219
+ }
220
+ $couponData['customer_group_ids'][] = $group->getId();
221
+ }
222
+ if (!$found) {
223
+ $couponData['customer_group_ids'][] = 0;
224
+ }
225
+
226
+ if(!version_compare(Mage::getVersion(), '1.4.1.0', '<'))
227
+ {
228
+ $couponData['coupon_type'] = 2; // Need to use coupon code - fix for 1.4.1.0
229
+ }
230
+ try {
231
+ Mage::getModel('salesrule/rule')
232
+ ->loadPost($couponData)
233
+ ->save();
234
+ }
235
+ catch (Exception $e){
236
+ //print_r($e); exit;
237
+ $couponData['coupon_code'] = '';
238
+ }
239
+
240
+ return $couponData['coupon_code'];
241
+
242
+ }
243
+ }
app/code/community/Emark/Cartalert/Model/History.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Emark_Cartalert_Model_History extends Mage_Core_Model_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->_init('emark_cartalert/history');
8
+ }
9
+ }
app/code/community/Emark/Cartalert/Model/Mysql4/Cartalert.php ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Cartalert module observer
4
+ *
5
+ * @author Emark
6
+ */
7
+ class Emark_Cartalert_Model_Mysql4_Cartalert extends Mage_Core_Model_Mysql4_Abstract
8
+ {
9
+ protected $_select;
10
+
11
+ public function _construct()
12
+ {
13
+ $this->_init('emark_cartalert/cartalert', 'cartalert_id');
14
+ }
15
+
16
+
17
+ private function _getAbandonedCartsIds($fromDate, $toDate){
18
+ $db = $this->_getReadAdapter();
19
+ $sql = $db->select()
20
+ ->from(array('q' => $this->getTable('sales/quote')), array('q.entity_id'))
21
+ ->where('q.updated_at > ?', $fromDate)
22
+ ->where('q.updated_at < ?', $toDate)
23
+ ->where('q.is_active=1');
24
+ $result = $db->fetchAll($sql);
25
+ $ids = array();
26
+ foreach ($result as $row)
27
+ $ids[] = $row['entity_id'];
28
+
29
+ return $ids;
30
+ }
31
+
32
+ private function _getAbandonedCartsContent($ids){
33
+ $db = $this->_getReadAdapter();
34
+
35
+ $fields = array(
36
+ 'store_id' => 'q.store_id',
37
+ 'quote_id' => 'q.entity_id',
38
+ 'customer_id' => 'q.customer_id',
39
+ 'customer_email' => new Zend_Db_Expr('IFNULL(q.customer_email, ba.email)'),
40
+ 'customer_fname' => new Zend_Db_Expr('IFNULL(q.customer_firstname, ba.firstname)'),
41
+ 'customer_lname' => new Zend_Db_Expr('IFNULL(q.customer_lastname, ba.lastname)'),
42
+ 'products' => new Zend_Db_Expr('GROUP_CONCAT(CONCAT(i.product_id,"##,",i.name,"##"))'),
43
+ 'abandoned_at' => 'q.updated_at',
44
+ );
45
+ $this->_select = $db->select()
46
+ ->from(array('q' => $this->getTable('sales/quote')), $fields)
47
+ ->joinInner(array('i' => $this->getTable('sales/quote_item')), 'q.entity_id=i.quote_id', array())
48
+ ->joinLeft(array('ba' => $this->getTable('sales/quote_address')), 'q.entity_id=ba.quote_id AND ba.address_type="billing"', array())
49
+ ->where('q.entity_id IN(?)', $ids)
50
+ ->where('IFNULL(q.customer_email, ba.email) IS NOT NULL')
51
+ ->where('i.parent_item_id IS NULL')
52
+ ->where('q.allow_alerts = 1')
53
+ ->group('q.entity_id')
54
+ ->limit(50);
55
+ $this->_addFilter('status', Mage::getSingleton('catalog/product_status')->getVisibleStatusIds());
56
+
57
+ return $db->fetchAll($this->_select);
58
+ }
59
+
60
+ private function _updateDates($now){
61
+ $timeout = intVal(Mage::getStoreConfig('catalog/emark_cartalert/timeout'));
62
+
63
+ $toDate = date('Y-m-d H:i:s', strtotime($now) - 60*$timeout);
64
+ $fromDate = $this->_loadFromDate();
65
+
66
+ $this->_saveFromDate($toDate);
67
+
68
+ return array($fromDate, $toDate);
69
+ }
70
+
71
+ public function generate($now){
72
+
73
+ list($fromDate, $toDate) = $this->_updateDates($now);
74
+ $ids = $this->_getAbandonedCartsIds($fromDate, $toDate);
75
+
76
+ if (!$ids)
77
+ return array($fromDate, $toDate);
78
+
79
+ $carts = $this->_getAbandonedCartsContent($ids);
80
+ if (!$carts)
81
+ return array($fromDate, $toDate);
82
+
83
+ $db = $this->_getReadAdapter();
84
+
85
+ $insertSql = 'INSERT INTO ' . $this->getMainTable() . '(' . join(',', array_keys($carts[0])) . ', follow_up, sheduled_at) VALUES ';
86
+
87
+ foreach ($carts as $row){
88
+ $vals = '';
89
+ foreach ($row as $field){
90
+ $vals .= $db->quote($field) . ',';
91
+ }
92
+
93
+ $abandoned_at = strtotime($row['abandoned_at']);
94
+
95
+ $delay = Mage::getStoreConfig('catalog/emark_cartalert/delay', $row['store_id']);
96
+ if ($delay){
97
+ $sheduled_at = date('Y-m-d H:i:s', $abandoned_at + $delay*60);
98
+ $insertSql .= "($vals 'first', '$sheduled_at'),";
99
+ }
100
+
101
+ $delay2 = Mage::getStoreConfig('catalog/emark_cartalert/delay2', $row['store_id']);
102
+ if ($delay2){
103
+ $sheduled_at = date('Y-m-d H:i:s', $abandoned_at + $delay2*3600);
104
+ $insertSql .= "($vals 'second', '$sheduled_at'),";
105
+ }
106
+
107
+ $delay3 = Mage::getStoreConfig('catalog/emark_cartalert/delay3', $row['store_id']);
108
+ if ($delay3){
109
+ $sheduled_at = date('Y-m-d H:i:s', $abandoned_at + $delay3*3600);
110
+ $insertSql .= "($vals 'third', '$sheduled_at'),";
111
+ }
112
+
113
+ $dbw = $this->_getWriteAdapter();
114
+ $sql = 'UPDATE ' . $this->getTable('sales/quote') . ' SET `allow_alerts` = "0"'
115
+ . ' WHERE entity_id="' . $row['quote_id'] . '"'
116
+ . ' LIMIT 1';
117
+ $dbw->query($sql);
118
+
119
+ }
120
+
121
+ $db->raw_query(substr($insertSql, 0, -1));
122
+
123
+ return array($fromDate, $toDate);
124
+ }
125
+
126
+
127
+ private function _loadFromDate(){
128
+ $db = $this->_getReadAdapter();
129
+ $sql = 'SELECT value FROM ' . $this->getTable('core/config_data')
130
+ . ' WHERE scope="default" AND path="catalog/emark_cartalert/from_date"'
131
+ . ' LIMIT 1';
132
+ return $db->fetchOne($sql);
133
+ }
134
+
135
+ private function _saveFromDate($toDate){
136
+ $db = $this->_getWriteAdapter();
137
+ $sql = 'UPDATE ' . $this->getTable('core/config_data') . ' SET `value` = "'. $toDate .'"'
138
+ . ' WHERE scope="default" AND path="catalog/emark_cartalert/from_date"'
139
+ . ' LIMIT 1';
140
+ $db->query($sql);
141
+ }
142
+
143
+ protected function _addFilter($attributeCode, $value)
144
+ {
145
+ $attribute = Mage::getSingleton('catalog/product')->getResource()->getAttribute($attributeCode);
146
+ $t = 't1_'.$attributeCode;
147
+ $t2 = 't2_'.$attributeCode;
148
+
149
+ $this->_select->join(
150
+ array($t => $attribute->getBackend()->getTable()),
151
+ 'i.product_id='.$t.'.entity_id AND '.$t.'.store_id=0',
152
+ array()
153
+ )
154
+ ->joinLeft(
155
+ array($t2 => $attribute->getBackend()->getTable()),
156
+ $t.'.entity_id = '.$t2.'.entity_id AND '.$t.'.attribute_id = '.$t2.'.attribute_id AND '.$t2.'.store_id=q.store_id',
157
+ array()
158
+ )
159
+ ->where($t.'.attribute_id=?', $attribute->getId())
160
+ ->where('IFNULL('.$t2.'.value, '.$t.'.value) IN(?)', $value);
161
+
162
+ return true;
163
+ }
164
+
165
+ public function cancelAlertsFor($email){
166
+ $db = $this->_getWriteAdapter();
167
+ $db->delete($this->getMainTable(), 'customer_email = ' . $db->quote($email));
168
+ }
169
+ }
app/code/community/Emark/Cartalert/Model/Mysql4/Cartalert/Collection.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Emark_Cartalert_Model_Mysql4_Cartalert_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->_init('emark_cartalert/cartalert');
8
+ }
9
+
10
+ public function addReadyForSendingFilter()
11
+ {
12
+ $this->getSelect()->where('sheduled_at < ?',now());
13
+ //->where('status = ?', 'pending');
14
+ return $this;
15
+ }
16
+ }
app/code/community/Emark/Cartalert/Model/Mysql4/History.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Emark_Cartalert_Model_Mysql4_History extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ $this->_init('emark_cartalert/history', 'id');
7
+ }
8
+ }
app/code/community/Emark/Cartalert/Model/Mysql4/History/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Emark_Cartalert_Model_Mysql4_History_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('emark_cartalert/history');
9
+ }
10
+ }
app/code/community/Emark/Cartalert/Model/Observer.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Emark_Cartalert_Model_Observer
3
+ {
4
+ public function createCartalerts()
5
+ {
6
+ $cartalert = Mage::getModel('emark_cartalert/cartalert');
7
+ $cartalert->generate(date('Y-m-d H:i:s'));
8
+
9
+ $this->sendCartalerts();
10
+
11
+ return $this;
12
+ }
13
+
14
+ public function sendCartalerts()
15
+ {
16
+ if (!Mage::getStoreConfig('catalog/emark_cartalert/sending_enabled'))
17
+ return $this;
18
+
19
+ $collection = Mage::getModel('emark_cartalert/cartalert')->getCollection()
20
+ ->addReadyForSendingFilter()
21
+ ->setPageSize(50)
22
+ ->setCurPage(1)
23
+ ->load();
24
+ foreach ($collection as $cartalert){
25
+ if ($cartalert->send()){
26
+ $cartalert->delete();
27
+ }
28
+ }
29
+ return $this;
30
+ }
31
+
32
+ public function processOrderCreated($observer){
33
+ $order = $observer->getEvent()->getOrder();
34
+
35
+ if (Mage::getStoreConfig('catalog/emark_cartalert/stop_after_order')){
36
+ $cartalert = Mage::getResourceModel('emark_cartalert/cartalert')
37
+ ->cancelAlertsFor($order->getCustomerEmail());
38
+ }
39
+ return $this;
40
+
41
+ }
42
+
43
+ public function updateAlertsStatus($observer)
44
+ {
45
+ if (!Mage::registry('alerts_status_updated'))
46
+ {
47
+ Mage::register('alerts_status_updated', true);
48
+
49
+ $quote = Mage::getSingleton('checkout/session')->getQuote();
50
+
51
+ if ($quote)
52
+ {
53
+ $quote->setAllowAlerts(1);
54
+
55
+ if (Mage::getStoreConfig('catalog/emark_cartalert/stop_after_order')){
56
+ $cartalert = Mage::getResourceModel('emark_cartalert/cartalert')
57
+ ->cancelAlertsFor($quote->getCustomerEmail());
58
+ }
59
+ }
60
+ }
61
+
62
+ return $this;
63
+ }
64
+ }
app/code/community/Emark/Cartalert/Model/Source/Discount.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Emark_Cartalert_Model_Source_Discount extends Varien_Object
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ $vals = array(
7
+ 'by_percent' => Mage::helper('salesrule')->__('Percent of product price discount'),
8
+ 'by_fixed' => Mage::helper('salesrule')->__('Fixed amount discount'),
9
+ 'cart_fixed' => Mage::helper('salesrule')->__('Fixed amount discount for whole cart'),
10
+ );
11
+
12
+ $options = array();
13
+ foreach ($vals as $k => $v)
14
+ $options[] = array(
15
+ 'value' => $k,
16
+ 'label' => $v
17
+ );
18
+
19
+ return $options;
20
+ }
21
+ }
app/code/community/Emark/Cartalert/Model/Source/Step.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Emark_Cartalert_Model_Source_Step extends Varien_Object
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ $options = array(
7
+ 0 => array(
8
+ 'value' => '',
9
+ 'label' => '-'
10
+ )
11
+ );
12
+
13
+ foreach (array('first','second','third') as $step)
14
+ $options[] = array(
15
+ 'value'=> $step,
16
+ 'label' => Mage::helper('emark_cartalert')->__(ucfirst($step). ' Email Template')
17
+ );
18
+
19
+ return $options;
20
+ }
21
+ }
app/code/community/Emark/Cartalert/controllers/Adminhtml/CartalertController.php ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Emark_Cartalert_Adminhtml_CartalertController extends Mage_Adminhtml_Controller_action
4
+ {
5
+ public function indexAction() {
6
+ $this->loadLayout();
7
+ $this->_setActiveMenu('newsletter/emark_cartalert/alerts');
8
+ $this->_addBreadcrumb($this->__('Carts Alerts'), $this->__('Carts Alerts'));
9
+ $this->_addContent($this->getLayout()->createBlock('emark_cartalert/adminhtml_cartalert'));
10
+ $this->renderLayout();
11
+ }
12
+
13
+ public function editAction() {
14
+ $id = $this->getRequest()->getParam('id');
15
+ $model = Mage::getModel('emark_cartalert/cartalert')->load($id);
16
+ $model->preprocess();
17
+
18
+ if ($model->getId() || $id == 0) {
19
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
20
+ if (!empty($data)) {
21
+ $model->setData($data);
22
+ }
23
+
24
+ Mage::register('cartalert_data', $model);
25
+
26
+ $this->loadLayout();
27
+ $this->_setActiveMenu('newsletter/emark_cartalert/alerts');
28
+
29
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
30
+
31
+ $this->_addContent($this->getLayout()->createBlock('emark_cartalert/adminhtml_cartalert_edit'));
32
+
33
+ $this->renderLayout();
34
+ } else {
35
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('emark_cartalert')->__('Item does not exist'));
36
+ $this->_redirect('*/*/');
37
+ }
38
+ }
39
+
40
+ public function newAction() {
41
+ $this->editAction();
42
+ }
43
+
44
+ public function saveAction() {
45
+ $id = $this->getRequest()->getParam('id');
46
+ $model = Mage::getModel('emark_cartalert/cartalert');
47
+ if ($data = $this->getRequest()->getPost()) {
48
+ $model->setData($data)->setId($id);
49
+ try {
50
+ $format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
51
+ if ($date = $model->getData('sheduled_at')) {
52
+ $model->setData('sheduled_at', Mage::app()->getLocale()->date($date, $format, null, false)
53
+ ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
54
+ }
55
+ else {
56
+ $model->setData('sheduled_at', now());
57
+ }
58
+
59
+ $model->save();
60
+ if($this->getRequest()->getParam('send')) {
61
+ if($model->load($id)->send()){
62
+ $model->delete();
63
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('emark_cartalert')->__('Alert has been successfully sent and deleted'));
64
+ }
65
+ else{
66
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('emark_cartalert')->__('Can not send the ID %d. Please check the email address and your server configuration', $id));
67
+ }
68
+ }
69
+ else {
70
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('emark_cartalert')->__('Alert has been successfully saved'));
71
+ }
72
+
73
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
74
+
75
+ $this->_redirect('*/*/');
76
+ return;
77
+ } catch (Exception $e) {
78
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
79
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
80
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
81
+ return;
82
+ }
83
+ }
84
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('emark_cartalert')->__('Unable to find item to save'));
85
+ $this->_redirect('*/*/');
86
+ }
87
+
88
+ public function massDeleteAction()
89
+ {
90
+ $ids = $this->getRequest()->getParam('cartalert');
91
+ if(!is_array($ids)) {
92
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('emark_cartalert')->__('Please select cartalert(s)'));
93
+ } else {
94
+ try {
95
+ foreach ($ids as $id) {
96
+ $model = Mage::getModel('emark_cartalert/cartalert')->load($id);
97
+ $model->delete();
98
+ }
99
+ Mage::getSingleton('adminhtml/session')->addSuccess(
100
+ Mage::helper('adminhtml')->__(
101
+ 'Total of %d record(s) were successfully deleted', count($ids)
102
+ )
103
+ );
104
+ } catch (Exception $e) {
105
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
106
+ }
107
+ }
108
+ $this->_redirect('*/*/');
109
+ }
110
+
111
+ public function massSendAction()
112
+ {
113
+ $ids = $this->getRequest()->getParam('cartalert');
114
+ if(!is_array($ids)) {
115
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('emark_cartalert')->__('Please select cartalert(s)'));
116
+ } else {
117
+ try {
118
+ $total = 0;
119
+ $totalIgnored = 0;
120
+ foreach ($ids as $id) {
121
+ $model = Mage::getModel('emark_cartalert/cartalert')->load($id);
122
+
123
+ $res = $model->send();
124
+
125
+ if($res === true){
126
+ $model->delete();
127
+ $total++;
128
+ }
129
+ elseif($res === 1)
130
+ {
131
+ $model->delete();
132
+ $totalIgnored++;
133
+ }
134
+ else {
135
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('emark_cartalert')->__('Can not send the alert ID %d. Please check the email address and your server configuration', $id));
136
+ }
137
+ }
138
+ if ($total){
139
+ Mage::getSingleton('adminhtml/session')->addSuccess(
140
+ Mage::helper('adminhtml')->__(
141
+ 'Total of %d email(s) have been successfully sent', $total
142
+ )
143
+ );
144
+ }
145
+ if($totalIgnored)
146
+ {
147
+ Mage::getSingleton('adminhtml/session')->addWarning(
148
+ Mage::helper('adminhtml')->__(
149
+ 'Total of %d email(s) haven\'t been successfully sent: no visible products', $totalIgnored
150
+ )
151
+ );
152
+ }
153
+ } catch (Exception $e) {
154
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
155
+ }
156
+ }
157
+ $this->_redirect('*/*/');
158
+ }
159
+
160
+ public function deleteAction() {
161
+ if( $this->getRequest()->getParam('id') > 0 ) {
162
+ try {
163
+ $model = Mage::getModel('emark_cartalert/cartalert');
164
+
165
+ $model->setId($this->getRequest()->getParam('id'))
166
+ ->delete();
167
+
168
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('emark_cartalert')->__('Alert has been deleted'));
169
+ $this->_redirect('*/*/');
170
+ } catch (Exception $e) {
171
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
172
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
173
+ }
174
+ }
175
+ $this->_redirect('*/*/');
176
+ }
177
+
178
+ public function generateAction() {
179
+ try {
180
+ $model = Mage::getModel('emark_cartalert/cartalert');
181
+ list($from, $to) = $model->generate(now());
182
+
183
+ $format = Mage_Core_Model_Locale::FORMAT_TYPE_SHORT;
184
+ $from = Mage::helper('core')->formatDate($from, $format, true);
185
+ $to = Mage::helper('core')->formatDate($to, $format, true);
186
+
187
+ Mage::getSingleton('adminhtml/session')->addSuccess(
188
+ Mage::helper('emark_cartalert')->__('Alerts for carts abandoned from %s to %s have been successfully added to the queue',
189
+ $from, $to)
190
+ );
191
+ } catch (Exception $e) {
192
+ Mage::getSingleton('adminhtml/session')->addError(
193
+ Mage::helper('emark_cartalert')->__('Unable to update queue')
194
+ );
195
+ throw $e;
196
+ }
197
+ $this->_redirect('*/*/');
198
+ }
199
+ }
app/code/community/Emark/Cartalert/controllers/Adminhtml/HistoryController.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Emark_Cartalert_Adminhtml_HistoryController extends Mage_Adminhtml_Controller_action
4
+ {
5
+ public function indexAction() {
6
+ $this->loadLayout();
7
+ $this->_setActiveMenu('newsletter/emark_cartalert/history');
8
+ $this->_addBreadcrumb($this->__('Carts Alerts'), $this->__('History'));
9
+ $this->_addContent($this->getLayout()->createBlock('emark_cartalert/adminhtml_history'));
10
+ $this->renderLayout();
11
+ }
12
+
13
+ public function editAction() {
14
+ $id = $this->getRequest()->getParam('id');
15
+ $model = Mage::getModel('emark_cartalert/history')->load($id);
16
+
17
+ if (!$model->getId()) {
18
+ $this->_redirect('*/*/');
19
+ }
20
+ Mage::register('history_data', $model);
21
+
22
+ $this->loadLayout();
23
+ $this->_setActiveMenu('newsletter/emark_cartalert/history');
24
+ $this->_addContent($this->getLayout()->createBlock('emark_cartalert/adminhtml_history_edit'));
25
+ $this->renderLayout();
26
+ }
27
+
28
+ public function massDeleteAction()
29
+ {
30
+ $ids = $this->getRequest()->getParam('cartalert');
31
+ if (!is_array($ids)) {
32
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('emark_cartalert')->__('Please select cartalert(s)'));
33
+ } else {
34
+ try {
35
+ foreach ($ids as $id) {
36
+ $model = Mage::getModel('emark_cartalert/history')->load($id);
37
+ $model->delete();
38
+ }
39
+ Mage::getSingleton('adminhtml/session')->addSuccess(
40
+ Mage::helper('adminhtml')->__(
41
+ 'Total of %d record(s) were successfully deleted', count($ids)
42
+ )
43
+ );
44
+ } catch (Exception $e) {
45
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
46
+ }
47
+ }
48
+ $this->_redirect('*/*/');
49
+ }
50
+
51
+ public function deleteAction() {
52
+ if ($this->getRequest()->getParam('id') > 0 ) {
53
+ try {
54
+ $model = Mage::getModel('emark_cartalert/history');
55
+ $model->setId($this->getRequest()->getParam('id'))
56
+ ->delete();
57
+
58
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('emark_cartalert')->__('Alert has been deleted'));
59
+ $this->_redirect('*/*/');
60
+ } catch (Exception $e) {
61
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
62
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
63
+ }
64
+ }
65
+ $this->_redirect('*/*/');
66
+ }
67
+
68
+ }
app/code/community/Emark/Cartalert/controllers/RecoverController.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Emark_Cartalert_RecoverController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function cartAction()
5
+ {
6
+ $code = (string) $this->getRequest()->getParam('code');
7
+ $id = (int) $this->getRequest()->getParam('id');
8
+
9
+ $history = Mage::getModel('emark_cartalert/history')->load($id);
10
+ if (!$history->getId() || $history->getRecoverCode() != $code){
11
+ $this->_redirect('/');
12
+ return;
13
+ }
14
+
15
+ $s = Mage::getSingleton('customer/session');
16
+ if ($s->isLoggedIn()){
17
+ if ($history->getCustomerId() == $s->getCustomerId()){
18
+ $this->redirectToCart($history);
19
+ return;
20
+ }
21
+ else
22
+ $s->logout();
23
+ }
24
+ // customer. login
25
+ if ($history->getCustomerId()){
26
+ $customer = Mage::getModel('customer/customer')->load($history->getCustomerId());
27
+ if ($customer->getId())
28
+ $s->setCustomerAsLoggedIn($customer);
29
+ }
30
+ elseif ($history->getQuoteId()){
31
+ //visitor. restore quote in the session
32
+ $quote = Mage::getModel('sales/quote')->load($history->getQuoteId());
33
+ if ($quote){
34
+ Mage::getSingleton('checkout/session')->replaceQuote($quote);
35
+ }
36
+
37
+ }
38
+
39
+ $this->redirectToCart($history);
40
+ }
41
+
42
+ private function redirectToCart($history){
43
+ if (!is_null($history)){
44
+ $history->setRecoveredAt(now());
45
+ if (isset($_SERVER['REMOTE_ADDR'])) {
46
+ $history->setRecoveredFrom($_SERVER['REMOTE_ADDR']);
47
+ }
48
+
49
+ if (Mage::getStoreConfig('catalog/emark_cartalert/stop_after_visit')){
50
+ $cartalert = Mage::getResourceModel('emark_cartalert/cartalert')
51
+ ->cancelAlertsFor($history->getCustomerEmail());
52
+ }
53
+
54
+ $history->save();
55
+ }
56
+
57
+ $this->_redirect('checkout/cart');
58
+ }
59
+ }
app/code/community/Emark/Cartalert/etc/config.xml ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Emark_Cartalert>
5
+ <version>0.1.0</version>
6
+ </Emark_Cartalert>
7
+ </modules>
8
+ <admin>
9
+ <routers>
10
+ <emark_cartalert>
11
+ <use>admin</use>
12
+ <args>
13
+ <module>Emark_Cartalert</module>
14
+ <frontName>emark_cartalert</frontName>
15
+ </args>
16
+ </emark_cartalert>
17
+ </routers>
18
+ </admin>
19
+ <adminhtml>
20
+ <menu>
21
+ <newsletter>
22
+ <children>
23
+ <emark_cartalert translate="title" module="emark_cartalert">
24
+ <title>Abandoned Carts Alerts</title>
25
+ <sort_order>100</sort_order>
26
+ <children>
27
+ <alerts translate="title" module="emark_cartalert">
28
+ <title>Pending Alerts</title>
29
+ <action>emark_cartalert/adminhtml_cartalert</action>
30
+ </alerts>
31
+ <history translate="title" module="emark_cartalert">
32
+ <title>History</title>
33
+ <action>emark_cartalert/adminhtml_history</action>
34
+ </history>
35
+ </children>
36
+ </emark_cartalert>
37
+ </children>
38
+ </newsletter>
39
+ </menu>
40
+ <acl>
41
+ <resources>
42
+ <admin>
43
+ <children>
44
+ <newsletter>
45
+ <children>
46
+ <emark_cartalert translate="title">
47
+ <title>Abandoned Carts Alerts</title>
48
+ <sort_order>100</sort_order>
49
+ <children>
50
+ <alerts translate="title" module="emark_cartalert">
51
+ <title>Pending Alerts</title>
52
+ </alerts>
53
+ <history translate="title" module="emark_cartalert">
54
+ <title>History</title>
55
+ </history>
56
+ </children>
57
+ </emark_cartalert>
58
+ </children>
59
+ </newsletter>
60
+ </children>
61
+ </admin>
62
+ </resources>
63
+ </acl>
64
+ <translate>
65
+ <modules>
66
+ <Emark_Cartalert>
67
+ <files>
68
+ <default>Emark_Cartalert.csv</default>
69
+ </files>
70
+ </Emark_Cartalert>
71
+ </modules>
72
+ </translate>
73
+ </adminhtml>
74
+ <frontend>
75
+ <routers>
76
+ <emark_cartalert>
77
+ <use>standard</use>
78
+ <args>
79
+ <module>Emark_Cartalert</module>
80
+ <frontName>alerts</frontName>
81
+ </args>
82
+ </emark_cartalert>
83
+ </routers>
84
+ </frontend>
85
+ <global>
86
+ <models>
87
+ <emark_cartalert>
88
+ <class>Emark_Cartalert_Model</class>
89
+ <resourceModel>emark_cartalert_mysql4</resourceModel>
90
+ </emark_cartalert>
91
+ <emark_cartalert_mysql4>
92
+ <class>Emark_Cartalert_Model_Mysql4</class>
93
+ <entities>
94
+ <cartalert>
95
+ <table>emark_cartalert</table>
96
+ </cartalert>
97
+ <history>
98
+ <table>emark_cartalert_history</table>
99
+ </history>
100
+ </entities>
101
+ </emark_cartalert_mysql4>
102
+ </models>
103
+ <resources>
104
+ <emark_cartalert_setup>
105
+ <setup>
106
+ <module>Emark_Cartalert</module>
107
+ </setup>
108
+ <connection>
109
+ <use>core_setup</use>
110
+ </connection>
111
+ </emark_cartalert_setup>
112
+ <emark_cartalert_write>
113
+ <connection>
114
+ <use>core_write</use>
115
+ </connection>
116
+ </emark_cartalert_write>
117
+ <emark_cartalert_read>
118
+ <connection>
119
+ <use>core_read</use>
120
+ </connection>
121
+ </emark_cartalert_read>
122
+ </resources>
123
+ <blocks>
124
+ <emark_cartalert>
125
+ <class>Emark_Cartalert_Block</class>
126
+ </emark_cartalert>
127
+ <checkout>
128
+ <rewrite>
129
+ <onepage>Emark_Cartalert_Block_Rewrite_FrontCheckoutOnepage</onepage>
130
+ </rewrite>
131
+ </checkout>
132
+ </blocks>
133
+ <helpers>
134
+ <emark_cartalert>
135
+ <class>Emark_Cartalert_Helper</class>
136
+ </emark_cartalert>
137
+ </helpers>
138
+ <template>
139
+ <email>
140
+ <catalog_emark_cartalert_template translate="label" module="emark_cartalert">
141
+ <label>Abandoned Cart: The First Follow Up</label>
142
+ <file>abandoned_cart_alert.html</file>
143
+ <type>html</type>
144
+ </catalog_emark_cartalert_template>
145
+ <catalog_emark_cartalert_template2 translate="label" module="emark_cartalert">
146
+ <label>Abandoned Cart: The Second Follow Up</label>
147
+ <file>abandoned_cart_alert2.html</file>
148
+ <type>html</type>
149
+ </catalog_emark_cartalert_template2>
150
+ <catalog_emark_cartalert_template3 translate="label" module="emark_cartalert">
151
+ <label>Abandoned Cart: The Third Follow Up</label>
152
+ <file>abandoned_cart_alert3.html</file>
153
+ <type>html</type>
154
+ </catalog_emark_cartalert_template3>
155
+ </email>
156
+ </template>
157
+ <events>
158
+ <checkout_type_onepage_save_order_after>
159
+ <observers>
160
+ <emark_cartalert>
161
+ <type>singleton</type>
162
+ <class>emark_cartalert/observer</class>
163
+ <method>processOrderCreated</method>
164
+ </emark_cartalert>
165
+ </observers>
166
+ </checkout_type_onepage_save_order_after>
167
+ <checkout_type_multishipping_create_orders_single>
168
+ <observers>
169
+ <emark_cartalert>
170
+ <type>singleton</type>
171
+ <class>emark_cartalert/observer</class>
172
+ <method>processOrderCreated</method>
173
+ </emark_cartalert>
174
+ </observers>
175
+ </checkout_type_multishipping_create_orders_single>
176
+ <sales_quote_add_item>
177
+ <observers>
178
+ <emark_cartalert>
179
+ <type>singleton</type>
180
+ <class>emark_cartalert/observer</class>
181
+ <method>updateAlertsStatus</method>
182
+ </emark_cartalert>
183
+ </observers>
184
+ </sales_quote_add_item>
185
+ <sales_quote_remove_item>
186
+ <observers>
187
+ <emark_cartalert>
188
+ <type>singleton</type>
189
+ <class>emark_cartalert/observer</class>
190
+ <method>updateAlertsStatus</method>
191
+ </emark_cartalert>
192
+ </observers>
193
+ </sales_quote_remove_item>
194
+ </events>
195
+ </global>
196
+ <crontab>
197
+ <jobs>
198
+ <emark_cartalert_create>
199
+ <schedule>
200
+ <cron_expr>*/4 * * * *</cron_expr>
201
+ </schedule>
202
+ <run>
203
+ <model>emark_cartalert/observer::createCartalerts</model>
204
+ </run>
205
+ </emark_cartalert_create>
206
+ </jobs>
207
+ </crontab>
208
+ <default>
209
+ <catalog>
210
+ <emark_cartalert>
211
+ <sending_enabled>0</sending_enabled>
212
+ <timeout>10</timeout>
213
+ <delay>45</delay>
214
+ <delay2>24</delay2>
215
+ <delay3>0</delay3>
216
+ <identity>general</identity>
217
+ <template>catalog_emark_cartalert_template</template>
218
+ <template2>catalog_emark_cartalert_template2</template2>
219
+ <template3>catalog_emark_cartalert_template3</template3>
220
+ <stop_after_order>1</stop_after_order>
221
+ <stop_after_visit>1</stop_after_visit>
222
+ <coupon_step>none</coupon_step>
223
+ <coupon_type>by_percent</coupon_type>
224
+ <coupon_amount>5</coupon_amount>
225
+ <coupon_days>1</coupon_days>
226
+ </emark_cartalert>
227
+ </catalog>
228
+ </default>
229
+ </config>
app/code/community/Emark/Cartalert/etc/system.xml ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <catalog>
5
+ <groups>
6
+ <emark_cartalert translate="label comment" module="emark_cartalert">
7
+ <label>Abandoned Carts Alerts</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>900</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <fields>
14
+ <sending_enabled translate="label">
15
+ <label>Send E-mails</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>10</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>0</show_in_website>
21
+ <show_in_store>0</show_in_store>
22
+ <comment><![CDATA[If set to "No", alert emails will be generated, but won't be sent
23
+ automatically, while manual sending will be allowed]]></comment>
24
+ </sending_enabled>
25
+ <identity translate="label">
26
+ <label>Email Sender</label>
27
+ <frontend_type>select</frontend_type>
28
+ <source_model>adminhtml/system_config_source_email_identity</source_model>
29
+ <sort_order>20</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ </identity>
34
+ <delay translate="label">
35
+ <label>First Delay Period (minutes)</label>
36
+ <frontend_type>text</frontend_type>
37
+ <sort_order>30</sort_order>
38
+ <show_in_default>1</show_in_default>
39
+ <show_in_website>0</show_in_website>
40
+ <show_in_store>0</show_in_store>
41
+ <comment><![CDATA[The system will send the first follow up email after the above mentioned amount of minutes upon customer's last activity in the cart. Supported minimum is 10 minutes.]]></comment>
42
+ </delay>
43
+ <template translate="label">
44
+ <label>First Email Template</label>
45
+ <frontend_type>select</frontend_type>
46
+ <source_model>adminhtml/system_config_source_email_template</source_model>
47
+ <sort_order>40</sort_order>
48
+ <show_in_default>1</show_in_default>
49
+ <show_in_website>1</show_in_website>
50
+ <show_in_store>1</show_in_store>
51
+ </template>
52
+ <delay2 translate="label">
53
+ <label>Second Delay Period (hours)</label>
54
+ <frontend_type>text</frontend_type>
55
+ <sort_order>50</sort_order>
56
+ <show_in_default>1</show_in_default>
57
+ <show_in_website>0</show_in_website>
58
+ <show_in_store>0</show_in_store>
59
+ <comment><![CDATA[The system will send the second follow up email after the above mentioned amount of hours upon customer's last activity in the cart.]]></comment>
60
+ </delay2>
61
+ <template2 translate="label">
62
+ <label>Second Email Template</label>
63
+ <frontend_type>select</frontend_type>
64
+ <source_model>adminhtml/system_config_source_email_template</source_model>
65
+ <sort_order>60</sort_order>
66
+ <show_in_default>1</show_in_default>
67
+ <show_in_website>1</show_in_website>
68
+ <show_in_store>1</show_in_store>
69
+ </template2>
70
+ <delay3 translate="label">
71
+ <label>Third Delay Period (hours)</label>
72
+ <frontend_type>text</frontend_type>
73
+ <sort_order>70</sort_order>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>0</show_in_website>
76
+ <show_in_store>0</show_in_store>
77
+ <comment><![CDATA[The system will send the third follow up email after the above mentioned amount of hours upon customer's last activity in the cart.]]></comment>
78
+ </delay3>
79
+ <template3 translate="label">
80
+ <label>Third Email Template</label>
81
+ <frontend_type>select</frontend_type>
82
+ <source_model>adminhtml/system_config_source_email_template</source_model>
83
+ <sort_order>80</sort_order>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>1</show_in_website>
86
+ <show_in_store>1</show_in_store>
87
+ </template3>
88
+ <stop_after_order translate="label">
89
+ <label>Stop alerts sending once the recipient makes a purchase</label>
90
+ <frontend_type>select</frontend_type>
91
+ <source_model>adminhtml/system_config_source_yesno</source_model>
92
+ <sort_order>90</sort_order>
93
+ <show_in_default>1</show_in_default>
94
+ <show_in_website>0</show_in_website>
95
+ <show_in_store>0</show_in_store>
96
+ </stop_after_order>
97
+ <stop_after_visit translate="label">
98
+ <label>Stop alerts sending once the recipient clicks a link in an email</label>
99
+ <frontend_type>select</frontend_type>
100
+ <source_model>adminhtml/system_config_source_yesno</source_model>
101
+ <sort_order>90</sort_order>
102
+ <show_in_default>1</show_in_default>
103
+ <show_in_website>0</show_in_website>
104
+ <show_in_store>0</show_in_store>
105
+ </stop_after_visit>
106
+ <coupon_step translate="label">
107
+ <label>Include coupon in</label>
108
+ <frontend_type>select</frontend_type>
109
+ <source_model>emark_cartalert/source_step</source_model>
110
+ <sort_order>100</sort_order>
111
+ <show_in_default>1</show_in_default>
112
+ <show_in_website>1</show_in_website>
113
+ <show_in_store>1</show_in_store>
114
+ </coupon_step>
115
+ <coupon_type translate="label">
116
+ <label>Discount type</label>
117
+ <frontend_type>select</frontend_type>
118
+ <source_model>emark_cartalert/source_discount</source_model>
119
+ <sort_order>110</sort_order>
120
+ <show_in_default>1</show_in_default>
121
+ <show_in_website>1</show_in_website>
122
+ <show_in_store>1</show_in_store>
123
+ </coupon_type>
124
+ <coupon_amount translate="label">
125
+ <label>Discount amount</label>
126
+ <frontend_type>text</frontend_type>
127
+ <sort_order>120</sort_order>
128
+ <show_in_default>1</show_in_default>
129
+ <show_in_website>1</show_in_website>
130
+ <show_in_store>1</show_in_store>
131
+ </coupon_amount>
132
+ <coupon_days translate="label">
133
+ <label>Expire coupon in (days)</label>
134
+ <frontend_type>text</frontend_type>
135
+ <sort_order>130</sort_order>
136
+ <show_in_default>1</show_in_default>
137
+ <show_in_website>1</show_in_website>
138
+ <show_in_store>1</show_in_store>
139
+ </coupon_days>
140
+ <bcc>
141
+ <label>BCC Email</label>
142
+ <frontend_type>text</frontend_type>
143
+ <sort_order>150</sort_order>
144
+ <show_in_default>1</show_in_default>
145
+ <show_in_website>0</show_in_website>
146
+ <show_in_store>0</show_in_store>
147
+ </bcc>
148
+ </fields>
149
+ </emark_cartalert>
150
+ </groups>
151
+ </catalog>
152
+ </sections>
153
+ </config>
app/code/community/Emark/Cartalert/sql/emark_cartalert_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $date = date('Y-m-d H:i:s', time()-3600*24*14); // two previous weeks
8
+ $quote = $this->getTable('sales/quote');
9
+
10
+ $installer->run("
11
+
12
+ -- DROP TABLE IF EXISTS {$this->getTable('emark_cartalert')};
13
+ CREATE TABLE {$this->getTable('emark_cartalert')} (
14
+ `cartalert_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
15
+ `store_id` smallint(5) unsigned NOT NULL,
16
+ `customer_id` int(10) unsigned NOT NULL,
17
+ `quote_id` int(10) unsigned NOT NULL,
18
+ `is_preprocessed` tinyint(1) unsigned NOT NULL DEFAULT '0',
19
+ `status` enum('pending','invalid') NOT NULL DEFAULT 'pending',
20
+ `abandoned_at` datetime DEFAULT NULL,
21
+ `sheduled_at` datetime NOT NULL,
22
+ `follow_up` enum('first','second','third') NOT NULL DEFAULT 'first',
23
+ `customer_email` varchar(255) NOT NULL,
24
+ `customer_fname` varchar(255) NOT NULL,
25
+ `customer_lname` varchar(255) NOT NULL,
26
+ `products` text NOT NULL,
27
+ PRIMARY KEY (`cartalert_id`),
28
+ KEY `customer_email` (`customer_email`)
29
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
30
+
31
+ INSERT INTO {$this->getTable('core/config_data')} (`scope` , `scope_id` , `path` , `value` )
32
+ VALUES ('default', '0', 'catalog/emark_cartalert/from_date', '$date');
33
+
34
+ -- DROP TABLE IF EXISTS {$this->getTable('emark_cartalert_history')};
35
+ CREATE TABLE {$this->getTable('emark_cartalert_history')} (
36
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
37
+ `quote_id` int(10) unsigned NOT NULL,
38
+ `customer_id` int(10) unsigned NOT NULL,
39
+ `recover_code` char(32) NOT NULL,
40
+ `sent_at` datetime NOT NULL,
41
+ `recovered_from` varchar(32) NOT NULL,
42
+ `recovered_at` datetime DEFAULT NULL,
43
+ `follow_up` enum('first','second','third') NOT NULL DEFAULT 'first',
44
+ `customer_name` varchar(255) NOT NULL,
45
+ `customer_email` varchar(255) NOT NULL,
46
+ `txt` text NOT NULL,
47
+ PRIMARY KEY (`id`)
48
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
49
+
50
+ ALTER TABLE `$quote` ADD `allow_alerts` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1' ;
51
+
52
+ ");
53
+
54
+ $installer->getConnection()->addColumn(
55
+ $quote,
56
+ 'allow_alerts',
57
+ 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1'
58
+ );
59
+
60
+ $installer->endSetup();
app/code/community/Emark/Mail/Block/Admin/Newsletter/Subscriber/Grid.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @desc overwrites a core block so we can add a action to the grid
5
+ *
6
+ */
7
+
8
+ class Emark_Mail_Block_Admin_Newsletter_Subscriber_Grid extends Mage_Adminhtml_Block_Newsletter_Subscriber_Grid
9
+ {
10
+ protected function _prepareMassaction()
11
+ {
12
+ $this->setMassactionIdField('subscriber_id');
13
+ $this->getMassactionBlock()->setFormFieldName('subscriber');
14
+
15
+ $this->getMassactionBlock()->addItem('unsubscribe', array(
16
+ 'label' => Mage::helper('newsletter')->__('Unsubscribe'),
17
+ 'url' => $this->getUrl('*/*/massUnsubscribe')
18
+ ));
19
+
20
+ if(!is_null(Mage::getStoreConfig('emark_sections/emark_settings/emark_guest'))) {
21
+ #add action E-mark Mail Sync
22
+ $this->getMassactionBlock()->addItem('E-mark Mail Sync', array(
23
+ 'label' => Mage::helper('mail')->__('E-mark Mail Sync'),
24
+ 'url' => $this->getUrl('mail/sync/mass')
25
+ ));
26
+ }
27
+
28
+ $this->getMassactionBlock()->addItem('delete', array(
29
+ 'label' => Mage::helper('newsletter')->__('Delete'),
30
+ 'url' => $this->getUrl('*/*/massDelete')
31
+ ));
32
+
33
+ return $this;
34
+ }
35
+
36
+ }
app/code/community/Emark/Mail/Block/Admin/System/Config/Form/Field/Customerlabels.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Emark_Mail_Block_Admin_System_Config_Form_Field_Customerlabels extends Mage_Core_Block_Html_Select
3
+ {
4
+ public function _toHtml()
5
+ {
6
+ if (!$this->getOptions()) {
7
+ $this->addOption("-- Magento fields --", Mage::helper('mail')->__('-- Magento fields --'));
8
+
9
+ $col = Mage::getModel('customer/customer');
10
+
11
+ $doNotShow = array('email', 'rp_token', 'rp_token_created_at', 'increment_id', 'entity_type_id', 'entity_id', 'attribute_set_id');
12
+
13
+ foreach($col->getAttributes() as $label) {
14
+ if(!in_array($label->getName(), $doNotShow)) {
15
+ $this->addOption($label->getName(), $label->getName());
16
+ }
17
+ }
18
+
19
+ }
20
+ return parent::_toHtml();
21
+ }
22
+ }
app/code/community/Emark/Mail/Block/Admin/System/Config/Form/Field/Label.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @desc rewrite a class for rendering the dropdown configuration fields
5
+ */
6
+
7
+ class Emark_Mail_Block_Admin_System_Config_Form_Field_Label extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
8
+ {
9
+ /**
10
+ * @var Mage_CatalogInventory_Block_Adminhtml_Form_Field_Customergroup
11
+ */
12
+ protected $_subscriberRenderer;
13
+ protected $_customerRenderer;
14
+
15
+ /**
16
+ * Retrieve group column renderer
17
+ *
18
+ * @return Mage_CatalogInventory_Block_Adminhtml_Form_Field_Customergroup
19
+ */
20
+ protected function _getSubscriberRenderer()
21
+ {
22
+ if (!$this->_subscriberRenderer) {
23
+ $this->_subscriberRenderer = $this->getLayout()->createBlock(
24
+ 'mail/admin_system_config_form_field_subscriberlabels', '',
25
+ array('is_render_to_js_template' => true)
26
+ );
27
+ $this->_subscriberRenderer->setName('groups[emark_labels][fields][emark_label][value][#{_id}][subscriber_label]');
28
+ $this->_subscriberRenderer->setClass('customer_group_select');
29
+ $this->_subscriberRenderer->setExtraParams('style="width:150px"');
30
+ }
31
+
32
+ return $this->_subscriberRenderer;
33
+ }
34
+
35
+
36
+ protected function _getCustomerRenderer()
37
+ {
38
+ if (!$this->_customerRenderer) {
39
+ $this->_customerRenderer = $this->getLayout()->createBlock(
40
+ 'mail/admin_system_config_form_field_customerlabels', '',
41
+ array('is_render_to_js_template' => true)
42
+ );
43
+ $this->_customerRenderer->setName('groups[emark_labels][fields][emark_label][value][#{_id}][customer_label]');
44
+ $this->_customerRenderer->setClass('customer_group_select');
45
+ $this->_customerRenderer->setExtraParams('style="width:120px"');
46
+ }
47
+
48
+ return $this->_customerRenderer;
49
+ }
50
+
51
+
52
+ /**
53
+ * Prepare to render
54
+ */
55
+ protected function _prepareToRender()
56
+ {
57
+ $this->addColumn('customer_label', array(
58
+ 'label' => Mage::helper('mail')->__('Magento Fields'),
59
+ 'renderer' => $this->_getCustomerRenderer()
60
+ ));
61
+ $this->addColumn('subscriber_label', array(
62
+ 'label' => Mage::helper('mail')->__('E-mark Mail Fields'),
63
+ 'renderer' => $this->_getSubscriberRenderer()
64
+ ));
65
+
66
+ $this->_addAfter = false;
67
+ $this->_addButtonLabel = Mage::helper('mail')->__('Add E-mark connect field');
68
+ }
69
+
70
+ /**
71
+ * Prepare existing row data object
72
+ *
73
+ * @param Varien_Object
74
+ */
75
+ protected function _prepareArrayRow(Varien_Object $row)
76
+ {
77
+
78
+ $row->setData(
79
+ 'option_extra_attr_' . $this->_getSubscriberRenderer()->calcOptionHash($row->getData('subscriber_label')),
80
+ 'selected="selected"'
81
+ );
82
+
83
+ $row->setData(
84
+ 'option_extra_attr_' . $this->_getCustomerRenderer()->calcOptionHash($row->getData('customer_label')),
85
+ 'selected="selected"'
86
+ );
87
+ }
88
+
89
+ }
app/code/community/Emark/Mail/Block/Admin/System/Config/Form/Field/Label2.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Emark_Mail_Block_Admin_System_Config_Form_Field_Label extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
4
+ {
5
+ /**
6
+ * @var Mage_CatalogInventory_Block_Adminhtml_Form_Field_Customergroup
7
+ */
8
+ protected $_groupRenderer;
9
+
10
+ /**
11
+ * Retrieve group column renderer
12
+ *
13
+ * @return Mage_CatalogInventory_Block_Adminhtml_Form_Field_Customergroup
14
+ */
15
+ protected function _getGroupRenderer()
16
+ {
17
+ if (!$this->_groupRenderer) {
18
+ $this->_groupRenderer = $this->getLayout()->createBlock(
19
+ 'cataloginventory/adminhtml_form_field_customergroup', '',
20
+ array('is_render_to_js_template' => true)
21
+ );
22
+ $this->_groupRenderer->setClass('customer_group_select');
23
+ $this->_groupRenderer->setExtraParams('style="width:120px"');
24
+ }
25
+
26
+ return $this->_groupRenderer;
27
+ }
28
+
29
+ /**
30
+ * Prepare to render
31
+ */
32
+ protected function _prepareToRender()
33
+ {
34
+ /*echo "<pre>";
35
+ $col = Mage::getModel('customer/customer');
36
+ foreach($col->getAttributes() as $c) {
37
+ var_dump($c->getName());
38
+ }*/
39
+ $this->addColumn('customer_group_id', array(
40
+ 'label' => Mage::helper('customer')->__('Magento Fields'),
41
+ 'renderer' => $this->_getGroupRenderer(),
42
+ ));
43
+ $this->addColumn('min_sale_qty', array(
44
+ 'label' => Mage::helper('cataloginventory')->__('E-mark Mail Fields'),
45
+ 'renderer' => $this->_getGroupRenderer(),
46
+ 'style' => 'width:100px',
47
+ ));
48
+ $this->_addAfter = false;
49
+ $this->_addButtonLabel = Mage::helper('cataloginventory')->__('Add Minimum Qty');
50
+ }
51
+
52
+ /**
53
+ * Prepare existing row data object
54
+ *
55
+ * @param Varien_Object
56
+ */
57
+ protected function _prepareArrayRow(Varien_Object $row)
58
+ {
59
+ $row->setData(
60
+ 'option_extra_attr_' . $this->_getGroupRenderer()->calcOptionHash($row->getData('customer_group_id')),
61
+ 'selected="selected"'
62
+ );
63
+ }
64
+
65
+ }
app/code/community/Emark/Mail/Block/Admin/System/Config/Form/Field/Subscriberlabels.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Emark_Mail_Block_Admin_System_Config_Form_Field_Subscriberlabels extends Mage_Core_Block_Html_Select
3
+ {
4
+
5
+ private $notice = false;
6
+ public function _toHtml()
7
+ {
8
+ $shopName = $this->getRequest()->getParam('store', '');
9
+ if(empty($shopName)) {
10
+ $website = $this->getRequest()->getParam('website', '');
11
+ $groupId = Mage::getModel('core/website')->getCollection()->addFieldToFilter('code',$website)->getFirstItem()->getDefaultGroupId();
12
+ $shopId = Mage::getModel('core/store_group')->getCollection()->addFieldToFilter('group_id',$groupId)->getFirstItem()->getDefaultStoreId();
13
+
14
+ } else {
15
+ $shopId = Mage::getModel('core/store')->getCollection()->addFieldToFilter('code',$shopName)->getFirstItem()->getStoreId();
16
+ }
17
+
18
+ if(!Mage::Helper('mail/api')->_init($shopId) && !$this->notice) {
19
+ Mage::getSingleton('core/session')->addNotice('Can\'t connect to the rest api, check in the General settings');
20
+ $this->notice = true;
21
+ }
22
+
23
+ if (!$this->getOptions()) {
24
+ $this->addOption("-- E-mark Mail fields --", Mage::helper('mail')->__('-- E-mark Mail fields --'));
25
+
26
+ $labels = Mage::Helper('mail/api')->getSubscriberLabel($shopId);
27
+
28
+ if($labels->valid) {
29
+ foreach($labels->data as $label) {
30
+ $this->addOption($label->name, $label->name);
31
+ }
32
+ }
33
+ }
34
+ return parent::_toHtml();
35
+ }
36
+ }
app/code/community/Emark/Mail/Helper/Api.php ADDED
@@ -0,0 +1,286 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @desc Wrapper for the E-mark Rest Api V2
5
+ *
6
+ */
7
+
8
+ class Emark_Mail_Helper_Api extends Mage_Core_Helper_Abstract
9
+ {
10
+ protected $token = array();
11
+ public $initErrors = '';
12
+ public $subscriberLabels = array();
13
+
14
+ #method for getting the response of the rest api
15
+ public function rest_get ($call, $data = array(), $shopId, $configUrl = null) {
16
+ #if no config vars get the api url of the configuration settings
17
+ if(!is_null($configUrl)) {
18
+ $apiUrl = $configUrl;
19
+ } else {
20
+ $apiUrl = Mage::getStoreConfig('emark_sections/emark_settings/emark_api', $shopId);
21
+ }
22
+
23
+
24
+ #get the api url + the call that you want to make
25
+ $url = $apiUrl . $call;
26
+
27
+ #if there is data
28
+ if(count($data)) $url .= '?' . http_build_query($data);
29
+
30
+ #start a curl request
31
+ $c = curl_init();
32
+
33
+ #curl settings
34
+ curl_setopt_array($c, array(
35
+ CURLOPT_URL => $url,
36
+ CURLOPT_RETURNTRANSFER => true
37
+ ));
38
+
39
+ #execute the curl
40
+ $result = curl_exec($c);
41
+
42
+ #json decode the returned answer of the rest api
43
+ $json = json_decode($result);
44
+ curl_close($c);
45
+
46
+ #if there went something wrong return a error
47
+ if(!is_object($json)) {
48
+ $json = new stdClass();
49
+ $json->valid = false;
50
+ $json->errors = array('Critical failure, result was not in valid JSON format.');
51
+ }
52
+ $json->url = $url;
53
+
54
+ #return the json object
55
+ return $json;
56
+ }
57
+
58
+
59
+ #get database id from the configuration settings
60
+ public function getDatabase($shopId = null) {
61
+ if(is_null($shopId)) {
62
+ $shopId = Mage::app()->getStore()->getStoreId();
63
+ }
64
+
65
+ return Mage::getStoreConfig('emark_sections/emark_settings/emark_db', $shopId);
66
+ }
67
+
68
+ #check if the api, user and password for the rest api are correct
69
+ public function checkConfigSuccessLogin($usr, $passwd, $shopId) {
70
+ if(!isset($passwd)) {
71
+ return false;
72
+ }
73
+
74
+ $call = $this->rest_get('user/login', array(
75
+ 'username' => $usr, # Mage::getStoreConfig('emark_sections/emark_settings/emark_user', Mage::app()->getStore()->getStoreId()),
76
+ 'password' => $passwd
77
+ ), $shopId);
78
+
79
+ if(!$call->valid) {
80
+ $this->initErrors = $call;
81
+ return false;
82
+ die();
83
+ } else {
84
+ $this->token[$shopId] = $call->data->token;
85
+ return true;
86
+ die();
87
+ }
88
+ }
89
+
90
+ #delete a selection of a specific subscriber
91
+ public function deleteSelection($email, $shopId, $database = null, $test = false) {
92
+ #check if there is a database id
93
+ if(is_null($database)) {
94
+ $database = $this->getDatabase($shopId);
95
+ }
96
+
97
+ #initialize the rest api
98
+ if($this->_init($shopId)) {
99
+ #get the subscriber selections
100
+ $subscriberSelections = $this->getSubscriberByEmail($email, $shopId)->data->selections;
101
+
102
+ #get the E-mark magento module selections
103
+ $delSelections = array(
104
+ Mage::getStoreConfig('emark_sections/emark_settings/emark_guest', $shopId),
105
+ Mage::getStoreConfig('emark_sections/emark_settings/emark_logged_customer', $shopId)
106
+ );
107
+
108
+ #remove the module selections of the subscriber selections
109
+ $newSubscriberSelections = array_diff($subscriberSelections, $delSelections);
110
+
111
+ #if the subscriber selections is now empty, create a string empty.
112
+ if(empty($newSubscriberSelections)) {
113
+ $newSubscriberSelections = "empty";
114
+ }
115
+
116
+ #create the webserver options
117
+ $vars = array(
118
+ 'token' => $this->token[$shopId],
119
+ 'database' => $database,
120
+ 'email' => $email,
121
+ "source" => Mage::getStoreConfig('emark_sections/emark_settings/emark_source', $shopId),
122
+ 'options' => array(
123
+ "subscriber" => "update",
124
+ "selection" => "removeOther",
125
+ "resend_optin" => "yes",
126
+ "optin" => "none"
127
+ ),
128
+ 'pretend' => $test,
129
+ 'languages' => array(1),
130
+ 'selections' => $newSubscriberSelections
131
+ );
132
+
133
+ #invoke the rest api call
134
+ $call = $this->rest_get('subscriber/store', $vars, $shopId);
135
+ return $call;
136
+ } else {
137
+ #return error if there whent something wrong
138
+ return $this->initErrors;
139
+ }
140
+ }
141
+
142
+ #initialize the webserver
143
+ public function _init($shopId) {
144
+ #if there is already a token use that one
145
+ if(!isset($this->token[$shopId])) {
146
+
147
+ #login into the rest api
148
+ $call = $this->rest_get('user/login', array(
149
+ 'username' => Mage::getStoreConfig('emark_sections/emark_settings/emark_user', $shopId),
150
+ 'password' => Mage::getStoreConfig('emark_sections/emark_settings/emark_password', $shopId)
151
+ ), $shopId);
152
+
153
+ #if the call is valid set the token else return the error
154
+ if(!$call->valid) {
155
+ $this->initErrors = $call;
156
+ return false;
157
+ die();
158
+ } else {
159
+ $this->token[$shopId] = $call->data->token;
160
+ return true;
161
+ die();
162
+ }
163
+ }
164
+
165
+ return true;
166
+ }
167
+
168
+ #get all the databases of a specific rest api user
169
+ public function getDatabases($shopId) {
170
+ if($this->_init($shopId)) {
171
+ $call = $this->rest_get('user/databases', array(
172
+ 'token' => $this->token[$shopId],
173
+ ), $shopId);
174
+
175
+ return $call;
176
+ } else {
177
+ return $this->initErrors;
178
+ }
179
+ }
180
+
181
+
182
+ #create a selection in a specific database
183
+ public function createSelection($name, $shopId, $database = null, $test = "off") {
184
+ if(is_null($database)) {
185
+ $database = $this->getDatabase($shopId);
186
+ }
187
+
188
+ if($this->_init($shopId)) {
189
+ $call = $this->rest_get('selections/create', array(
190
+ 'token' => $this->token[$shopId],
191
+ 'database' => $database,
192
+ 'name' => $name
193
+ ), $shopId);
194
+
195
+ return $call;
196
+ } else {
197
+ return $this->initErrors;
198
+ }
199
+ }
200
+
201
+
202
+ #create a subscriber in E-mark Mail
203
+ public function createSubscriber($email, $fields = array(), $guest = false, $shopId, $database = null, $test = false) {
204
+ if(is_null($database)) {
205
+ $database = $this->getDatabase($shopId);
206
+ }
207
+ if($this->_init($shopId)) {
208
+ $labels = $this->getSubscriberLabel($shopId, $database);
209
+ $subscriberLabel = array();
210
+ if($labels->valid) {
211
+ foreach($labels->data as $data) {
212
+ if(array_key_exists($data->name, $fields)) {
213
+ $subscriberLabel[$data->name] = $fields[$data->name];
214
+ }
215
+ }
216
+ }
217
+ $vars = array(
218
+ 'token' => $this->token[$shopId],
219
+ 'database' => $database,
220
+ 'email' => $email,
221
+ "source" => Mage::getStoreConfig('emark_sections/emark_settings/emark_source', $shopId),
222
+ 'options' => array(
223
+ "subscriber" => "update",
224
+ "selection" => "add",
225
+ "resend_optin" => "yes",
226
+ "optin" => "none"
227
+ ),
228
+ 'pretend' => $test,
229
+ 'subscriber' => $subscriberLabel,
230
+ 'languages' => array(1)
231
+ );
232
+
233
+ #check if the subscriber is a guest, if he is a guest put the subscriber in a special selections
234
+ if($guest) {
235
+ $vars['selections'] = array(Mage::getStoreConfig('emark_sections/emark_settings/emark_guest', $shopId));
236
+ } else {
237
+ $vars['selections'] = array(Mage::getStoreConfig('emark_sections/emark_settings/emark_logged_customer', $shopId));
238
+ }
239
+
240
+ $call = $this->rest_get('subscriber/store', $vars, $shopId);
241
+
242
+ return $call;
243
+ } else {
244
+ return $this->initErrors;
245
+ }
246
+ }
247
+
248
+ #get all the labels of a database for a subscriber
249
+ public function getSubscriberLabel($shopId, $database = null) {
250
+ if(!isset($this->subscriberLabels[$shopId]) || !is_null($database)) {
251
+ if(is_null($database)) {
252
+ $database = $this->getDatabase($shopId);
253
+ }
254
+ if($this->_init($shopId)) {
255
+ $call = $this->rest_get('subscriber/getFormFields', array(
256
+ 'token' => $this->token[$shopId],
257
+ 'database' => $database
258
+ ), $shopId);
259
+
260
+ $this->subscriberLabels[$shopId] = $call;
261
+ } else {
262
+ return $this->initErrors;
263
+ }
264
+ }
265
+
266
+ return $this->subscriberLabels[$shopId];
267
+ }
268
+
269
+ #get a subscriber
270
+ public function getSubscriberByEmail($email, $shopId, $database = null) {
271
+ if(is_null($database)) {
272
+ $database = $this->getDatabase($shopId);
273
+ }
274
+ if($this->_init($shopId)) {
275
+ $call = $this->rest_get('subscriber/findByEmail', array(
276
+ 'token' => $this->token[$shopId],
277
+ 'database' => $database,
278
+ 'email' => $email
279
+ ), $shopId);
280
+
281
+ return $call;
282
+ } else {
283
+ return $this->initErrors;
284
+ }
285
+ }
286
+ }
app/code/community/Emark/Mail/Helper/Connectfields.php ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_CatalogInventory
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class Emark_Mail_Helper_Connectfields
28
+ {
29
+
30
+ /**
31
+ * Generate a storable representation of a value
32
+ *
33
+ * @param mixed $value
34
+ * @return string
35
+ */
36
+ protected function _serializeValue($value)
37
+ {
38
+ if (is_array($value)) {
39
+ $data = array();
40
+ foreach ($value as $labelids => $label) {
41
+ if (!array_key_exists($labelids, $data) && $labelids != "__empty") {
42
+ $data[$labelids] = $label;
43
+ }
44
+ }
45
+
46
+ return serialize($data);
47
+ } else {
48
+ return '';
49
+ }
50
+ }
51
+
52
+
53
+ public function getArrayConnectFields($value) {
54
+ $fields = array();
55
+ $value = $this->_unserializeValue($value);
56
+ if(is_array($value)) {
57
+ foreach($value as $v) {
58
+ if(is_array($v)) {
59
+ if($v['customer_label'] !== "-- Magento fields --" && $v['subscriber_label'] !== "-- E-mark Mail fields --") {
60
+ $fields[$v["customer_label"]] = $v['subscriber_label'];
61
+ }
62
+ }
63
+ }
64
+ return $fields;
65
+ } else {
66
+ return array();
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Create a value from a storable representation
72
+ *
73
+ * @param mixed $value
74
+ * @return array
75
+ */
76
+ protected function _unserializeValue($value)
77
+ {
78
+ if (is_string($value) && !empty($value)) {
79
+ return unserialize($value);
80
+ } else {
81
+ return array();
82
+ }
83
+ }
84
+
85
+ /**
86
+ * Check whether value is in form retrieved by _encodeArrayFieldValue()
87
+ *
88
+ * @param mixed
89
+ * @return bool
90
+ */
91
+ protected function _isEncodedArrayFieldValue($value)
92
+ {
93
+ if (!is_array($value)) {
94
+ return false;
95
+ }
96
+ foreach ($value as $_id => $row) {
97
+ if (!is_array($row) || !array_key_exists('customer_label', $row) || !array_key_exists('subscriber_label', $row)) {
98
+ return false;
99
+ }
100
+ }
101
+ return true;
102
+ }
103
+
104
+ /**
105
+ * Encode value to be used in Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
106
+ *
107
+ * @param array
108
+ * @return array
109
+ */
110
+ protected function _encodeArrayFieldValue(array $value)
111
+ {
112
+ $result = array();
113
+ foreach ($value as $groupId => $qty) {
114
+ $_id = Mage::helper('core')->uniqHash('_');
115
+ $result[$_id] = array(
116
+ 'customer_group_id' => $groupId,
117
+ 'min_sale_qty' => $qty,
118
+ );
119
+ }
120
+ return $result;
121
+ }
122
+
123
+ /**
124
+ * Decode value from used in Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
125
+ *
126
+ * @param array
127
+ * @return array
128
+ */
129
+ protected function _decodeArrayFieldValue(array $value)
130
+ {
131
+ $result = array();
132
+ foreach ($value as $_id => $row) {
133
+ if (!is_array($row) || !array_key_exists('customer_label', $row) || !array_key_exists('subscriber_label', $row)) {
134
+ continue;
135
+ }
136
+ $subMag = $row['customer_label'];
137
+ $subEm = $row['subscriber_label'];
138
+ $result[$subMag] = $subEm;
139
+ }
140
+ return $result;
141
+ }
142
+
143
+ /**
144
+ * Make value readable by Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
145
+ *
146
+ * @param mixed $value
147
+ * @return array
148
+ */
149
+ public function makeArrayFieldValue($value)
150
+ {
151
+ $value = $this->_unserializeValue($value);
152
+ if (!$this->_isEncodedArrayFieldValue($value)) {
153
+ $value = $this->_encodeArrayFieldValue($value);
154
+ }
155
+ return $value;
156
+ }
157
+
158
+ /**
159
+ * Make value ready for store
160
+ *
161
+ * @param mixed $value
162
+ * @return string
163
+ */
164
+ public function makeStorableArrayFieldValue($value)
165
+ {
166
+ if ($this->_isEncodedArrayFieldValue($value)) {
167
+ $value = $this->_decodeArrayFieldValue($value);
168
+ }
169
+ $value = $this->_serializeValue($value);
170
+ return $value;
171
+ }
172
+ }
app/code/community/Emark/Mail/Helper/Customer.php ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @desc Helper for checking and syncing between magento and E-mark Mail
5
+ *
6
+ * TODO: - create one method of the createGetFieldMag and createSetFieldMag
7
+ */
8
+
9
+ class Emark_Mail_Helper_Customer extends Mage_Core_Helper_Abstract
10
+ {
11
+
12
+ #method for syncing to or from E-mark Mail
13
+ public function sync($email,$shopId, $isRegForm = false, $thisCustomer = null) {
14
+ if(!Mage::Helper('mail/api')->_init($shopId)) {
15
+ return;
16
+ }
17
+
18
+ #If the class has its own customer init, then use that one
19
+ if(!$isRegForm) {
20
+ $customer = Mage::getModel('customer/customer')->getCollection()->addFilter('email', $email)->getFirstItem();
21
+ } else {
22
+ $customer = $thisCustomer;
23
+ }
24
+
25
+ #check if the user exists in the EM
26
+ #$checkEm = Mage::Helper('mail/api')->getSubscriberByEmail($email);
27
+
28
+ #if our customer doesn't exist or the user doesn't exist in E-mark, create the user
29
+ #Mage::log($isRegForm . " " . $email . " " . $customer->getId());
30
+
31
+
32
+ if(!is_object($customer) || is_null($customer->getId())) {
33
+ $customerType = "guest";
34
+ $guest = Mage::Helper('mail/api')->createSubscriber($email, array(), true, $shopId);
35
+ $this->trowError($guest);
36
+ } else {
37
+ #magento uses UTC so lets convert this to CET. Because EM is using CET.
38
+ $d = new DateTime(date("Y-m-d H:i:s", strtotime($customer->getUpdatedAt())));
39
+ $d->setTimezone(new DateTimeZone("CET"));
40
+ $dateMag = $d->format("Y-m-d H:i:s");
41
+
42
+ #check wich of the 2 systems has the latest update time, to determine who has to update
43
+ $update = $this->determineUpdate($email, $dateMag, $shopId);
44
+
45
+ #funky logger
46
+ #Mage::log("Update is:" . $update);
47
+
48
+ if($update == "Magento -> EM") {
49
+
50
+ $var = array();
51
+
52
+ #get the customer Fields
53
+ $fields = $this->getCustomerFieldsArray($shopId);
54
+ foreach($fields as $key=>$value) {
55
+ if($value !== false) {
56
+ $func = $this->createGetFieldMag($key);
57
+ if(!is_null($customer->$func())) {
58
+ $var[$value] = $customer->$func();
59
+ } else {
60
+ unset($var[$value]);
61
+ unset($fields[$value]);
62
+ }
63
+ }
64
+ }
65
+
66
+ #create the subscriber
67
+ $call = Mage::Helper('mail/api')->createSubscriber($email, $var, false, $shopId);
68
+
69
+ #trow a error if there is one
70
+ $this->trowError( $call, $email);
71
+ } else {
72
+
73
+ #get the customer fields
74
+ $fields = $this->getCustomerFieldsArray($shopId);
75
+
76
+ #get the subscriber labels
77
+ $labels = Mage::Helper('mail/api')->getSubscriberLabel($shopId);
78
+
79
+ $emSubscriber = Mage::Helper('mail/api')->getSubscriberByEmail($email, $shopId);
80
+ #check if the labels aren't empty
81
+ if(!empty($labels->data)) {
82
+
83
+ #loop to the labels and create the value for the model customer
84
+ foreach($labels->data as $data) {
85
+ if(in_array($data->name, $fields)) {
86
+ foreach($fields as $key=>$value) {
87
+ if($value == $data->name) {
88
+ $func = $this->createSetFieldMag($key);
89
+ $emLabel = $data->name;
90
+ #Mage::log($emLabel);
91
+ $customer->$func($emSubscriber->data->$emLabel);
92
+ }
93
+ }
94
+ }
95
+ }
96
+
97
+ #save the customer, if it is not a success throw a error
98
+ try {
99
+ $customer->setIsSubscribed(1);
100
+ $customer->save();
101
+ } catch(Exception $ex) {
102
+ Mage::throwException($ex->getMessage());
103
+ }
104
+ }
105
+ }
106
+ }
107
+
108
+ }
109
+
110
+ #method to trow a error
111
+ protected function trowError($call, $email = "") {
112
+ if(!$call->valid) {
113
+ foreach($call->errors as $error) {
114
+ Mage::throwException($email . " " . $this->__($error));
115
+ }
116
+ }
117
+ }
118
+
119
+ #check if the user is unsubscribed
120
+ public function checkUnsubscribe($email, $shopId) {
121
+ #Mage::log('unscubsribed');
122
+ $emSubscriber = Mage::Helper('mail/api')->getSubscriberByEmail($email, $shopId);
123
+
124
+ if($emSubscriber->valid) {
125
+ $emSubscriber = Mage::Helper('mail/api')->deleteSelection($email, $shopId);
126
+ }
127
+ }
128
+
129
+ #method to create the naming convention of the get field for the method save
130
+ protected function createGetFieldMag($key) {
131
+ $key = explode('_', $key);
132
+ $fnc = "get";
133
+ foreach($key as $k) {
134
+ $fnc .= ucfirst($k);
135
+ }
136
+
137
+ return $fnc;
138
+ }
139
+
140
+ #method to create the naming convention of the set field for the method save
141
+ protected function createSetFieldMag($key) {
142
+ $key = explode('_', $key);
143
+ $fnc = "set";
144
+ foreach($key as $k) {
145
+ $fnc .= ucfirst($k);
146
+ }
147
+
148
+ return $fnc;
149
+ }
150
+
151
+ #check if magento must update the EM or the Em must update Magento
152
+ protected function determineUpdate($email, $date, $shopId) {
153
+ $subscriber = Mage::Helper('mail/api')->getSubscriberByEmail($email, $shopId);
154
+ if($subscriber->valid) {
155
+ $subsciberEmDate = $subscriber->data->lastupdate;
156
+ $selections = array(
157
+ Mage::getStoreConfig('emark_sections/emark_settings/emark_guest', $shopId),
158
+ Mage::getStoreConfig('emark_sections/emark_settings/emark_logged_customer', $shopId)
159
+ );
160
+
161
+ #some logging
162
+ #Mage::log("EM time: " . $subsciberEmDate);
163
+ #Mage::log("Mag time:" . $date);
164
+ #Mage::log((in_array($selections[1], $subscriber->data->selections) || in_array($selections[0], $subscriber->data->selections)));
165
+
166
+
167
+ if($subsciberEmDate > $date && (in_array($selections[1], $subscriber->data->selections) || in_array($selections[0], $subscriber->data->selections))) {
168
+ return "EM -> Magento";
169
+ } else {
170
+ return "Magento -> EM";
171
+ }
172
+ die();
173
+ } else {
174
+ return "Magento -> EM";
175
+ }
176
+ }
177
+
178
+ #connect the magento customer fields to the subscriber fields of the EM
179
+ public function getCustomerFieldsArray($shopId) {
180
+ return Mage::Helper("mail/connectfields")->getArrayConnectFields(Mage::getStoreConfig('emark_customer_settings/emark_labels/emark_label', $shopId));
181
+
182
+ return $labels;
183
+ }
184
+ }
app/code/community/Emark/Mail/Helper/Data.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @desc Mandatory helper
5
+ *
6
+ */
7
+
8
+ class Emark_Mail_Helper_Data extends Mage_Core_Helper_Abstract
9
+ {
10
+
11
+ }
app/code/community/Emark/Mail/Model/Admin/Apidatabase.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @desc Class for checking Database Id from the System->configuration
5
+ *
6
+ */
7
+
8
+ class Emark_Mail_Model_Admin_Apidatabase extends Mage_Core_Model_Config_Data
9
+ {
10
+ public function save() {
11
+ #set the error message
12
+ $errorMsg = Mage::Helper('mail')->__('There went something wrong try again later.');
13
+
14
+ #get all the databases of this user, for checking if the database is exists
15
+ $dbs = Mage::Helper('mail/api')->getDatabases($this->getScopeId());
16
+ #if cant login, throw message
17
+ if(!$dbs->valid) {
18
+ Mage::throwException($errorMsg);
19
+ }
20
+
21
+ #check if the user has access tot the database id
22
+ $gotDb = false;
23
+ foreach($dbs->data as $db) {
24
+ if($db->id == $this->getValue()) {
25
+ $gotDb = true;
26
+ }
27
+ }
28
+
29
+ if(!$gotDb) {
30
+ #if the database does not exists
31
+ Mage::throwException(Mage::Helper('mail')->__('This database doesn\'t exists.'));
32
+ } else {
33
+ #get the Shop Id + the scope;
34
+ $shopId = $this->getScopeId();
35
+ $shopCode = $this->getScope();
36
+
37
+ #get the Shop name. We are using this for naming the selections.
38
+ $shopName = Mage::getModel('core/store')->load($this->getScopeId())->getName();
39
+
40
+ #create the selection for the guest subscribers for this specific shop
41
+ $guest = Mage::Helper('mail/api')->createSelection('Magento Guest - ' . $shopName, $shopId, $this->getValue());
42
+
43
+ #if the guest selection is saved
44
+ if($guest->valid) {
45
+ #create the selection for the logged subscribers for this specific shop
46
+ $regUser = Mage::Helper('mail/api')->createSelection('Magento Registered User - ' . $shopName, $shopId, $this->getValue());
47
+
48
+ #if the selection is saved
49
+ if(!$regUser->valid) {
50
+ Mage::throwException($errorMsg);
51
+ } else {
52
+ #get the selections ID
53
+ $guestId = $guest->data->id;
54
+ $regUserId = $regUser->data->id;
55
+
56
+ #Mage::log("SaveDatabse: regId:" . $regUserId . " - Shop Name:" . $shopCode . " - ShopId:" . $shopId . " ");
57
+
58
+ #save the id's to the configuration
59
+ Mage::getModel('core/config')->saveConfig('emark_sections/emark_settings/emark_logged_customer', $regUserId, $shopCode, $shopId );
60
+ Mage::getModel('core/config')->saveConfig('emark_sections/emark_settings/emark_guest', $guestId, $shopCode, $shopId );
61
+ Mage::app()->getConfig()->reinit();
62
+
63
+ #add a success message
64
+ Mage::getSingleton('core/session')->addSuccess(Mage::Helper('mail')->__("Successfully made 2 new selections name: 'Magento Guest - %s and 'Magento Registered User - %s'", $shopName, $shopName));
65
+ }
66
+ } else {
67
+ Mage::throwException($errorMsg);
68
+ }
69
+ }
70
+
71
+ Mage::getSingleton('core/session')->addNotice(Mage::Helper('mail')->__("Don't forget to connect the labels in Configuration->E-Mark Mail->Customer settings"));
72
+
73
+
74
+ #save the database id
75
+ return parent::save();
76
+ }
77
+
78
+ /**
79
+ * Get the current scope for saving the configuration
80
+ */
81
+ public function getScope() {
82
+ $stores = Mage::app()->getRequest()->getParam('store', '');
83
+ $websites = Mage::app()->getRequest()->getParam('websites', '');
84
+ if(!empty($stores)) {
85
+ $scope = "stores";
86
+ } else if(!empty($websites)) {
87
+ $scope = "websites";
88
+ } else {
89
+ $scope = "default";
90
+ }
91
+
92
+ return $scope;
93
+ }
94
+
95
+
96
+ }
app/code/community/Emark/Mail/Model/Admin/Apipassword.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Emark_Mail_Model_Admin_Apipassword extends Mage_Core_Model_Config_Data
4
+ {
5
+ public function save() {
6
+
7
+ $dat = $this->getData();
8
+
9
+ if(!Mage::Helper('mail/api')->checkConfigSuccessLogin($dat['groups']['emark_settings']['fields']['emark_user']['value'], $this->getValue(), $this->getScopeId())) {
10
+ Mage::throwException(Mage::Helper('mail')->__("Can't login into Api, please check user and password."));
11
+ } else {
12
+
13
+ }
14
+ return parent::save();
15
+ }
16
+ }
app/code/community/Emark/Mail/Model/Admin/Apiurl.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Emark_Mail_Model_Admin_Apiurl extends Mage_Core_Model_Config_Data
4
+ {
5
+ public function save() {
6
+ $call = Mage::Helper('mail/api')->rest_get('',array(), $this->getScopeId(), $this->getValue());
7
+ if(!isset($call->message)) {
8
+ Mage::throwException(Mage::Helper('mail')->__('The Api URl is not valid.'));
9
+ }
10
+ return parent::save();
11
+ }
12
+ }
app/code/community/Emark/Mail/Model/Admin/Apiuser.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Emark_Mail_Model_Admin_Apiuser extends Mage_Core_Model_Config_Data
4
+ {
5
+ public function save() {
6
+ $val = $this->getValue();
7
+
8
+ if(empty($val)) {
9
+ Mage::throwException(Mage::Helper('mail')->__('Api user is mandatory.'));
10
+ }
11
+ return parent::save();
12
+ }
13
+ }
app/code/community/Emark/Mail/Model/Admin/Connectfields.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Emark_Mail_Model_Admin_Connectfields extends Mage_Core_Model_Config_Data {
4
+
5
+ /**
6
+ * Process data after load
7
+ */
8
+ protected function _afterLoad()
9
+ {
10
+ $value = $this->getValue();
11
+
12
+ $value = Mage::helper('mail/connectfields')->makeArrayFieldValue($value);
13
+ $this->setValue($value);
14
+ }
15
+
16
+ /**
17
+ * Prepare data before save
18
+ */
19
+ protected function _beforeSave()
20
+ {
21
+ $value = $this->getValue();
22
+ $value = Mage::helper('mail/connectfields')->makeStorableArrayFieldValue($value);
23
+ $this->setValue($value);
24
+ }
25
+
26
+
27
+ public function save() {
28
+ return parent::save();
29
+ }
30
+ }
app/code/community/Emark/Mail/Model/Customer.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @desc Model for the cron
5
+ *
6
+ * don't forget to create a cron which leads to: /var/www/path/to/magento-install/cron.php
7
+ */
8
+ class Emark_Mail_Model_Customer extends Mage_Customer_Model_Customer {
9
+
10
+ /**
11
+ * @dec update subscribers in magento
12
+ *
13
+ * - Customer get's updated when exists
14
+ * - Unsubscribed when unsubscribed in magento
15
+ *
16
+ */
17
+ public function updateMagentoCron() {
18
+ #check webservice connection
19
+ if(!Mage::Helper('mail/api')->_init()) {
20
+ return;
21
+ }
22
+
23
+ #get all subscribers from magento
24
+ $customers = Mage::getModel('newsletter/subscriber')->getCollection();
25
+
26
+ # loop trough them
27
+ foreach($customers as $customer) {
28
+
29
+ #get email adres of subscriber
30
+ $email = $customer->getEmail();
31
+ $storeId = $customer->getStoreId();
32
+
33
+ #logger
34
+ #Mage::log($email);
35
+ #echo "CRON: " . $email . " " . $storeId . "\n";
36
+
37
+ #check if subscriber exists in EM
38
+ $em = Mage::Helper('mail/api')->getSubscriberByEmail($email, $storeId);
39
+
40
+ if($em->valid && (in_array(Mage::getStoreConfig('emark_sections/emark_settings/emark_guest', $storeId), $em->data->selections) || in_array(Mage::getStoreConfig('emark_sections/emark_settings/emark_logged_customer', $storeId), $em->data->selections))) {
41
+
42
+ #logger
43
+ #Mage::log('Sync me: ' . $email);
44
+ #echo "Sync me:" . $email . "\n";
45
+
46
+ # sync if the user exists
47
+ Mage::Helper('mail/customer')->sync($email, $storeId);
48
+ } else {
49
+ #unsubscribe when not exists
50
+ #Mage::log('Delete me: ' . $email);
51
+ $customer->setStatus(3);
52
+ $customer->save();
53
+ }
54
+ }
55
+ }
56
+
57
+ }
app/code/community/Emark/Mail/Model/Customer/Register/Observer.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @desc Observer after customer is saved.
4
+ *
5
+ * This method sends the customer to the sync or the unsubscribe for E-mark Mail
6
+ *
7
+ */
8
+ class Emark_Mail_Model_Customer_Register_Observer
9
+ {
10
+ public function updateEm($observer) {
11
+
12
+ # line for logging so you can see how manu times is being called see var/www/magento/var/log/system.log
13
+ #Mage::log('Emark Mail: Observer');
14
+
15
+ # get the customer out of the observer vars
16
+ $customer = $observer->getCustomer();
17
+
18
+ $customerId = $customer->getId();
19
+
20
+ # get the Email adress of the customer
21
+ $email = $customer->getEmail();
22
+
23
+ if(isset($customerId) && is_null($customer->getIsSubscribed())) {
24
+ $subs = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
25
+ $storeId = $subs->getStoreId();
26
+
27
+ if($subs->getStatus() == 1) {
28
+ $subscribed = true;
29
+ } else {
30
+ $subscribed = false;
31
+ }
32
+
33
+ } else {
34
+ $subscribed = $customer->getIsSubscribed();
35
+ $storeId = $customer->getStoreId();
36
+ if(!$storeId) {
37
+ $storeId = $customer->getSendemailStoreId();
38
+ }
39
+ }
40
+
41
+ if($subscribed) {
42
+ # sync the customer with E-mark Mail, and use the observer customer
43
+ Mage::Helper('mail/customer')->sync($email, $storeId, true, $customer);
44
+ } else {
45
+ # unsunscribe the customer
46
+ Mage::Helper('mail/customer')->checkUnsubscribe($email, $storeId);
47
+ }
48
+ }
49
+ }
app/code/community/Emark/Mail/Model/Subscriber.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @desc Rewrite the newsletter subscribe Model
5
+ *
6
+ * Rewrites the method subscribe and the confirm method. The only thing that is changed
7
+ * Is that the subscriber will be synct to the EM.
8
+ *
9
+ */
10
+ class Emark_Mail_Model_Subscriber extends Mage_Newsletter_Model_Subscriber
11
+ {
12
+ public function subscribe($email)
13
+ {
14
+
15
+ $this->loadByEmail($email);
16
+ $customerSession = Mage::getSingleton('customer/session');
17
+
18
+ if(!$this->getId()) {
19
+ $this->setSubscriberConfirmCode($this->randomSequence());
20
+ }
21
+
22
+ $isConfirmNeed = (Mage::getStoreConfig(self::XML_PATH_CONFIRMATION_FLAG) == 1) ? true : false;
23
+ $isOwnSubscribes = false;
24
+ $ownerId = Mage::getModel('customer/customer')
25
+ ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
26
+ ->loadByEmail($email)
27
+ ->getId();
28
+ $isSubscribeOwnEmail = $customerSession->isLoggedIn() && $ownerId == $customerSession->getId();
29
+
30
+ if (!$this->getId() || $this->getStatus() == self::STATUS_UNSUBSCRIBED
31
+ || $this->getStatus() == self::STATUS_NOT_ACTIVE
32
+ ) {
33
+ if ($isConfirmNeed === true) {
34
+ // if user subscribes own login email - confirmation is not needed
35
+ $isOwnSubscribes = $isSubscribeOwnEmail;
36
+ if ($isOwnSubscribes == true){
37
+ $this->setStatus(self::STATUS_SUBSCRIBED);
38
+ } else {
39
+ $this->setStatus(self::STATUS_NOT_ACTIVE);
40
+ }
41
+ } else {
42
+ $this->setStatus(self::STATUS_SUBSCRIBED);
43
+ }
44
+ $this->setSubscriberEmail($email);
45
+ }
46
+
47
+ if ($isSubscribeOwnEmail) {
48
+ $storeId = $customerSession->getCustomer()->getStoreId();
49
+ $this->setStoreId($storeId);
50
+ $this->setCustomerId($customerSession->getCustomerId());
51
+ } else {
52
+ $storeId = Mage::app()->getStore()->getId();
53
+ $this->setStoreId($storeId);
54
+ $this->setCustomerId(0);
55
+ }
56
+
57
+ $this->setIsStatusChanged(true);
58
+
59
+ try {
60
+ $this->save();
61
+ if ($isConfirmNeed === true
62
+ && $isOwnSubscribes === false
63
+ ) {
64
+ $this->sendConfirmationRequestEmail();
65
+ } else {
66
+ $this->sendConfirmationSuccessEmail();
67
+
68
+ #sync to the EM
69
+ Mage::Helper('mail/customer')->sync($email, $storeId);
70
+ }
71
+
72
+ return $this->getStatus();
73
+ } catch (Exception $e) {
74
+ throw new Exception($e->getMessage());
75
+ }
76
+ }
77
+
78
+ public function confirm($code) {
79
+
80
+ if($this->getCode()==$code) {
81
+ $this->setStatus(self::STATUS_SUBSCRIBED)
82
+ ->setIsStatusChanged(true)
83
+ ->save();
84
+
85
+ $email = $this->getEmail();
86
+ $storeId = $this->getStoreId();
87
+
88
+ # sync to the EM
89
+ Mage::Helper('mail/customer')->sync($email, $storeId);
90
+
91
+ return true;
92
+ }
93
+
94
+ return false;
95
+ }
96
+ }
app/code/community/Emark/Mail/controllers/Admin/CustomerController.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @desc rewrites the controller for the delete actions of a customer in the backend
5
+ *
6
+ */
7
+ #little hack for extending the current controller
8
+ include( Mage::getBaseDir() . "/app/code/core/Mage/Adminhtml/controllers/CustomerController.php");
9
+
10
+ class Emark_Mail_Admin_CustomerController extends Mage_Adminhtml_CustomerController
11
+ {
12
+
13
+ #deletes the EM subscriber selection of the customer + the customer in magento
14
+ public function deleteAction()
15
+ {
16
+ $this->_initCustomer();
17
+ $customer = Mage::registry('current_customer');
18
+ if ($customer->getId()) {
19
+ try {
20
+ $customer->load($customer->getId());
21
+ $storeId = $customer->getStoreId();
22
+ Mage::Helper('mail/customer')->checkUnsubscribe($customer->getEmail(), $storeId);
23
+ $customer->delete();
24
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('The customer has been deleted.'));
25
+ }
26
+ catch (Exception $e){
27
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
28
+ }
29
+ }
30
+ $this->_redirect('*/customer');
31
+ }
32
+
33
+ #Bulk: deletes the EM subscriber selection of the customer + the customer in magento
34
+ public function massDeleteAction()
35
+ {
36
+ $customersIds = $this->getRequest()->getParam('customer');
37
+ if(!is_array($customersIds)) {
38
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select customer(s).'));
39
+ } else {
40
+ try {
41
+ $customer = Mage::getModel('customer/customer');
42
+ foreach ($customersIds as $customerId) {
43
+ $cus = $customer->reset()->load($customerId);
44
+ $storeId = $cus->getStoreId();
45
+ Mage::Helper('mail/customer')->checkUnsubscribe($cus->getEmail(), $storeId);
46
+ $cus->delete();
47
+ }
48
+ Mage::getSingleton('adminhtml/session')->addSuccess(
49
+ Mage::helper('adminhtml')->__(
50
+ 'Total of %d record(s) were deleted.', count($customersIds)
51
+ )
52
+ );
53
+ } catch (Exception $e) {
54
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
55
+ }
56
+ }
57
+
58
+ $this->_redirect('*/*/index');
59
+ }
60
+ }
app/code/community/Emark/Mail/controllers/Admin/Newsletter/SubscriberController.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @desc rewrites the controller for the delete actions of a customer in the backend
5
+ *
6
+ */
7
+
8
+ class Emark_Mail_Admin_Newsletter_SubscriberController extends Mage_Adminhtml_Controller_Action
9
+ {
10
+
11
+ #mass unsubscribe for the newsletter subscribers
12
+ public function massUnsubscribeAction() {
13
+ $subscribersIds = $this->getRequest()->getParam('subscriber');
14
+ if (!is_array($subscribersIds)) {
15
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('newsletter')->__('Please select subscriber(s)'));
16
+ }
17
+ else {
18
+ try {
19
+ foreach ($subscribersIds as $subscriberId) {
20
+ $subscriber = Mage::getModel('newsletter/subscriber')->load($subscriberId);
21
+ $subscriber->unsubscribe();
22
+
23
+ #added unsubscribe for the EM
24
+ Mage::Helper('mail/customer')->checkUnsubscribe($subscriber->getEmail(), $subscriber->getStoreId());
25
+ }
26
+
27
+ Mage::getSingleton('adminhtml/session')->addSuccess(
28
+ Mage::helper('adminhtml')->__(
29
+ 'Total of %d record(s) were updated', count($subscribersIds)
30
+ )
31
+ );
32
+ } catch (Exception $e) {
33
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
34
+ }
35
+ }
36
+
37
+ $this->_redirect('*/*/index');
38
+ }
39
+
40
+ #mass delete for the newsletter subscriber + removes module selection of the subscribers
41
+ public function massDeleteAction()
42
+ {
43
+ $subscribersIds = $this->getRequest()->getParam('subscriber');
44
+ if (!is_array($subscribersIds)) {
45
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('newsletter')->__('Please select subscriber(s)'));
46
+ }
47
+ else {
48
+ try {
49
+ foreach ($subscribersIds as $subscriberId) {
50
+ $subscriber = Mage::getModel('newsletter/subscriber')->load($subscriberId);
51
+
52
+ #added unsubscribe for the EM
53
+ Mage::Helper('mail/customer')->checkUnsubscribe($subscriber->getEmail(), $subscriber->getShopId());
54
+ $subscriber->delete();
55
+ }
56
+ Mage::getSingleton('adminhtml/session')->addSuccess(
57
+ Mage::helper('adminhtml')->__(
58
+ 'Total of %d record(s) were deleted', count($subscribersIds)
59
+ )
60
+ );
61
+ } catch (Exception $e) {
62
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
63
+ }
64
+ }
65
+
66
+ $this->_redirect('*/*/index');
67
+ }
68
+ }
app/code/community/Emark/Mail/controllers/Admin/SyncController.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @desc Mas sync function for the extra "E-mark Mail sync" action on the page "newsletter->newsletter subscribers" in the admin panel of magento
5
+ *
6
+ */
7
+
8
+ class Emark_Mail_Admin_SyncController extends Mage_Adminhtml_Controller_Action
9
+ {
10
+
11
+ #Mass sync method between magento and E-mark Mail.
12
+ public function massAction() {
13
+
14
+ #get the subscriber Id's from the mass selection
15
+ $subscribersIds = $this->getRequest()->getParam('subscriber');
16
+
17
+ #if the there is no array throw a error
18
+ if (!is_array($subscribersIds)) {
19
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('newsletter')->__('Please select subscriber(s)'));
20
+ } else {
21
+ try {
22
+ $error = 0;
23
+ $countSelected = 0;
24
+ $countSynct = 0;
25
+
26
+ #loop trough the selected subscribers
27
+ foreach ($subscribersIds as $subscriberId) {
28
+
29
+ #get the subscriber model
30
+ $subscriber = Mage::getModel('newsletter/subscriber')->load($subscriberId);
31
+ $email = $subscriber->getEmail();
32
+ $shopId = $subscriber->getStoreId();
33
+ $countSelected++;
34
+
35
+ /**
36
+ * 1: Subscribed 2: Status Not Active 3: Unsubscribed
37
+ * These are the known statussen of the subscriber
38
+ */
39
+ if($subscriber->getStatus() == 1) {
40
+ Mage::Helper('mail/customer')->sync($email, $shopId);
41
+ $countSynct++;
42
+ } else {
43
+ Mage::Helper('mail/customer')->checkUnsubscribe($email, $shopId);
44
+ }
45
+ }
46
+
47
+ #counted synct, not sync or unsubscribers
48
+ $diffStatus = $countSelected - $countSynct;
49
+
50
+ } catch(Exception $ex) {
51
+ $error = 1;
52
+ Mage::getSingleton('adminhtml/session')->addError($ex->getMessage());
53
+ }
54
+
55
+ #if there are no errors
56
+ if(!$error) {
57
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::Helper('mail')->__('From the %s selected subscribers there are %s synct to E-mark Mail. %s Subscribers where not active or Unsubscribed.', $countSelected, $countSynct, $diffStatus));
58
+ }
59
+ }
60
+
61
+
62
+ #redirect back to the overview of the subscribers
63
+ $this->_redirect('adminhtml/newsletter_subscriber/index');
64
+ }
65
+ }
app/code/community/Emark/Mail/etc/adminhtml.xml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <!--<menu>
4
+ <mail translate="title" module="mail">
5
+ <title>E-mark Mail</title>
6
+ <sort_order>55</sort_order>
7
+ <children>
8
+ <selections translate="title" module="mail">
9
+ <title>Selections</title>
10
+ <action>mail/selections/index</action>
11
+ <sort_order>1</sort_order>
12
+ </selections>
13
+ </children>
14
+ </mail>
15
+ </menu>-->
16
+ <acl>
17
+ <resources>
18
+ <admin>
19
+ <children>
20
+ <system>
21
+ <children>
22
+ <config>
23
+ <children>
24
+ <emark_sections translate="title" module="mail">
25
+ <title>Emark Mail</title>
26
+ <sort_order>100</sort_order>
27
+ </emark_sections>
28
+ <emark_customer_settings translate="title" module="mail">
29
+ <title>Emark Mail</title>
30
+ <sort_order>110</sort_order>
31
+ </emark_customer_settings>
32
+ </children>
33
+ </config>
34
+ </children>
35
+ </system>
36
+ </children>
37
+ </admin>
38
+ </resources>
39
+ </acl>
40
+ </config>
app/code/community/Emark/Mail/etc/config.xml ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Emark_Mail>
5
+ <version>1.2</version>
6
+ </Emark_Mail>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <newsletter>
11
+ <args>
12
+ <modules>
13
+ <Emark_Mail after="Mage_Newsletter">Emark_Mail</Emark_Mail>
14
+ </modules>
15
+ </args>
16
+ </newsletter>
17
+ </routers>
18
+ <translate>
19
+ <modules>
20
+ <Emark_Mail>
21
+ <files>
22
+ <default>Emark_Mail.csv</default>
23
+ </files>
24
+ </Emark_Mail>
25
+ </modules>
26
+ </translate>
27
+ </frontend>
28
+ <global>
29
+ <events>
30
+ <customer_save_after>
31
+ <observers>
32
+ <emark_mail>
33
+ <class>mail/customer_register_observer</class>
34
+ <method>updateEm</method>
35
+ </emark_mail>
36
+ </observers>
37
+ </customer_save_after>
38
+ </events>
39
+ <helpers>
40
+ <mail>
41
+ <class>Emark_Mail_Helper</class>
42
+ </mail>
43
+ </helpers>
44
+ <blocks>
45
+ <mail>
46
+ <class>Emark_Mail_Block</class>
47
+ </mail>
48
+ <adminhtml>
49
+ <rewrite>
50
+ <newsletter_subscriber_grid>Emark_Mail_Block_Admin_Newsletter_Subscriber_Grid</newsletter_subscriber_grid>
51
+ </rewrite>
52
+ </adminhtml>
53
+ </blocks>
54
+ <models>
55
+ <mail>
56
+ <class>Emark_Mail_Model</class>
57
+ </mail>
58
+ <newsletter>
59
+ <rewrite>
60
+ <subscriber>Emark_Mail_Model_Subscriber</subscriber>
61
+ </rewrite>
62
+ </newsletter>
63
+ <customer>
64
+ <rewrite>
65
+ <customer>Emark_Mail_Model_Customer</customer>
66
+ </rewrite>
67
+ </customer>
68
+ </models>
69
+ </global>
70
+ <admin>
71
+ <routers>
72
+ <mail>
73
+ <use>admin</use>
74
+ <args>
75
+ <module>Emark_Mail_Admin</module>
76
+ <frontName>mail</frontName>
77
+ </args>
78
+ </mail>
79
+ <adminhtml>
80
+ <args>
81
+ <modules>
82
+ <Emark_Mail before="Mage_Adminhtml">Emark_Mail_Admin</Emark_Mail>
83
+ </modules>
84
+ </args>
85
+ </adminhtml>
86
+ </routers>
87
+ </admin>
88
+ <adminhtml>
89
+ <translate>
90
+ <modules>
91
+ <Emark_Mail>
92
+ <files>
93
+ <default>Emark_Mail.csv</default>
94
+ </files>
95
+ </Emark_Mail>
96
+ </modules>
97
+ </translate>
98
+ </adminhtml>
99
+ <default>
100
+ <emark_sections>
101
+ <emark_settings>
102
+ <emark_api>https://mail.e-mark.nl/rest/api/v2/</emark_api>
103
+ <emark_source>1</emark_source>
104
+ </emark_settings>
105
+ </emark_sections>
106
+ </default>
107
+ <crontab>
108
+ <jobs>
109
+ <customer_update>
110
+ <schedule><cron_expr>00 00 * * *</cron_expr></schedule>
111
+ <run><model>mail/customer::updateMagentoCron</model></run>
112
+ </customer_update>
113
+ </jobs>
114
+ </crontab>
115
+ </config>
app/code/community/Emark/Mail/etc/system.xml ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <emark_tab translate="label" module="mail">
5
+ <label>E-Mark Mail</label>
6
+ <sort_order>100</sort_order>
7
+ </emark_tab>
8
+ </tabs>
9
+ <sections>
10
+ <emark_sections translate="label" module="mail">
11
+ <label>General settings</label>
12
+ <sort_order>1000</sort_order>
13
+ <show_in_default>1</show_in_default>
14
+ <show_in_website>1</show_in_website>
15
+ <show_in_store>1</show_in_store>
16
+ <tab>emark_tab</tab>
17
+
18
+ <groups>
19
+ <emark_settings translate="label">
20
+ <label>Webservice</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>1000</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+
27
+ <fields>
28
+ <emark_api translate="label">
29
+ <label>Api url</label>
30
+ <frontend_type>text</frontend_type>
31
+ <sort_order>10</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <backend_model>mail/admin_apiurl</backend_model>
35
+ <show_in_store>1</show_in_store>
36
+ </emark_api>
37
+ <emark_user translate="label">
38
+ <label>User</label>
39
+ <frontend_type>text</frontend_type>
40
+ <sort_order>30</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <backend_model>mail/admin_apiuser</backend_model>
44
+ <show_in_store>1</show_in_store>
45
+ </emark_user>
46
+ <emark_password translate="label">
47
+ <label>Password</label>
48
+ <frontend_type>password</frontend_type>
49
+ <sort_order>40</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <backend_model>mail/admin_apipassword</backend_model>
53
+ <show_in_store>1</show_in_store>
54
+ </emark_password>
55
+ <emark_db translate="label">
56
+ <label>Database Id:</label>
57
+ <frontend_type>text</frontend_type>
58
+ <sort_order>50</sort_order>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>1</show_in_website>
61
+ <show_in_store>1</show_in_store>
62
+ <backend_model>mail/admin_apidatabase</backend_model>
63
+ </emark_db>
64
+ <emark_source>
65
+ <label>Source Id:</label>
66
+ <frontend_type>text</frontend_type>
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
+ </emark_source>
72
+ </fields>
73
+ </emark_settings>
74
+ </groups>
75
+ </emark_sections>
76
+ <emark_customer_settings translate="label" module="mail">
77
+ <label>Customer settings</label>
78
+ <sort_order>2000</sort_order>
79
+ <show_in_default>1</show_in_default>
80
+ <show_in_website>1</show_in_website>
81
+ <show_in_store>1</show_in_store>
82
+ <tab>emark_tab</tab>
83
+
84
+ <groups>
85
+ <emark_labels translate="label">
86
+ <label>Fields</label>
87
+ <frontend_type>text</frontend_type>
88
+ <sort_order>1000</sort_order>
89
+ <show_in_default>1</show_in_default>
90
+ <show_in_website>1</show_in_website>
91
+ <show_in_store>1</show_in_store>
92
+
93
+ <fields>
94
+ <emark_label translate="label">
95
+ <label>Connect Fields:</label>
96
+ <frontend_model>mail/admin_system_config_form_field_label</frontend_model>
97
+ <backend_model>mail/admin_connectfields</backend_model>
98
+ <sort_order>20</sort_order>
99
+ <show_in_default>1</show_in_default>
100
+ <show_in_website>1</show_in_website>
101
+ <show_in_store>1</show_in_store>
102
+ </emark_label>
103
+ </fields>
104
+ </emark_labels>
105
+ </groups>
106
+ </emark_customer_settings>
107
+ </sections>
108
+ </config>
app/code/{local/EM → community/Emark}/Mbbwebservice/Helper/Config.php RENAMED
@@ -2,14 +2,14 @@
2
  /**
3
  * Emark
4
  */
5
- class EM_Mbbwebservice_Helper_Config extends Mage_Core_Helper_Abstract{
6
 
7
  const XML_PATH_ENABLED = 'mbbwebservice/general/enabled';
8
  const XML_PATH_TEST = 'mbbwebservice/general/test';
9
  const XML_PATH_TEST_ADDRESS = 'mbbwebservice/general/test_address';
10
  const XML_PATH_SMTP_HOST = 'mbbwebservice/smtp/host';
11
- const XML_PATH_SMTP_PORT = 'mbbwebservice/smtp/port';
12
  const XML_PATH_SMTP_LOGIN = 'mbbwebservice/smtp/login';
13
  const XML_PATH_SMTP_PASSWORD = 'mbbwebservice/smtp/password';
14
  const XML_PATH_SMTP_SSL = 'mbbwebservice/smtp/ssl';
15
- }
2
  /**
3
  * Emark
4
  */
5
+ class Emark_Mbbwebservice_Helper_Config extends Mage_Core_Helper_Abstract{
6
 
7
  const XML_PATH_ENABLED = 'mbbwebservice/general/enabled';
8
  const XML_PATH_TEST = 'mbbwebservice/general/test';
9
  const XML_PATH_TEST_ADDRESS = 'mbbwebservice/general/test_address';
10
  const XML_PATH_SMTP_HOST = 'mbbwebservice/smtp/host';
11
+ const XML_PATH_SMTP_PORT = 'mbbwebservice/smtp/ports';
12
  const XML_PATH_SMTP_LOGIN = 'mbbwebservice/smtp/login';
13
  const XML_PATH_SMTP_PASSWORD = 'mbbwebservice/smtp/password';
14
  const XML_PATH_SMTP_SSL = 'mbbwebservice/smtp/ssl';
15
+ }
app/code/community/Emark/Mbbwebservice/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Emark
4
+ */
5
+ class Emark_Mbbwebservice_Helper_Data extends Mage_Core_Helper_Abstract{
6
+ }
app/code/{local/EM → community/Emark}/Mbbwebservice/Model/Email/Template.php RENAMED
@@ -3,7 +3,7 @@
3
  /**
4
  * Emark
5
  */
6
- class EM_Mbbwebservice_Model_Email_Template extends Mage_Core_Model_Email_Template {
7
 
8
  private $_saveRange = array();
9
 
@@ -21,19 +21,24 @@ class EM_Mbbwebservice_Model_Email_Template extends Mage_Core_Model_Email_Templa
21
  return $this;
22
  }
23
 
24
- public function sendMail(EM_Mbbwebservice_Model_Mail $Mail, $config = NULL) {
25
 
26
  if (is_null ($config))
27
  {
28
- $config = array('username' => Mage::getStoreConfig(EM_Mbbwebservice_Helper_Config::XML_PATH_SMTP_LOGIN),
29
- 'password' => Mage::getStoreConfig(EM_Mbbwebservice_Helper_Config::XML_PATH_SMTP_PASSWORD));
30
  }
31
 
32
- $config ['smtp'] = Mage::getStoreConfig(EM_Mbbwebservice_Helper_Config::XML_PATH_SMTP_HOST);
33
- $config ['port'] = Mage::getStoreConfig(EM_Mbbwebservice_Helper_Config::XML_PATH_SMTP_PORT);
34
  $config ['auth'] = 'login';
 
 
 
 
 
35
 
36
- $ssl = Mage::getStoreConfig(EM_Mbbwebservice_Helper_Config::XML_PATH_SMTP_SSL);
37
 
38
  if (! empty ($ssl))
39
  {
@@ -83,8 +88,7 @@ class EM_Mbbwebservice_Model_Email_Template extends Mage_Core_Model_Email_Templa
83
  }
84
 
85
  public function send($email, $name=null, array $variables = array()) {
86
-
87
- if (!Mage::getStoreConfig(EM_Mbbwebservice_Helper_Config::XML_PATH_ENABLED)) {
88
  return parent::send($email, $name, $variables);
89
  }
90
 
@@ -146,4 +150,4 @@ class EM_Mbbwebservice_Model_Email_Template extends Mage_Core_Model_Email_Templa
146
  return $range;
147
  }
148
 
149
- }
3
  /**
4
  * Emark
5
  */
6
+ class Emark_Mbbwebservice_Model_Email_Template extends Mage_Core_Model_Email_Template {
7
 
8
  private $_saveRange = array();
9
 
21
  return $this;
22
  }
23
 
24
+ public function sendMail(Emark_Mbbwebservice_Model_Mail $Mail, $config = NULL) {
25
 
26
  if (is_null ($config))
27
  {
28
+ $config = array('username' => Mage::getStoreConfig(Emark_Mbbwebservice_Helper_Config::XML_PATH_SMTP_LOGIN),
29
+ 'password' => Mage::getStoreConfig(Emark_Mbbwebservice_Helper_Config::XML_PATH_SMTP_PASSWORD));
30
  }
31
 
32
+ $config ['smtp'] = Mage::getStoreConfig(Emark_Mbbwebservice_Helper_Config::XML_PATH_SMTP_HOST);
33
+ $config ['port'] = Mage::getStoreConfig(Emark_Mbbwebservice_Helper_Config::XML_PATH_SMTP_PORT);
34
  $config ['auth'] = 'login';
35
+ /*echo "<pre>";
36
+ var_dump($config);
37
+ var_dump(Mage::getStoreConfig('system/smtp/host'));
38
+ var_dump(Mage::getStoreConfig('mbbwebservice/smtp/ports'));
39
+ die();*/
40
 
41
+ $ssl = Mage::getStoreConfig(Emark_Mbbwebservice_Helper_Config::XML_PATH_SMTP_SSL);
42
 
43
  if (! empty ($ssl))
44
  {
88
  }
89
 
90
  public function send($email, $name=null, array $variables = array()) {
91
+ if (!Mage::getStoreConfig(Emark_Mbbwebservice_Helper_Config::XML_PATH_ENABLED)) {
 
92
  return parent::send($email, $name, $variables);
93
  }
94
 
150
  return $range;
151
  }
152
 
153
+ }
app/code/{local/EM → community/Emark}/Mbbwebservice/Model/Mail.php RENAMED
@@ -2,7 +2,7 @@
2
  /**
3
  * Emark
4
  */
5
- class EM_Mbbwebservice_Model_Mail extends Mage_Core_Model_Abstract{
6
  public function _construct(){
7
  parent::_construct();
8
  $this->_init('mbbwebservice/mail');
2
  /**
3
  * Emark
4
  */
5
+ class Emark_Mbbwebservice_Model_Mail extends Mage_Core_Model_Abstract{
6
  public function _construct(){
7
  parent::_construct();
8
  $this->_init('mbbwebservice/mail');
app/code/{local/EM → community/Emark}/Mbbwebservice/Model/Observer.php RENAMED
@@ -3,7 +3,7 @@
3
  /**
4
  * Emark
5
  */
6
- class EM_Mbbwebservice_Model_Observer
7
  {
8
  protected static $fields = array ();
9
 
@@ -29,21 +29,33 @@ class EM_Mbbwebservice_Model_Observer
29
  }
30
  }
31
 
32
- if (self::$fields ['test'] && 4 == count (self::$fields))
 
 
 
 
 
 
 
 
 
 
 
 
33
  {
34
  $configs = array (array ('ssl://', 465),
35
  array ('tls://', 587),
36
  array ('', 587),
37
  array ('', 588),
38
- array ('tls://', 25),
39
- array ('', 25));
40
 
41
- $host = Mage::getStoreConfig(EM_Mbbwebservice_Helper_Config::XML_PATH_SMTP_HOST);
42
  $connected = FALSE;
43
 
44
  for ($i = 0; $i < count ($configs); ++$i)
45
  {
46
- $soc = @ fSockOpen ($configs [$i] [0].$host, $configs [$i] [1], $errno, $errstr, 5);
47
 
48
  if ($soc)
49
  {
@@ -59,24 +71,24 @@ class EM_Mbbwebservice_Model_Observer
59
  {
60
  if ('ssl://' == $configs [$i] [0])
61
  {
62
- Mage::getConfig ()->saveConfig (EM_Mbbwebservice_Helper_Config::XML_PATH_SMTP_SSL, 'SSL');
63
  }
64
  elseif ('tls://' == $configs [$i] [0])
65
  {
66
- Mage::getConfig ()->saveConfig (EM_Mbbwebservice_Helper_Config::XML_PATH_SMTP_SSL, 'TLS');
67
  }
68
  else
69
  {
70
- Mage::getConfig ()->saveConfig (EM_Mbbwebservice_Helper_Config::XML_PATH_SMTP_SSL, '');
71
  }
72
 
73
- Mage::getConfig ()->saveConfig (EM_Mbbwebservice_Helper_Config::XML_PATH_SMTP_PORT, $configs [$i] [1]);
74
 
75
  Mage::getConfig ()->reinit ();
76
  Mage::app ()->reinitStores ();
77
 
78
  $to = self::$fields ['test_address'];
79
- $from = Mage::getStoreConfig ('trans_email/ident_general/email');
80
 
81
  $Mail = Mage::getModel ('mbbwebservice/mail');
82
 
@@ -103,4 +115,4 @@ class EM_Mbbwebservice_Model_Observer
103
  }
104
  }
105
 
106
- ?>
3
  /**
4
  * Emark
5
  */
6
+ class Emark_Mbbwebservice_Model_Observer
7
  {
8
  protected static $fields = array ();
9
 
29
  }
30
  }
31
 
32
+ $groups = Mage::app()->getFrontController()->getRequest()->getParam('groups');
33
+
34
+ if(isset($groups['ident_general']['fields']['email'])) {
35
+ if(!stristr($groups['ident_general']['fields']['email']['value'], "@e-mark.nl")) {
36
+ throw new Exception('Your general e-mail address must be the e-mark domain (@e-mark.nl, system->configuration->Store Email Addresses->General Contact)');
37
+ return;
38
+ }
39
+ } else if(!strstr(Mage::getStoreConfig ('trans_email/ident_general/email'), "@e-mark.nl")) {
40
+ throw new Exception('Your general e-mail address must be the e-mark domain (@e-mark.nl, system->configuration->Store Email Addresses->General Contact)');
41
+ return;
42
+ }
43
+
44
+ if (isset(self::$fields ['test']) && self::$fields ['test'] && 4 == count (self::$fields))
45
  {
46
  $configs = array (array ('ssl://', 465),
47
  array ('tls://', 587),
48
  array ('', 587),
49
  array ('', 588),
50
+ array ('tls://', 2525),
51
+ array ('', 2525));
52
 
53
+ $host = Mage::getStoreConfig(Emark_Mbbwebservice_Helper_Config::XML_PATH_SMTP_HOST);
54
  $connected = FALSE;
55
 
56
  for ($i = 0; $i < count ($configs); ++$i)
57
  {
58
+ $soc = @fSockOpen ($configs [$i] [0].$host, $configs [$i] [1], $errno, $errstr, 5);
59
 
60
  if ($soc)
61
  {
71
  {
72
  if ('ssl://' == $configs [$i] [0])
73
  {
74
+ Mage::getConfig ()->saveConfig (Emark_Mbbwebservice_Helper_Config::XML_PATH_SMTP_SSL, 'SSL');
75
  }
76
  elseif ('tls://' == $configs [$i] [0])
77
  {
78
+ Mage::getConfig ()->saveConfig (Emark_Mbbwebservice_Helper_Config::XML_PATH_SMTP_SSL, 'TLS');
79
  }
80
  else
81
  {
82
+ Mage::getConfig ()->saveConfig (Emark_Mbbwebservice_Helper_Config::XML_PATH_SMTP_SSL, '');
83
  }
84
 
85
+ Mage::getConfig ()->saveConfig (Emark_Mbbwebservice_Helper_Config::XML_PATH_SMTP_PORT, $configs [$i] [1]);
86
 
87
  Mage::getConfig ()->reinit ();
88
  Mage::app ()->reinitStores ();
89
 
90
  $to = self::$fields ['test_address'];
91
+ $from = Mage::getStoreConfig ('trans_email/ident_general/email');
92
 
93
  $Mail = Mage::getModel ('mbbwebservice/mail');
94
 
115
  }
116
  }
117
 
118
+ ?>
app/code/{local/EM → community/Emark}/Mbbwebservice/etc/config.xml RENAMED
@@ -1,10 +1,10 @@
1
  <?xml version="1.0"?>
2
  <config>
3
  <modules>
4
- <EM_Mbbwebservice>
5
  <version>1.0.0</version>
6
  <platform>ce</platform>
7
- </EM_Mbbwebservice>
8
  </modules>
9
  <adminhtml>
10
  <menu>
@@ -13,7 +13,7 @@
13
  <mails translate="title" module="mbbwebservice">
14
  <title>Emark settings</title>
15
  <action>adminhtml/system_config/edit/section/mbbwebservice</action>
16
- <sort_order>40</sort_order>
17
  </mails>
18
  </children>
19
  </system>
@@ -60,11 +60,11 @@
60
  </acl>
61
  <translate>
62
  <modules>
63
- <EM_Mbbwebservice>
64
  <files>
65
- <default>EM_Mbbwebservice.csv</default>
66
  </files>
67
- </EM_Mbbwebservice>
68
  </modules>
69
  </translate>
70
  </adminhtml>
@@ -73,7 +73,7 @@
73
  <mbbwebservice_admin>
74
  <use>admin</use>
75
  <args>
76
- <module>EM_Mbbwebservice</module>
77
  <frontName>mails_admin</frontName>
78
  </args>
79
  </mbbwebservice_admin>
@@ -82,11 +82,11 @@
82
  <global>
83
  <models>
84
  <mbbwebservice>
85
- <class>EM_Mbbwebservice_Model</class>
86
  </mbbwebservice>
87
  <core>
88
  <rewrite>
89
- <email_template>EM_Mbbwebservice_Model_Email_Template</email_template>
90
  </rewrite>
91
  </core>
92
  </models>
@@ -95,7 +95,7 @@
95
  <observers>
96
  <test_mail>
97
  <type>singleton</type>
98
- <class>EM_Mbbwebservice_Model_Observer</class>
99
  <method>sendTestMail</method>
100
  </test_mail>
101
  </observers>
@@ -104,7 +104,7 @@
104
  <resources>
105
  <mbbwebservice_setup>
106
  <setup>
107
- <module>EM_Mbbwebservice</module>
108
  </setup>
109
  <connection>
110
  <use>core_setup</use>
@@ -123,12 +123,12 @@
123
  </resources>
124
  <helpers>
125
  <mbbwebservice>
126
- <class>EM_Mbbwebservice_Helper</class>
127
  </mbbwebservice>
128
  </helpers>
129
  <blocks>
130
  <mbbwebservice>
131
- <class>EM_Mbbwebservice_Block</class>
132
  </mbbwebservice>
133
  </blocks>
134
  </global>
@@ -140,10 +140,7 @@
140
  <test_address />
141
  </general>
142
  <smtp>
143
- <host>transactional.e-mark.nl</host>
144
- <port>2525</port>
145
- <login>magento</login>
146
- <password>21EC2020-3AEA-1069-A2DD-08002B3</password>
147
  <ssl />
148
  </smtp>
149
  </mbbwebservice>
1
  <?xml version="1.0"?>
2
  <config>
3
  <modules>
4
+ <Emark_Mbbwebservice>
5
  <version>1.0.0</version>
6
  <platform>ce</platform>
7
+ </Emark_Mbbwebservice>
8
  </modules>
9
  <adminhtml>
10
  <menu>
13
  <mails translate="title" module="mbbwebservice">
14
  <title>Emark settings</title>
15
  <action>adminhtml/system_config/edit/section/mbbwebservice</action>
16
+ <sort_order>110</sort_order>
17
  </mails>
18
  </children>
19
  </system>
60
  </acl>
61
  <translate>
62
  <modules>
63
+ <Emark_Mbbwebservice>
64
  <files>
65
+ <default>Emark_Mbbwebservice.csv</default>
66
  </files>
67
+ </Emark_Mbbwebservice>
68
  </modules>
69
  </translate>
70
  </adminhtml>
73
  <mbbwebservice_admin>
74
  <use>admin</use>
75
  <args>
76
+ <module>Emark_Mbbwebservice</module>
77
  <frontName>mails_admin</frontName>
78
  </args>
79
  </mbbwebservice_admin>
82
  <global>
83
  <models>
84
  <mbbwebservice>
85
+ <class>Emark_Mbbwebservice_Model</class>
86
  </mbbwebservice>
87
  <core>
88
  <rewrite>
89
+ <email_template>Emark_Mbbwebservice_Model_Email_Template</email_template>
90
  </rewrite>
91
  </core>
92
  </models>
95
  <observers>
96
  <test_mail>
97
  <type>singleton</type>
98
+ <class>Emark_Mbbwebservice_Model_Observer</class>
99
  <method>sendTestMail</method>
100
  </test_mail>
101
  </observers>
104
  <resources>
105
  <mbbwebservice_setup>
106
  <setup>
107
+ <module>Emark_Mbbwebservice</module>
108
  </setup>
109
  <connection>
110
  <use>core_setup</use>
123
  </resources>
124
  <helpers>
125
  <mbbwebservice>
126
+ <class>Emark_Mbbwebservice_Helper</class>
127
  </mbbwebservice>
128
  </helpers>
129
  <blocks>
130
  <mbbwebservice>
131
+ <class>Emark_Mbbwebservice_Block</class>
132
  </mbbwebservice>
133
  </blocks>
134
  </global>
140
  <test_address />
141
  </general>
142
  <smtp>
143
+ <hallo>Bla</hallo>
 
 
 
144
  <ssl />
145
  </smtp>
146
  </mbbwebservice>
app/code/{local/EM → community/Emark}/Mbbwebservice/etc/system.xml RENAMED
@@ -3,13 +3,13 @@
3
  <config>
4
  <tabs>
5
  <mbbwebservice translate="label" module="mbbwebservice">
6
- <label>emark</label>
7
- <sort_order>300</sort_order>
8
  </mbbwebservice>
9
  </tabs>
10
  <sections>
11
  <mbbwebservice translate="label" module="mbbwebservice">
12
- <label>Settings</label>
13
  <tab>mbbwebservice</tab>
14
  <frontend_type>text</frontend_type>
15
  <sort_order>100</sort_order>
@@ -67,6 +67,24 @@
67
  <show_in_website>1</show_in_website>
68
  <show_in_store>1</show_in_store>
69
  <fields>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  <login translate="label">
71
  <label>API Key</label>
72
  <frontend_type>text</frontend_type>
@@ -78,7 +96,7 @@
78
  </login>
79
  <password translate="label">
80
  <label>Secret Key</label>
81
- <frontend_type>text</frontend_type>
82
  <sort_order>140</sort_order>
83
  <show_in_default>1</show_in_default>
84
  <show_in_website>1</show_in_website>
3
  <config>
4
  <tabs>
5
  <mbbwebservice translate="label" module="mbbwebservice">
6
+ <label>e-mark cart abandonment</label>
7
+ <sort_order>150</sort_order>
8
  </mbbwebservice>
9
  </tabs>
10
  <sections>
11
  <mbbwebservice translate="label" module="mbbwebservice">
12
+ <label>SMTP Settings</label>
13
  <tab>mbbwebservice</tab>
14
  <frontend_type>text</frontend_type>
15
  <sort_order>100</sort_order>
67
  <show_in_website>1</show_in_website>
68
  <show_in_store>1</show_in_store>
69
  <fields>
70
+ <host translate="label">
71
+ <label>Host</label>
72
+ <frontend_type>text</frontend_type>
73
+ <sort_order>110</sort_order>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>1</show_in_website>
76
+ <show_in_store>1</show_in_store>
77
+ <validate>required-entry</validate>
78
+ </host>
79
+ <ports>
80
+ <label>Ports</label>
81
+ <frontend_type>text</frontend_type>
82
+ <sort_order>120</sort_order>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>1</show_in_website>
85
+ <show_in_store>1</show_in_store>
86
+ <validate>required-entry</validate>
87
+ </ports>
88
  <login translate="label">
89
  <label>API Key</label>
90
  <frontend_type>text</frontend_type>
96
  </login>
97
  <password translate="label">
98
  <label>Secret Key</label>
99
+ <frontend_type>password</frontend_type>
100
  <sort_order>140</sort_order>
101
  <show_in_default>1</show_in_default>
102
  <show_in_website>1</show_in_website>
app/code/local/EM/Mbbwebservice/Helper/Data.php DELETED
@@ -1,6 +0,0 @@
1
- <?php
2
- /**
3
- * Emark
4
- */
5
- class EM_Mbbwebservice_Helper_Data extends Mage_Core_Helper_Abstract{
6
- }
 
 
 
 
 
 
app/etc/modules/EM_Mbbwebservice.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <EM_Mbbwebservice>
5
- <active>true</active>
6
- <codePool>local</codePool>
7
- </EM_Mbbwebservice>
8
- </modules>
9
- </config>
 
 
 
 
 
 
 
 
 
app/etc/modules/Emark_Cartalert.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Emark_Cartalert>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <self_name>Emark Cart-Alerts</self_name>
8
+ <priority>10060</priority>
9
+ </Emark_Cartalert>
10
+ </modules>
11
+ </config>
12
+
app/etc/modules/Emark_Mail.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Emark_Mail>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Emark_Mail>
8
+ </modules>
9
+ </config>
app/etc/modules/Emark_Mbbwebservice.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Emark_Mbbwebservice>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Emark_Mbbwebservice>
8
+ </modules>
9
+ </config>
app/locale/en_US/Emark_Cartalert.csv ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Alert Variables","Alert Variables"
2
+ "Store View","Store View"
3
+ "Follow Up","Follow Up"
4
+ "First","First"
5
+ "Second","Second"
6
+ "Third","Third"
7
+ "Alert Will Be Sent On","Alert Will Be Sent On"
8
+ "Customer E-mail","Customer E-mail"
9
+ "Customer First Name","Customer First Name"
10
+ "Customer Last Name","Customer Last Name"
11
+ "Products","Products"
12
+ "Save and Send Out","Save and Send Out"
13
+ "Abandoned Cart Alert","Abandoned Cart Alert"
14
+ "ID","ID"
15
+ "Abandoned At","Abandoned At"
16
+ "Scheduled At","Scheduled At"
17
+ "Status","Status"
18
+ "Pending","Pending"
19
+ "Not Sent","Not Sent"
20
+ "Cancelled","Cancelled"
21
+ "Send and Save to History","Send and Save to History"
22
+ "Are you sure?","Are you sure?"
23
+ "Delete","Delete"
24
+ "Customer Name","Customer Name"
25
+ "Message","Message"
26
+ "Sent Alert","Sent Alert"
27
+ "Sent On","Sent On"
28
+ "Recovered On","Recovered On"
29
+ "Remote IP","Remote IP"
30
+ "Update Queue Now","Update Queue Now"
31
+ "Alerts Queue","Alerts Queue"
32
+ "Add Alert","Add Alert"
33
+ "Sent Alerts","Sent Alerts"
34
+ "Carts Alerts","Carts Alerts"
35
+ "Item does not exist","Item does not exist"
36
+ "Alert has been successfully sent and deleted","Alert has been successfully sent and deleted"
37
+ "Can not send the ID %d. Please check the email address and your server configuration","Can not send the ID %d. Please check the email address and your server configuration"
38
+ "Alert has been successfully saved","Alert has been successfully saved"
39
+ "Unable to find item to save","Unable to find item to save"
40
+ "Please select cartalert(s)","Please select cartalert(s)"
41
+ "Total of %d record(s) were successfully deleted","Total of %d record(s) were successfully deleted"
42
+ "Can not send the alert ID %d. Please check the email address and your server configuration","Can not send the alert ID %d. Please check the email address and your server configuration"
43
+ "Total of %d email(s) have been successfully sent","Total of %d email(s) have been successfully sent"
44
+ "Total of %d email(s) haven't been successfully sent: no visible products","Total of %d email(s) haven't been successfully sent: no visible products"
45
+ "Alert has been deleted","Alert has been deleted"
46
+ "Alerts for carts abandoned from %s to %s have been successfully added to the queue","Alerts for carts abandoned from %s to %s have been successfully added to the queue"
47
+ "Unable to update queue","Unable to update queue"
48
+ "History","History"
49
+ "Abandoned Carts Alerts","Abandoned Carts Alerts"
50
+ "Pending Alerts","Pending Alerts"
51
+ "Abandoned Cart: The First Follow Up","Abandoned Cart: The First Follow Up"
52
+ "Abandoned Cart: The Second Follow Up","Abandoned Cart: The Second Follow Up"
53
+ "Abandoned Cart: The Third Follow Up","Abandoned Cart: The Third Follow Up"
54
+ "Send E-mails","Send E-mails"
55
+ "If set to ""No"", alert emails will be generated, but won't be sent
56
+ automatically, while manual sending will be allowed","If set to ""No"", alert emails will be generated, but won't be sent
57
+ automatically, while manual sending will be allowed"
58
+ "Email Sender","Email Sender"
59
+ "First Delay Period (minutes)","First Delay Period (minutes)"
60
+ "The system will send the first follow up email after the above mentioned amount of minutes upon customer's last activity in the cart. Supported minimum is 10 minutes.","The system will send the first follow up email after the above mentioned amount of minutes upon customer's last activity in the cart. Supported minimum is 10 minutes."
61
+ "First Email Template","First Email Template"
62
+ "Second Delay Period (hours)","Second Delay Period (hours)"
63
+ "The system will send the second follow up email after the above mentioned amount of hours upon customer's last activity in the cart.","The system will send the second follow up email after the above mentioned amount of hours upon customer's last activity in the cart."
64
+ "Second Email Template","Second Email Template"
65
+ "Third Delay Period (hours)","Third Delay Period (hours)"
66
+ "The system will send the third follow up email after the above mentioned amount of hours upon customer's last activity in the cart.","The system will send the third follow up email after the above mentioned amount of hours upon customer's last activity in the cart."
67
+ "Third Email Template","Third Email Template"
68
+ "Stop alerts sending once the recipient makes a purchase","Stop alerts sending once the recipient makes a purchase"
69
+ "Stop alerts sending once the recipient clicks a link in an email","Stop alerts sending once the recipient clicks a link in an email"
70
+ "Include coupon in","Include coupon in"
71
+ "Discount type","Discount type"
72
+ "Discount amount","Discount amount"
73
+ "Expire coupon in (days)","Expire coupon in (days)"
74
+ "BCC Email","BCC Email"
75
+ "Percent of product price discount","Percent of product price discount"
76
+ "Fixed amount discount","Fixed amount discount"
77
+ "Fixed amount discount for whole cart","Fixed amount discount for whole cart"
78
+ " Email Template"," Email Template"
79
+ "Friend","Friend"
80
+
app/locale/en_US/Emark_Mail.csv ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "From the %s selected subscribers there are %s synct to E-mark Mail. %s Subscribers where not active or Unsubscribed.","From the %s selected subscribers there are %s synct to E-mark Mail. %s Subscribers where not active or Unsubscribed."
2
+ "The Api URl is not valid.","The Api URl is not valid."
3
+ "Can't login into Api, please check user and password.","Can't login into Api, please check user and password."
4
+ "Api user is mandatory.","Api user is mandatory."
5
+ "There went something wrong try again later.","There went something wrong try again later."
6
+ "This database doesn\'t exists.","This database doesn\'t exists."
7
+ "E-mark Mail Sync","E-mark Mail Sync"
8
+ "-- Magento fields --","-- Magento fields --"
9
+ "-- E-mark Mail fields --","-- E-mark Mail fields --"
10
+ "Magento Fields","Magento Fields"
11
+ "E-mark Mail Fields","E-mark Mail Fields"
12
+ "Add E-mark connect field","Add E-mark connect field"
13
+ "Don't forget to connect the labels in Configuration->E-Mark Mail->Customer settings","Don't forget to connect the labels in Configuration->E-Mark Mail->Customer settings"
14
+ "Successfully made 2 new selections name: 'Magento Guest - %s and 'Magento Registered User - %s'","Successfully made 2 new selections name: 'Magento Guest - %s and 'Magento Registered User - %s'"
15
+ "General settings","General settings"
16
+ "Customer settings","Customer settings"
17
+ "Password","Password"
18
+ "Connect Fields:","Connect Fields:"
19
+ "Fields","Fields"
20
+ "User","User"
app/locale/en_US/template/email/abandoned_cart_alert.html ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Hello {{var customer_name}},</strong></p>
22
+ <p>Thank you for stopping by {{var website_name}} and considering us for your purchase. We noticed that during your visit to our store you placed the following item(s) in your shopping cart, but did not complete the transaction.</p>
23
+ <p>Shopping Cart Contents: </p>
24
+
25
+ <p>{{var products}}</p>
26
+ {{depend real_quote}}
27
+ <p><a href="{{var recover_url}}" >Recover </a><br> (url:{{var recover_url}})</p>
28
+ {{/depend}}
29
+ {{depend coupon}}
30
+ <p>Feel free to use this coupon: {{var coupon}}</p>
31
+ <p>Please note that it expires in {{var coupon_days}} day(s)</p>
32
+ {{/depend}}
33
+
34
+ <p>We are always interested in knowing what reason made you decide not to purchase at this time. If you could be so kind as to let us know if you had any issues or concerns, we would appreciate it. We are asking for feedback from you and others as to how we can make your experience at {{var website_name}} better.</p>
35
+
36
+ <p>PLEASE NOTE:</p>
37
+ <p>If you believe you completed your purchase and are wondering why it was not delivered, this email is an indication that your order was NOT completed, and that you have NOT been charged! Please return to the store in order to complete your order.</p>
38
+
39
+ <p>We apologize, if you already completed your purchase and received this message by mistake.</p>
40
+
41
+ <p>Again, thank you for your time and consideration in helping us improve our website.</p>
42
+
43
+ <p>Sincerely, {{var store_name}} Team</p>
44
+
45
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
46
+ </td>
47
+ </tr>
48
+ </table>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </div>
app/locale/en_US/template/email/abandoned_cart_alert2.html ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert 2 from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Hello {{var customer_name}},</strong></p>
22
+ <p>Thank you for stopping by {{var website_name}} and considering us for your purchase. We noticed that during your visit to our store you placed the following item(s) in your shopping cart, but did not complete the transaction.</p>
23
+ <p>Shopping Cart Contents: </p>
24
+
25
+ <p>{{var products}}</p>
26
+ {{depend real_quote}}
27
+ <p><a href="{{var recover_url}}" >Recover </a><br> (url:{{var recover_url}})</p>
28
+ {{/depend}}
29
+
30
+ {{depend coupon}}
31
+ <p>Feel free to use this coupon: {{var coupon}}</p>
32
+ <p>Please note that it expires in {{var coupon_days}} day(s)</p>
33
+ {{/depend}}
34
+ <p>We are always interested in knowing what reason made you decide not to purchase at this time. If you could be so kind as to let us know if you had any issues or concerns, we would appreciate it. We are asking for feedback from you and others as to how we can make your experience at {{var website_name}} better.</p>
35
+
36
+ <p>PLEASE NOTE:</p>
37
+ <p>If you believe you completed your purchase and are wondering why it was not delivered, this email is an indication that your order was NOT completed, and that you have NOT been charged! Please return to the store in order to complete your order.</p>
38
+
39
+ <p>We apologize, if you already completed your purchase and received this message by mistake.</p>
40
+
41
+ <p>Again, thank you for your time and consideration in helping us improve our website.</p>
42
+
43
+ <p>Sincerely, {{var store_name}} Team</p>
44
+
45
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
46
+ </td>
47
+ </tr>
48
+ </table>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </div>
app/locale/en_US/template/email/abandoned_cart_alert3.html ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert 3 from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Hello {{var customer_name}},</strong></p>
22
+ <p>Thank you for stopping by {{var website_name}} and considering us for your purchase. We noticed that during your visit to our store you placed the following item(s) in your shopping cart, but did not complete the transaction.</p>
23
+ <p>Shopping Cart Contents: </p>
24
+
25
+ <p>{{var products}}</p>
26
+ {{depend real_quote}}
27
+ <p><a href="{{var recover_url}}" >Recover </a><br> (url:{{var recover_url}})</p>
28
+ {{/depend}}
29
+
30
+ {{depend coupon}}
31
+ <p>Feel free to use this coupon: {{var coupon}}</p>
32
+ <p>Please note that it expires in {{var coupon_days}} day(s)</p>
33
+ {{/depend}}
34
+
35
+ <p>We are always interested in knowing what reason made you decide not to purchase at this time. If you could be so kind as to let us know if you had any issues or concerns, we would appreciate it. We are asking for feedback from you and others as to how we can make your experience at {{var website_name}} better.</p>
36
+
37
+ <p>PLEASE NOTE:</p>
38
+ <p>If you believe you completed your purchase and are wondering why it was not delivered, this email is an indication that your order was NOT completed, and that you have NOT been charged! Please return to the store in order to complete your order.</p>
39
+
40
+ <p>We apologize, if you already completed your purchase and received this message by mistake.</p>
41
+
42
+ <p>Again, thank you for your time and consideration in helping us improve our website.</p>
43
+
44
+ <p>Sincerely, {{var store_name}} Team</p>
45
+
46
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
47
+ </td>
48
+ </tr>
49
+ </table>
50
+ </td>
51
+ </tr>
52
+ </table>
53
+ </div>
app/locale/es_ES/Emark_Cartalert.csv ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Alert Variables","Alerta de productos cambiados"
2
+ "Store View","Vista de tienda"
3
+ "Follow Up","Seguir"
4
+ "First","Primero"
5
+ "Second","Segundo"
6
+ "Third","Tercero"
7
+ "Alert Will Be Sent On","Alerta estará reenviada"
8
+ "Customer E-mail","Correo electrónico del cliente"
9
+ "Customer First Name","Nombre del cliente"
10
+ "Customer Last Name","Apellido del cliente"
11
+ "Products","Productos"
12
+ "Save and Send Out","Guardar y enviar"
13
+ "Abandoned Cart Alert","Alerta de compra abandonada"
14
+ "ID","ID"
15
+ "Abandoned At","Abandonado en"
16
+ "Scheduled At","Programado en"
17
+ "Status","Status"
18
+ "Pending","Pendiente"
19
+ "Not Sent","No enviado"
20
+ "Cancelled","Cancelado"
21
+ "Send and Save to History","Enviar y guardar en la Historia"
22
+ "Are you sure?","¿Está seguro?"
23
+ "Delete","Eliminar"
24
+ "Customer Name","Nombre del cliente"
25
+ "Message","Mensaje"
26
+ "Sent Alert","Enviar alerta"
27
+ "Sent On","Reenviado"
28
+ "Recovered On","Recuperado"
29
+ "Remote IP","IP remota"
30
+ "Update Queue Now","Actualizar la cola ahora"
31
+ "Alerts Queue","Cola de alertas"
32
+ "Add Alert","Añadir la alerta"
33
+ "Sent Alerts","Enviar alertas"
34
+ "Carts Alerts","Alertas de carritos"
35
+ "Item does not exist","El artículo no existe"
36
+ "Alert has been successfully sent and deleted","La alerta ha sido enviada y eliminada correctamente"
37
+ "Can not send the ID %d. Please check the email address and your server configuration","No se puede enviar el ID %d. Por favor, compruebe la dirección de correo electrónico y la configuración del servidor"
38
+ "Alert has been successfully saved","La alerta ha sido guardada correctamente"
39
+ "Unable to find item to save","No se puede encontrar el atributo para guardar"
40
+ "Please select cartalert(s)","Por favor, seleccione la(s) alerta(s) del carrito"
41
+ "Total of %d record(s) were successfully deleted","El total de %d de registro(s) ha sido eliminado correctamente"
42
+ "Can not send the alert ID %d. Please check the email address and your server configuration","No se puede enviar la ID de alerta %d. Por favor, compruebe la dirección de correo electrónico y la configuración del servidor"
43
+ "Total of %d email(s) have been successfully sent","El total de %d de mensaje(s) de correo electrónico ha sido enviado correctamente"
44
+ "Total of %d email(s) haven't been successfully sent: no visible products","El total de %d de mensaje(s) de correo electrónico no ha sido enviado correctamente: no hay productos visibles"
45
+ "Alert has been deleted","La alerta ha sido eliminada"
46
+ "Alerts for carts abandoned from %s to %s have been successfully added to the queue","Las alertas de carritos abandonados de %s a %s han sido agregadas a la cola correctamente"
47
+ "Unable to update queue","No se puede actualizar la cola"
48
+ "History","Hiistoria"
49
+ "Abandoned Carts Alerts","Alertas de compra abandonadas"
50
+ "Pending Alerts","Alertas pendientes"
51
+ "Abandoned Cart: The First Follow Up","El carrito abandonado: el primer seguimiento"
52
+ "Abandoned Cart: The Second Follow Up","El carrito abandonado: el segundo seguimiento"
53
+ "Abandoned Cart: The Third Follow Up","El carrito abandonado: el tercer seguimiento"
54
+ "Send E-mails","Enviar un correo electrónico"
55
+ "If set to ""No"", alert emails will be generated, but won't be sent
56
+ automatically, while manual sending will be allowed","Si marca ""No"", se generarán los mensajes de correo electrónico de
57
+ alerta, pero no se enviarán automaticamente hasta que el envío esté permitido"
58
+ "Email Sender","Remitente del correo electrónico"
59
+ "First Delay Period (minutes)","Primer período de retraso (en minutos)"
60
+ "The system will send the first follow up email after the above mentioned amount of minutes upon customer's last activity in the cart. Supported minimum is 10 minutes.","El sistema enviará el primer seguimiento de correo electrónico al pasar unos minutos después de la última actividad del cliente en su carrito de compra. El tiempo mínimo estimado es de 10 minutos."
61
+ "First Email Template","Primera plantilla de correo electrónico"
62
+ "Second Delay Period (hours)","Segundo periodo de retraso (horas)"
63
+ "The system will send the second follow up email after the above mentioned amount of hours upon customer's last activity in the cart.","El sistema le enviará el segundo seguimiento de correo electrónico al pasar cierta cantidad de horas antes mencionada después de la última actividad del cliente en su carrito de compra."
64
+ "Second Email Template","Segunda plantilla de correo electrónico"
65
+ "Third Delay Period (hours)","Tercer periodo de retraso (horas)"
66
+ "The system will send the third follow up email after the above mentioned amount of hours upon customer's last activity in the cart.","El sistema enviará el tercer seguimiento de correo electrónico al pasar cierta cantidad de horas antes mencionada después de la última actividad del cliente en su carrito de compra."
67
+ "Third Email Template","Tercera plantilla de correo electrónico"
68
+ "Stop alerts sending once the recipient makes a purchase","Dejar de enviar los mensajes de alerta una vez que el destinatario haga la compra"
69
+ "Stop alerts sending once the recipient clicks a link in an email","Dejar de enviar los mensajes de alerta una vez que el destinatario haga clic en un vínculo de un correo electrónico"
70
+ "Include coupon in","Incluir el cupón en"
71
+ "Discount type","Tipo de descuento"
72
+ "Discount amount","Importe de descuento"
73
+ "Expire coupon in (days)","El cupón vence en (días)"
74
+ "BCC Email","Correo electrónico BBC"
75
+ "Percent of product price discount","Porcentaje del descuento del precio del producto"
76
+ "Fixed amount discount","Importe fijo del descuento"
77
+ "Fixed amount discount for whole cart","Descuento de monto fijo para todo el carrito"
78
+ " Email Template","Plantilla de correo electrónico"
79
+ "Friend","Amigo"
80
+
app/locale/es_ES/template/email/abandoned_cart_alert.html ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Hola {{var customer_name}},</strong></p>
22
+ <p>Gracias por venir a {{var website_name}} y escogernos para hacer su compra. Nos hemos dado cuenta de que durante su visita a nuestra tienda ha colocado el(los) sigiente(s) artículo(s) en su carrito de compra, pero no se ha completado la transacción.</p>
23
+ <p>Contenido del carrito de Compra: </p>
24
+
25
+ <p>{{var products}}</p>
26
+ {{depend real_quote}}
27
+ <p><a href="{{var recover_url}}" >Recobrar </a><br> (url:{{var recover_url}})</p>
28
+ {{/depend}}
29
+ {{depend coupon}}
30
+ <p>Siéntase libre de usar este cupón: {{var coupon}}</p>
31
+ <p>Tenga en cuenta que termina en {{var coupon_days}} día(s)</p>
32
+ {{/depender}}
33
+ <p>Siempre estamos interesados en saber por qué ha decidido no comprar en este momento. Si pudieras ser tan amable de hacernos saber si había algún problema o duda, se lo agradeceríamos. Estamos pidiendo comentarios de usted y otros clientes para hacer su experiencia en el {{var página web_nombre}} mejor.</p>
34
+
35
+ <p>TENGA EN CUENTA:</p>
36
+ <p>Si usted cree que ha completado su compra y se pregunta por qué no se ha entregado, este mensaje es una indicación de que su pedido no se ha completado, y que no ha sido cobrado! Por favor, vuelva a la tienda para completar su pedido.</p>
37
+
38
+ <p>Pedimos disculpas, si usted ya ha completado su compra y ha recibido este mensaje por error.</p>
39
+
40
+ <p>Una vez más, gracias por su tiempo y consideración en ayudarnos a mejorar nuestra página web.</p>
41
+
42
+ <p>Atentamente, {{var store_name}} Grupo</p>
43
+
44
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
45
+ </td>
46
+ </tr>
47
+ </table>
48
+ </td>
49
+ </tr>
50
+ </table>
51
+ </div>
app/locale/es_ES/template/email/abandoned_cart_alert2.html ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert 2 from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Hola {{var customer_name}},</strong></p>
22
+ <p>Gracias por venir a {{var website_name}} y escogernos para hacer su compra. Nos hemos dado cuenta de que durante su visita a nuestra tienda ha colocado el(los) sigiente(s) artículo(s) en su carrito de compra, pero no se ha completado la transacción.</p>
23
+ <p>Contenido del carrito de Compra: </p>
24
+
25
+ <p>{{var products}}</p>
26
+ {{depend real_quote}}
27
+ <p><a href="{{var recover_url}}" >Recobrar </a><br> (url:{{var recover_url}})</p>
28
+ {{/depend}}
29
+ {{depend coupon}}
30
+ <p>Siéntase libre de usar este cupón: {{var coupon}}</p>
31
+ <p>Tenga en cuenta que termina en {{var coupon_days}} día(s)</p>
32
+ {{/depend}}
33
+ <p>Siempre estamos interesados en saber por qué ha decidido no comprar en este momento. Si pudieras ser tan amable de hacernos saber si había algún problema o duda, se lo agradeceríamos. Estamos pidiendo comentarios de usted y otros clientes para hacer su experiencia en el {{var website_name}} mejor.</p>
34
+
35
+ <p>TENGA EN CUENTA:</p>
36
+ <p>Si usted cree que ha completado su compra y se pregunta por qué no se ha entregado, este mensaje es una indicación de que su pedido no se ha completado, y que no ha sido cobrado! Por favor, vuelva a la tienda para completar su pedido.</p>
37
+
38
+ <p>Pedimos disculpas, si usted ya ha completado su compra y ha recibido este mensaje por error.</p>
39
+
40
+ <p>Una vez más, gracias por su tiempo y consideración en ayudarnos a mejorar nuestra página web.</p>
41
+
42
+ <p>Atentamente, {{var store_name}} Grupo</p>
43
+
44
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
45
+ </td>
46
+ </tr>
47
+ </table>
48
+ </td>
49
+ </tr>
50
+ </table>
51
+ </div>
app/locale/es_ES/template/email/abandoned_cart_alert3.html ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert 3 from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Hola {{var customer_name}},</strong></p>
22
+ <p>Gracias por venir a {{var website_name}} y escogernos para hacer su compra. Nos hemos dado cuenta de que durante su visita a nuestra tienda ha colocado el(los) sigiente(s) artículo(s) en su carrito de compra, pero no se ha completado la transacción.</p>
23
+ <p>Contenido del carrito de Compra: </p>
24
+
25
+ <p>{{var productos}}</p>
26
+ {{depend real_quote}}
27
+ <p><a href="{{var recover_url}}" >Recobrar </a><br> (url:{{var recover_url}})</p>
28
+ {{/depend}}
29
+
30
+ {{depend coupon}}
31
+ <p>Siéntase libre de usar este cupón: {{var coupon}}</p>
32
+ <p>Tenga en cuenta que termina en {{var coupon_days}} día(s)</p>
33
+ {{/depend}}
34
+ <p>Siempre estamos interesados en saber por qué ha decidido no comprar en este momento. Si pudieras ser tan amable de hacernos saber si había algún problema o duda, se lo agradeceríamos. Estamos pidiendo comentarios de usted y otros clientes para hacer su experiencia en el {{var website_name}} mejor.</p>
35
+
36
+ <p>TENGA EN CUENTA:</p>
37
+ <p>Si usted cree que ha completado su compra y se pregunta por qué no se ha entregado, este mensaje es una indicación de que su pedido no se ha completado, y que no ha sido cobrado! Por favor, vuelva a la tienda para completar su pedido.</p>
38
+
39
+ <p>Pedimos disculpas, si usted ya ha completado su compra y ha recibido este mensaje por error.</p>
40
+
41
+ <p>Una vez más, gracias por su tiempo y consideración en ayudarnos a mejorar nuestra página web.</p>
42
+
43
+ <p>Atentamente, {{var store_name}} Grupo</p>
44
+
45
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
46
+ </td>
47
+ </tr>
48
+ </table>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </div>
app/locale/fr_FR/Emark_Cartalert.csv ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Alert Variables","Variables d'alerte"
2
+ "Store View","Vue de magasin"
3
+ "Follow Up","Suivre"
4
+ "First","Premier"
5
+ "Second","Second"
6
+ "Third","Troisième"
7
+ "Alert Will Be Sent On","Alerte sera envoyé sur"
8
+ "Customer E-mail","Email d'utilisateur"
9
+ "Customer First Name","Nom d'utilisateur"
10
+ "Customer Last Name","Prénom d'utilisateur"
11
+ "Products","Produits"
12
+ "Save and Send Out","Enregistrer et envoyer"
13
+ "Abandoned Cart Alert","Alerte Panier abandonné"
14
+ "ID","ID"
15
+ "Abandoned At","Abandonné à"
16
+ "Scheduled At","Prévu à"
17
+ "Status","Statut"
18
+ "Pending","Dans l'attente de"
19
+ "Not Sent","Non envoyé"
20
+ "Cancelled","Annulé"
21
+ "Send and Save to History","Envoyer et enregistrer dans l'histoire"
22
+ "Are you sure?","Etes-vous sûr?"
23
+ "Delete","Supprimer"
24
+ "Customer Name","Nom d'utilisateur"
25
+ "Message","Message"
26
+ "Sent Alert","Envoyé une alerte"
27
+ "Sent On","Envoyé dans"
28
+ "Recovered On","Retrouvé le"
29
+ "Remote IP","IP éloigné"
30
+ "Update Queue Now","Mettre à jour la file d'attente maintenant"
31
+ "Alerts Queue","Alertes file d'attente"
32
+ "Add Alert","Ajouter une alerte"
33
+ "Sent Alerts","Alertes envoyées"
34
+ "Carts Alerts","Alertes Paniers"
35
+ "Item does not exist","Cet article n'existe pas"
36
+ "Alert has been successfully sent and deleted","Alerte a été envoyée avec succès et supprimée"
37
+ "Can not send the ID %d. Please check the email address and your server configuration","Impossible d'envoyer l'ID %d. S'il vous plaît vérifier l'adresse e-mail et votre configuration de serveur"
38
+ "Alert has been successfully saved","Alerte a en été enregistrée avec succès"
39
+ "Unable to find item to save","Impossible de trouver un élément à enregistrer"
40
+ "Please select cartalert(s)","S'il vous plaît sélectionnez AlertePanier(s)"
41
+ "Total of %d record(s) were successfully deleted","Total des %d enregistrement (s) ont été supprimé avec succès"
42
+ "Can not send the alert ID %d. Please check the email address and your server configuration","Impossible d'envoyer l'ID %d. alerte S'il vous plaît vérifier l'adresse e-mail et votre configuration de serveur"
43
+ "Total of %d email(s) have been successfully sent","Total des %d e-mail (s) ont été envoyé avec succès"
44
+ "Total of %d email(s) haven't been successfully sent: no visible products","Total des %d e-mail (s) n' ont (pas) été envoyé avec succès: pas de produits visibles"
45
+ "Alert has been deleted","Alert has been deleted"
46
+ "Alerts for carts abandoned from %s to %s have been successfully added to the queue","Alertes pour les chariots abandonnés de %s à %s ont bien été ajouté à la file d'attente"
47
+ "Unable to update queue","Impossible de mettre à jour la file d'attente"
48
+ "History","Histoire"
49
+ "Abandoned Carts Alerts","Alerte Panier abandonné"
50
+ "Pending Alerts","Les alertes en cours"
51
+ "Abandoned Cart: The First Follow Up","Panier abandonné: Le premier suivi"
52
+ "Abandoned Cart: The Second Follow Up","Panier abandonné: Le deuxième suivi"
53
+ "Abandoned Cart: The Third Follow Up","Panier abandonné: Le troisième suivi"
54
+ "Send E-mails","Envoyer par e-mails"
55
+ "If set to ""No"", alert emails will be generated, but won't be sent
56
+ automatically, while manual sending will be allowed","Si réglé sur ""Non"", l'alerte des e-mails sera émise, mais ne sera pas envoyée
57
+ Automatiquement tandis que l'envoi manuel sera autorisé"
58
+ "Email Sender","Envoyeur de l'email"
59
+ "First Delay Period (minutes)","Premier période de délai (minutes)"
60
+ "The system will send the first follow up email after the above mentioned amount of minutes upon customer's last activity in the cart. Supported minimum is 10 minutes.","Le système vous enverra le premier courriel de suivi après le montant ci-dessus de minutes sur la dernière activité du client dans le panier. La prise en chargemonimale est 10 minutes."
61
+ "First Email Template","Premier Modèle de courrier électronique"
62
+ "Second Delay Period (hours)","Deuxième période de délai (heures)"
63
+ "The system will send the second follow up email after the above mentioned amount of hours upon customer's last activity in the cart.","Le système vous enverra le deuxième courriel de suivi après le montant ci-dessus des heures après la dernière activité du client dans le panier."
64
+ "Second Email Template","Deuxième Modèle de courrier électronique"
65
+ "Third Delay Period (hours)","Troisième période de délai (heures)"
66
+ "The system will send the third follow up email after the above mentioned amount of hours upon customer's last activity in the cart.","Le système vous enverra le troisième courriel de suivi après le montant ci-dessus des heures après la dernière activité du client dans le panier."
67
+ "Third Email Template","Troisième Modèle de courrier électronique"
68
+ "Stop alerts sending once the recipient makes a purchase","Arrêter l'envoi d'alertes lorsque le bénéficiaire fait un achat"
69
+ "Stop alerts sending once the recipient clicks a link in an email","Arrêter l'envoi d'alertes lorsque le destinataire clique sur un lien dans un e-mail"
70
+ "Include coupon in","Inclure le coupon dans"
71
+ "Discount type","Type de réduction"
72
+ "Discount amount","Montant du réduction"
73
+ "Expire coupon in (days)","Coupon expire dans (jours)"
74
+ "BCC Email","Email BCC"
75
+ "Percent of product price discount","Pourcentage de la réduction des prix des produits"
76
+ "Fixed amount discount","Montant de réduction fixe"
77
+ "Fixed amount discount for whole cart","Montant de réduction fixe pour tout le panier"
78
+ " Email Template","Modèle de courrier électronique"
79
+ "Friend","Ami"
80
+
app/locale/fr_FR/template/email/abandoned_cart_alert.html ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Bonjour {{var customer_name}},</strong></p>
22
+ <p>Merci pour votre visite de {{var website_name}} et votre intention de faire l'achat chez nous. Nous avons remarque que lors de votre visite a notre boutique vous avez place le(s) article(s) suivant (s) dans votre panier, mais n'avez pas termine la transaction.</p>
23
+ <p>Contenu du panier: </p>
24
+
25
+ <p>{{var products}}</p>
26
+ {{depend real_quote}}
27
+ <p><a href="{{var recover_url}}" >Recupere </a><br> (url:{{var recover_url}})</p>
28
+ {{/depend}}
29
+ {{depend coupon}}
30
+ <p>N'hesitez pas a utiliser ce coupon: {{var coupon}}</p>
31
+ <p>S'il vous plait, faites attention qu'il est valide a {{var coupon_days}} jour(s)</p>
32
+ {{/depend}}
33
+
34
+ <p>Nous sommes toujours interesses de savoir pour quelle raison vous avez decide de ne pas acheter en ce moment.Si vous pouviez avoir la gentillesse de nous faire savoir si vous avez des questions ou des preoccupations, nous vous en serions reconnaissants.Nous vous demandons de nous informer comment nous pouvons faire de votre experience a{{var website_name}} a mieux.</p>
35
+
36
+ <p>FAITES ATTENTION, S'IL VOUS PLAIT:</p>
37
+ <p>Si vous pensez que vous avez complete votre achat et vous vous demandez pourquoi il n'a pas ete livre, cet e-mail est une indication que votre commande N'A PAS ETE ACHEVE, et que vous N'AVEZ PAS ETE facture! S'il vous plait retourner au magasin afin de completer votre commander.</p>
38
+
39
+ <p>Nous nous excusons, si vous avez deja effectue votre achat et avez recu ce message par erreur .</p>
40
+
41
+ <p>Encore une fois, nous vous remercions pour votre temps et votre consideration pour nous aider a ameliorer notre site Web.</p>
42
+
43
+ <p>Sincerement, {{var store_name}} Equipe</p>
44
+
45
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
46
+ </td>
47
+ </tr>
48
+ </table>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </div>
app/locale/fr_FR/template/email/abandoned_cart_alert2.html ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert 2 from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Bonjour {{var customer_name}},</strong></p>
22
+ <p>Merci pour votre visite de {{var website_name}} et votre intention de faire l'achat chez nous.Nous avons remarque que lors de votre visite a notre boutique vous avez place le(s) article(s) suivant (s) dans votre panier, mais n'avez pas termine la transaction.</p>
23
+ <p>Contenu du panier: </p>
24
+
25
+
26
+ <p>{{var products}}</p>
27
+ {{depend real_quote}}
28
+ <p><a href="{{var recover_url}}" >Recupere </a><br> (url:{{var recover_url}})</p>
29
+ {{/depend}}
30
+
31
+ {{depend coupon}}
32
+ <p>N'hesitez pas a utiliser ce coupon: {{var coupon}}</p>
33
+ <p>S'il vous plait, faites attention qu'il est valide a {{var coupon_days}} jour(s)</p>
34
+ {{/depend}}
35
+ <p>Nous sommes toujours interesses de savoir pour quelle raison vous avez decide de ne pas acheter en ce moment. Si vous pouviez avoir la gentillesse de nous faire savoir si vous avez des questions ou des preoccupations, nous vous en serions reconnaissants.Nous vous demandons de nous informer comment nous pouvons faire de votre experience a{{var website_name}} a mieux.</p>
36
+
37
+ <p>FAITES ATTENTION, S'IL VOUS PLAIT:</p>
38
+ <p>Si vous pensez que vous avez complete votre achat et vous vous demandez pourquoi il n'a pas ete livre, cet e-mail est une indication que votre commande N'A PAS ETE ACHEVE, et que vous N'AVEZ PAS ETE facture! S'il vous plait retourner au magasin afin de completer votre commander.</p>
39
+
40
+ <p>us nous excusons, si vous avez deja effectue votre achat et avez recu ce message par erreur.</p>
41
+
42
+ <p>Encore une fois, nous vous remercions pour votre temps et votre consideration pour nous aider a ameliorer notre site Web.</p>
43
+
44
+ <p>Sincerement, {{var store_name}} Equipe</p>
45
+
46
+
47
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
48
+ </td>
49
+ </tr>
50
+ </table>
51
+ </td>
52
+ </tr>
53
+ </table>
54
+ </div>
app/locale/fr_FR/template/email/abandoned_cart_alert3.html ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert 3 from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Bonjour {{var customer_name}},</strong></p>
22
+ <p>Merci pour votre visite de {{var website_name}} et votre intention de faire l'achat chez nous. et votre intention de faire l'achat chez nous
23
+
24
+ <p>{{var products}}</p>
25
+ {{depend real_quote}}
26
+ <p><a href="{{var recover_url}}" >Recupere </a><br> (url:{{var recover_url}})</p>
27
+ {{/depend}}
28
+
29
+ {{depend coupon}}
30
+ <p>Recupere: {{var coupon}}</p>
31
+ <p>S'il vous plait, faites attention qu'il est valide a {{var coupon_days}} jour(s)</p>
32
+ {{/depend}}
33
+
34
+ <p>Nous sommes toujours interesses de savoir pour quelle raison vous avez decide de ne pas acheter en ce moment.Si vous pouviez avoir la gentillesse de nous faire savoir si vous avez des questions ou des preoccupations, nous vous en serions reconnaissants.Nous vous demandons de nous informer comment nous pouvons faire de votre experience a{{var website_name}} a mieux.</p>
35
+
36
+ <p>FAITES ATTENTION, S'IL VOUS PLAIT:</p>
37
+ <p>Si vous pensez que vous avez complete votre achat et vous vous demandez pourquoi il n'a pas ete livre, cet e-mail est une indication que votre commande N'A PAS ETE ACHEVE, et que vous N'AVEZ PAS ETE facture! S'il vous plait retourner au magasin afin de completer votre commander.</p>
38
+
39
+ <p>Nous nous excusons, si vous avez deja effectue votre achat et avez recu ce message par erreur .</p>
40
+
41
+ <p>Encore une fois, nous vous remercions pour votre temps et votre consideration pour nous aider a ameliorer notre site Web.</p>
42
+
43
+ <p>Sincerement, {{var store_name}} Equipe</p>
44
+
45
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
46
+ </td>
47
+ </tr>
48
+ </table>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </div>
app/locale/it_IT/Emark_Cartalert.csv ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Alert Variables","Avvisi Variabili"
2
+ "Store View","Visione del Negozio"
3
+ "Follow Up","Terminare"
4
+ "First","Primo"
5
+ "Second","Secondo"
6
+ "Third","Terzo"
7
+ "Alert Will Be Sent On","Avviso sara` inviato il"
8
+ "Customer E-mail","E-mail del Cliente"
9
+ "Customer First Name","Nome del Cliente"
10
+ "Customer Last Name","Cognome del Cliente"
11
+ "Products","Prodotti"
12
+ "Save and Send Out","Salvare e Inviare"
13
+ "Abandoned Cart Alert","Avviso del Carrello Abbandonato"
14
+ "ID","ID"
15
+ "Abandoned At","Abbandonato a"
16
+ "Scheduled At","Programmato a"
17
+ "Status","Status"
18
+ "Pending","In attesa"
19
+ "Not Sent","Non inviato"
20
+ "Cancelled","Cancellato"
21
+ "Send and Save to History","Inviare e salvare in storia"
22
+ "Are you sure?","Sei sicuro?"
23
+ "Delete","Cancellare"
24
+ "Customer Name","Nome del Cliente"
25
+ "Message","Messaggio"
26
+ "Sent Alert","Avviso inviato"
27
+ "Sent On","Inviato il"
28
+ "Recovered On","Recuperato il"
29
+ "Remote IP","IP Remoto"
30
+ "Update Queue Now","Aggiornare Fila Ora"
31
+ "Alerts Queue","Fila di Avvisi"
32
+ "Add Alert","Aggiungere Avviso"
33
+ "Sent Alerts","Inviare Avviso"
34
+ "Carts Alerts","Avvisi di Carrello"
35
+ "Item does not exist","Articolo non esiste"
36
+ "Alert has been successfully sent and deleted","Avviso e` stato inviato e cancellato"
37
+ "Can not send the ID %d. Please check the email address and your server configuration","Non e` possibile inviare ID %d. Si prega di verificare l'indirizzo di email e configurazioni del vostro server"
38
+ "Alert has been successfully saved","Avviso e` stato salvato"
39
+ "Unable to find item to save","Non e` possibile trovare articolo da salvare"
40
+ "Please select cartalert(s)","Scegli avviso(i) di carrello"
41
+ "Total of %d record(s) were successfully deleted","Tutto di %d recordo(i) e` stato cancellato"
42
+ "Can not send the alert ID %d. Please check the email address and your server configuration","Non e` possibile inviare ID %d. Si prega di verificare l'indirizzo di email e configurazioni del vostro server"
43
+ "Total of %d email(s) have been successfully sent","Totale di %d email(s) sono stati inviati"
44
+ "Total of %d email(s) haven't been successfully sent: no visible products","Totale di %d email(s) non sono stati inviati: non ci sono prodotti visibili"
45
+ "Alert has been deleted","Avviso e` stato cancellato"
46
+ "Alerts for carts abandoned from %s to %s have been successfully added to the queue","Avvisi per carrelli abbandonati da %s a %s sono stati aggiunti in fila."
47
+ "Unable to update queue","Non e` possibile aggiornale la fila"
48
+ "History","Storia"
49
+ "Abandoned Carts Alerts","Avviso di Carrelli Abbandonati"
50
+ "Pending Alerts","Avvisi in Attesa"
51
+ "Abandoned Cart: The First Follow Up","Carrello Abbandonato: La Prima Sorveglianza"
52
+ "Abandoned Cart: The Second Follow Up","Carrello Abbandonato: La Seconda Sorveglianza"
53
+ "Abandoned Cart: The Third Follow Up","Carrello Abbandonato: La Terza Sorveglianza"
54
+ "Send E-mails","Inviare E-mails"
55
+ "If set to ""No"", alert emails will be generated, but won't be sent
56
+ automatically, while manual sending will be allowed","Se impostato ""No"", emails di avviso saranno generati, ma non saranno inviati
57
+ automaticamente, e ci sara` possibilita` di invio manuale"
58
+ "Email Sender","Mittente di Email"
59
+ "First Delay Period (minutes)","Primo tempo di ritardo (minuti)"
60
+ "The system will send the first follow up email after the above mentioned amount of minutes upon customer's last activity in the cart. Supported minimum is 10 minutes.","Il sistema inviera` il primo email di sorveglianza dopo quantita` di minuti indicata sopra secondo ultima attivita` del cliente nel carrello. Il minimo supporto e`10 minuti."
61
+ "First Email Template","Primo modello di e-mail"
62
+ "Second Delay Period (hours)","Secondo tempo di ritardo (ore)"
63
+ "The system will send the second follow up email after the above mentioned amount of hours upon customer's last activity in the cart.","Il sistema inviera` il secondo email di sorveglianza dopo quantita` di ore indicata sopra secondo ultima attivita` del cliente nel carrello."
64
+ "Second Email Template","Secondo modello di e-mail"
65
+ "Third Delay Period (hours)","Terzo tempo di ritardo (ore)"
66
+ "The system will send the third follow up email after the above mentioned amount of hours upon customer's last activity in the cart.","Il sistema inviera` il terzo email di sorveglianza dopo quantita` di ore indicata sopra secondo ultima attivita` del cliente nel carrello."
67
+ "Third Email Template","Terzo modello di e-mail"
68
+ "Stop alerts sending once the recipient makes a purchase","Smettere di inviare avvisi non appena il ricevitore effettua un acquisto."
69
+ "Stop alerts sending once the recipient clicks a link in an email","Smettere di inviare avvisi non appena il ricevitore clicca sul link in email."
70
+ "Include coupon in","Includere coupon in"
71
+ "Discount type","Tipo di Sconto"
72
+ "Discount amount","Importo di Sconto"
73
+ "Expire coupon in (days)","Coupon scade tra (giorni)"
74
+ "BCC Email","BCC Email"
75
+ "Percent of product price discount","Percentuale dello sconto sul prezzo del prodotto"
76
+ "Fixed amount discount","Importo fisso dello sconto"
77
+ "Fixed amount discount for whole cart","Importo fisso dello sconto per tutto il carrello"
78
+ " Email Template","Modello di Email"
79
+ "Friend","Amico"
80
+
app/locale/it_IT/template/email/abandoned_cart_alert.html ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Ciao {{var customer_name}},</strong></p>
22
+ <p>Grazie di esserti fermato a {{var website_name}} e consideratoci per i tuoi aquisti. Abbiamo notato che durante la tua visita del nostro negozio hai messo oggetto (i) seguente (i) nel tuo carrello, ma non hai completato la transazione.</p>
23
+ <p>contenuto di carrello: </p>
24
+
25
+ <p>{{var products}}</p>
26
+ {{depend real_quote}}
27
+ <p><a href="{{var recover_url}}" >Riattivare </a><br> (url:{{var recover_url}})</p>
28
+ {{/depend}}
29
+
30
+ {{depend coupon}}
31
+ <p>Per favore usa questa cedola: {{var coupon}}</p>
32
+ <p>Per favore nota che scade tra {{var coupon_days}} giorno(i)</p>
33
+ {{/depend}}
34
+ <p>oi siamo sempre interessati di sapere perche` hai deciso di non fare gli acquisti questa volta. Se potresti essere gentile di farci sapere, se hai qualche problema
35
+ o questione, saremmo molto riconoscenti se ci scrissi
36
+ tu o altri clienti, cosi` che noi possiamo fare il nostro sito {{var website_name}} migliore..</p>
37
+
38
+ <p>PREGHIAMO NOTARE:</p>
39
+ <p>Se credi di aver completato il tuo acquisto e ti interessa perche` non e` stato consegnato, questo email e` indicazione che il tuo ordine NON e` stato completato, e tu NON hai pagato! Per favore, torna nel negozio per completare il tuo ordine.</p>
40
+
41
+ <p>Chiediamo scusa, se hai gia` completato il tuo aquisto e hai ricevuti questo messaggio per sbaglio.</p>
42
+
43
+ <p>Ancora una volta, grazie del tuo tempo e parere per aiutarci a migliorare il nostro sito.</p>
44
+
45
+ <p>Distinti saluti, {{var store_name}} Squadra</p>
46
+
47
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
48
+ </td>
49
+ </tr>
50
+ </table>
51
+ </td>
52
+ </tr>
53
+ </table>
54
+ </div>
app/locale/it_IT/template/email/abandoned_cart_alert2.html ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert 2 from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Ciao {{var customer_name}},</strong></p>
22
+ <p>Grazie di esserti fermato a {{var website_name}} e consideratoci per i tuoi aquisti. Abbiamo notato che durante la tua visita del nostro negozio hai messo oggetto (i) seguente (i) nel tuo carrello, ma non hai completato la transazione.</p>
23
+ <p>contenuto di carrello: </p>
24
+
25
+ <p>{{var products}}</p>
26
+ {{depend real_quote}}
27
+ <p><a href="{{var recover_url}}" >Riattivare </a><br> (url:{{var recover_url}})</p>
28
+ {{/depend}}
29
+
30
+ {{depend coupon}}
31
+ <p>Per favore usa questa cedola: {{var coupon}}</p>
32
+ <p>Per favore nota che scade tra {{var coupon_days}} giorno(i)</p>
33
+ {{/depend}}
34
+ <p>oi siamo sempre interessati di sapere perche` hai deciso di non fare gli acquisti questa volta. Se potresti essere gentile di farci sapere, se hai qualche problema
35
+ o questione, saremmo molto riconoscenti se ci scrissi
36
+ tu o altri clienti, cosi` che noi possiamo fare il nostro sito {{var website_name}} migliore..</p>
37
+
38
+ <p>PREGHIAMO NOTARE:</p>
39
+ <p>Se credi di aver completato il tuo acquisto e ti interessa perche` non e` stato consegnato, questo email e` indicazione che il tuo ordine NON e` stato completato, e tu NON hai pagato! Per favore, torna nel negozio per completare il tuo ordine.</p>
40
+
41
+ <p>Chiediamo scusa, se hai gia` completato il tuo aquisto e hai ricevuti questo messaggio per sbaglio.</p>
42
+
43
+ <p>Ancora una volta, grazie del tuo tempo e parere per aiutarci a migliorare il nostro sito.</p>
44
+
45
+ <p>Distinti saluti, {{var store_name}} Squadra</p>
46
+
47
+
48
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </td>
53
+ </tr>
54
+ </table>
55
+ </div>
app/locale/it_IT/template/email/abandoned_cart_alert3.html ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert 3 from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Ciao {{var customer_name}},</strong></p>
22
+ <p>Grazie di esserti fermato a {{var website_name}} e consideratoci per i tuoi aquisti. Abbiamo notato che durante la tua visita del nostro negozio hai messo oggetto (i) seguente (i) nel tuo carrello, ma non hai completato la transazione.</p>
23
+ <p>Il contenuto di carrello: </p>
24
+
25
+ <p>{{var products}}</p>
26
+ {{depend real_quote}}
27
+ <p><a href="{{var recover_url}}" > Riattivare </a><br> (url:{{var recover_url}})</p>
28
+ {{/depend}}
29
+
30
+ {{depend coupon}}
31
+ <p>Per favore usa questa cedola: {{var coupon}}</p>
32
+ <p>Per favore nota che scade tra {{var coupon_days}} giorno(i)</p>
33
+ {{/depend}}
34
+
35
+ <p>Noi siamo sempre interessati di sapere perche` hai deciso di non fare gli acquisti questa volta. Se potresti essere gentile di farci sapere, se hai qualche problema
36
+ o questione, saremmo molto riconoscenti se ci scrissi
37
+ tu o altri clienti, cosi` che noi possiamo fare il nostro sito {{var website_name}} migliore.</p>
38
+
39
+ <p>PREGHIAMO NOTARE:</p>
40
+ <p>Se credi di aver completato il tuo acquisto e ti interessa perche` non e` stato consegnato, questo email e` indicazione che il tuo ordine NON e` stato completato, e tu NON hai pagato! Per favore, torna nel negozio per completare il tuo ordine.</p>
41
+
42
+ <p>Chiediamo scusa, se hai gia` completato il tuo aquisto e hai ricevuto questo messaggio per sbaglio.</p>
43
+
44
+ <p>Ancora una volta, grazie del tuo tempo e parere per aiutarci a migliorare il nostro sito.</p>
45
+
46
+ <p>Distinti saluti, {{var store_name}} Squadra</p>
47
+
48
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </td>
53
+ </tr>
54
+ </table>
55
+ </div>
app/locale/nl_NL/Emark_Cartalert.csv ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Alert Variables","Waarschuwing Variabelen"
2
+ "Store View","Winkel Overzicht"
3
+ "Follow Up","Vervolgen"
4
+ "First","Eerste"
5
+ "Second","Tweede"
6
+ "Third","Derde"
7
+ "Alert Will Be Sent On","Waarschuwing zal worden verzonden op"
8
+ "Customer E-mail","Klant E-mail"
9
+ "Customer First Name","Voornaam van de Klant"
10
+ "Customer Last Name","Achternaam van de Klant"
11
+ "Products","Producten"
12
+ "Save and Send Out","Opslaan en Verzenden"
13
+ "Abandoned Cart Alert","Verlaten Winkelwagen Waarschuwing"
14
+ "ID","ID"
15
+ "Abandoned At","Verlaten Op"
16
+ "Scheduled At","Gepland op"
17
+ "Status","Status"
18
+ "Pending","In Afwachting"
19
+ "Not Sent","Niet Verzonden"
20
+ "Cancelled","Geannuleerd"
21
+ "Send and Save to History","Verzenden en in Geschiedenis Opslaan"
22
+ "Are you sure?","Bent u zeker?"
23
+ "Delete","Verwijderen"
24
+ "Customer Name","Klant Naam"
25
+ "Message","Bericht"
26
+ "Sent Alert","Verzonden Waarschuwingen"
27
+ "Sent On","Verzonden op"
28
+ "Recovered On","Teruggevorderd op"
29
+ "Remote IP","Remote IP"
30
+ "Update Queue Now","Wachtrij Nu Updaten"
31
+ "Alerts Queue","Waarschuwingen Wachtrij"
32
+ "Add Alert","Voeg een Waarschuwing toe"
33
+ "Sent Alerts","Verzonden Waarschuwingen"
34
+ "Carts Alerts","Winkelwagens Waarschuwingen"
35
+ "Item does not exist","Item bestaat niet"
36
+ "Alert has been successfully sent and deleted","Waarschuwing is succesvol verzonden en verwijderde"
37
+ "Can not send the ID %d. Please check the email address and your server configuration","Kan de ID %d niet verzenden. Controleer alstublieft het e-mailadres en uw server configuratie"
38
+ "Alert has been successfully saved","Waarschuwing is succesvol opgeslagen"
39
+ "Unable to find item to save","Kan geen item vinden om opteslagen"
40
+ "Please select cartalert(s)","Selecteer alstublieft winkelwagen waarschuwing(en)"
41
+ "Total of %d record(s) were successfully deleted","In totaal %d record(s) zijn succesvol verwijderd"
42
+ "Can not send the alert ID %d. Please check the email address and your server configuration","Kan de waarschuwing ID %d niet verzenden. Controleer alstublieft het e-mailadres en uw server configuratie"
43
+ "Total of %d email(s) have been successfully sent","In Totaal zijn er %d email(s) succesvol verzonden"
44
+ "Total of %d email(s) haven't been successfully sent: no visible products","In totaal zijn er %d email(s) mislukt te verzenden: geen zichtbare produkten"
45
+ "Alert has been deleted","Waarschuwing is verwijderd"
46
+ "Alerts for carts abandoned from %s to %s have been successfully added to the queue","Waarschuwingen voor de winkelwagens verlaten van %s tot %s zijn succesvol toegevoegd aan de wachtrij"
47
+ "Unable to update queue","Kan de wachtrij niet updaten"
48
+ "History","Geschiedenis"
49
+ "Abandoned Carts Alerts","Verlaten Winkelwagentjes Waarschuwingen"
50
+ "Pending Alerts","Hangende Waarschuwingen"
51
+ "Abandoned Cart: The First Follow Up","Verlaten winkelwagen: De Eerste Vervolgen"
52
+ "Abandoned Cart: The Second Follow Up","Verlaten winkelwagen: De Tweede Vervolgen"
53
+ "Abandoned Cart: The Third Follow Up","Verlaten winkelwagen: De Derde Vervolgen"
54
+ "Send E-mails","Stuur E-mails"
55
+ "If set to ""No"", alert emails will be generated, but won't be sent
56
+ automatically, while manual sending will be allowed","Indien ingesteld op ""Nee"", Waarschuwing e-mails zullen worden gegenereerd, maar zullen niet
57
+ automatisch worden verzonden terwijl de handmatige verzenden wordt toegestaan"
58
+ "Email Sender","Email Afzender"
59
+ "First Delay Period (minutes)","Eerste Vertragings Periode (minuten)"
60
+ "The system will send the first follow up email after the above mentioned amount of minutes upon customer's last activity in the cart. Supported minimum is 10 minutes.","Het systeem stuurt de eerste opvolgings email na de hierboven genoemde aantal minuten na de laatste activiteit van de klant in de winkelwagen. Ondersteund minimum is 10 minuten."
61
+ "First Email Template","Eerste Email Sjabloon"
62
+ "Second Delay Period (hours)","Tweede Vertragings Periode (uren)"
63
+ "The system will send the second follow up email after the above mentioned amount of hours upon customer's last activity in the cart.","Het systeem stuurt de tweede opvolgings email na de hierboven genoemde aantal uren na de laatste activiteit van de klant in de winkelwagen."
64
+ "Second Email Template","Tweede Email Sjabloon"
65
+ "Third Delay Period (hours)","Derde Vertragings Periode (uren)"
66
+ "The system will send the third follow up email after the above mentioned amount of hours upon customer's last activity in the cart.","Het systeem stuurt de derde opvolgings email na de hierboven genoemde aantal uren na de laatste activiteit van de klant in de winkelwagen.Third Email Template"
67
+ "Third Email Template","Derde Email Sjabloon"
68
+ "Stop alerts sending once the recipient makes a purchase","Stoppen met het verzenden van waarschuwingen wanneer de ontvanger een aankoop doet"
69
+ "Stop alerts sending once the recipient clicks a link in an email","Stoppen met het verzenden van waarschuwingen wanneer de ontvanger klikt op een link in een email"
70
+ "Include coupon in","Bevat een coupon in"
71
+ "Discount type","Kortings soort"
72
+ "Discount amount","Kortings bedrag"
73
+ "Expire coupon in (days)","Coupon laten verlopen in (dagen)"
74
+ "BCC Email","BCC Email"
75
+ "Percent of product price discount","Procent van het product prijs korting"
76
+ "Fixed amount discount","Vaste bedrag korting"
77
+ "Fixed amount discount for whole cart","Vaste bedrag korting voor hele winkelwagen"
78
+ " Email Template"," Email Sjabloon"
79
+ "Friend","Vriend"
80
+
app/locale/nl_NL/Emark_Mail.csv ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "From the %s selected subscribers there are %s synct to E-mark Mail. %s Subscribers where not active or Unsubscribed.","Van de %s geselecteerde abbonnees zijn er %s gesynct naar E-mark Mail. %s abbonnees zijn niet actief of uitgeschreven."
2
+ "The Api URl is not valid.","De Api URL is niet geldig"
3
+ "Can't login into Api, please check user and password.","Kan niet inloggen in de Api, kijk uw gebruikers naam en wachtwoord na."
4
+ "Api user is mandatory.","De Api gebruikers naam is verplicht."
5
+ "There went something wrong try again later.","Er is iets fout gegaan. Probeer het later opnieuw."
6
+ "This database doesn\'t exists.","Deze database bestaat niet."
7
+ "E-mark Mail Sync","Synchroniseer met Emark Mail"
8
+ "-- Magento fields --","-- Magento velden --"
9
+ "-- E-mark Mail fields --","-- E-mark Mail velden --"
10
+ "Magento Fields","Magento Velden"
11
+ "E-mark Mail Fields","E-mark Mail Velden"
12
+ "Add E-mark connect field","Voeg E-mark connect veld toe"
13
+ "Don't forget to connect the labels in Configuration->E-Mark Mail->Customer settings","Vergeet niet om de velden te koppelen tussen magento en Emark Mail in Systeem->Configuratie->Klanten instellingen"
14
+ "Successfully made 2 new selections name: 'Magento Guest - %s and 'Magento Registered User - %s'","Met success 2 nieuwe selecties aangemaakt genaamd: 'Magento Guest - %s en 'Magento Registered User - %s'"
15
+ "General settings","Algemene instellingen"
16
+ "Customer settings","Klanten instellingen"
17
+ "Password","Wachtwoord"
18
+ "Connect Fields:","Velden:"
19
+ "Fields","Velden"
20
+ "User","Gebruikersnaam"
app/locale/nl_NL/template/email/abandoned_cart_alert.html ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Hallo {{var customer_name}},</strong></p>
22
+ <p>Bedankt voor uw bezoek bij {{var website_name}} en dat u ons overweegt voor uw aankoop. We hebben gemerkt dat tijdens uw bezoek aan onze winkel u het volgende item(s) heeft geplaatst in uw winkelwagen, maar u hebt de transactie niet afgerond.</p>
23
+ <p>Inhoud van uw winkelwagen: </p>
24
+
25
+ <p>{{var products}}</p>
26
+ {{depend real_quote}}
27
+ <p><a href="{{var recover_url}}" >Inwisselen </a><br> (url:{{var recover_url}})</p>
28
+ {{/depend}}
29
+ {{depend coupon}}
30
+ <p>Voel je vrij om deze coupon te gebruiken: {{var coupon}}</p>
31
+ <p>Houd er rekening mee dat het vervalt in {{var coupon_days}} dag(en)</p>
32
+ {{/depend}}
33
+
34
+ <p>Wij zijn altijd geinteresseerd om te weten voor welke reden u hebt besloten op dit moment niet tot aankoop over te gaan. Wij zouden het erg op prij stellen als u zo vriendelijk zou zijn om ons te laten weten of u vragen heeft en of u problemen heeft ervaart. Wij vragen om feedback van u en anderen over hoe wij uw ervaring bij {{var website_name}} kunnen verbeteren.</p>
35
+
36
+ <p>LET OP:</p>
37
+ <p>Als u denkt dat u klaar bent met de aankoop en vraagt uw af waarom het werd niet afgeleverd, deze e-mail is een indicatie dat uw bestelling was NIET afgerond, en dat u bestelling NIET in rekening is gebracht! Alstublieft, keer terug naar de winkel om uw bestelling af te ronden.</p>
38
+
39
+ <p>Onze excuses, als u al klaar bent met de aankoop en deze bericht dus per ongeluk ontvangt.</p>
40
+
41
+ <p>Nogmaals, wij danken u voor uw tijd en aandacht om ons te helpen onze website te verbeteren.</p>
42
+
43
+ <p>Met vriendelijke groet, {{var store_name}} Team</p>
44
+
45
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
46
+ </td>
47
+ </tr>
48
+ </table>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </div>
app/locale/nl_NL/template/email/abandoned_cart_alert2.html ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert 2 from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Hallo {{var customer_name}},</strong></p>
22
+ <p>Bedankt voor uw bezoek bij {{var website_name}} en dat u ons overweegt voor uw aankoop. We hebben gemerkt dat tijdens uw bezoek aan onze winkel u het volgende item(s) heeft geplaatst in uw winkelwagen, maar u hebt de transactie niet afgerond.</p>
23
+ <p>Inhoud van uw winkelwagen: </p>
24
+
25
+ <p>{{var products}}</p>
26
+ {{depend real_quote}}
27
+ <p><a href="{{var recover_url}}" >Inwisselen </a><br> (url:{{var recover_url}})</p>
28
+ {{/depend}}
29
+
30
+ {{depend coupon}}
31
+ <p>Voel je vrij om deze coupon te gebruiken: {{var coupon}}</p>
32
+ <p>Houd er rekening mee dat het vervalt in {{var coupon_days}} dag(en)</p>
33
+ {{/depend}}
34
+ <p>Wij zijn altijd geinteresseerd om te weten voor welke reden u hebt besloten op dit moment niet tot aankoop over te gaan. Wij zouden het erg op prij stellen als u zo vriendelijk zou zijn om ons te laten weten of u vragen heeft en of u problemen heeft ervaart. Wij vragen om feedback van u en anderen over hoe wij uw ervaring bij {{var website_name}} kunnen verbeteren.</p>
35
+
36
+ <p>LET OP:</p>
37
+ <p>Als u denkt dat u klaar bent met de aankoop en vraagt uw af waarom het werd niet afgeleverd, deze e-mail is een indicatie dat uw bestelling was NIET afgerond, en dat u bestelling NIET in rekening is gebracht! Alstublieft, keer terug naar de winkel om uw bestelling af te ronden.</p>
38
+
39
+ <p>Onze excuses, als u al klaar bent met de aankoop en deze bericht dus per ongeluk ontvangt.</p>
40
+
41
+ <p>Nogmaals, wij danken u voor uw tijd en aandacht om ons te helpen onze website te verbeteren.</p>
42
+
43
+ <p>Met vriendelijke groet, {{var store_name}} Team</p>
44
+
45
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
46
+ </td>
47
+ </tr>
48
+ </table>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </div>
app/locale/nl_NL/template/email/abandoned_cart_alert3.html ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Abandoned cart alert 3 from {{var store_name}} @-->
2
+
3
+ <style type="text/css">
4
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
5
+ </style>
6
+
7
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
8
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
9
+ <tr>
10
+ <td align="center" valign="top">
11
+ <!-- [ header starts here] -->
12
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
13
+ <tr>
14
+ <td valign="top"><a href="{{var store_url}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
15
+ </tr>
16
+ </table>
17
+ <!-- [ middle starts here] -->
18
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
19
+ <tr>
20
+ <td valign="top">
21
+ <p><strong>Hallo {{var customer_name}},</strong></p>
22
+ <p>Bedankt voor uw bezoek bij {{var website_name}} en dat u ons overweegt voor uw aankoop. We hebben gemerkt dat tijdens uw bezoek aan onze winkel u het volgende item(s) heeft geplaatst in uw winkelwagen, maar u hebt de transactie niet afgerond.</p>
23
+ <p>Inhoud van uw winkelwagen: </p>
24
+
25
+ <p>{{var products}}</p>
26
+ {{depend real_quote}}
27
+ <p><a href="{{var recover_url}}" >Inwisselen </a><br> (url:{{var recover_url}})</p>
28
+ {{/depend}}
29
+
30
+ {{depend coupon}}
31
+ <p>Voel je vrij om deze coupon te gebruiken: {{var coupon}}</p>
32
+ <p>Houd er rekening mee dat het vervalt in {{var coupon_days}} dag(en)</p>
33
+ {{/depend}}
34
+
35
+ <p>Wij zijn altijd geinteresseerd om te weten voor welke reden u hebt besloten op dit moment niet tot aankoop over te gaan. Wij zouden het erg op prij stellen als u zo vriendelijk zou zijn om ons te laten weten of u vragen heeft en of u problemen heeft ervaart. Wij vragen om feedback van u en anderen over hoe wij uw ervaring bij {{var website_name}} kunnen verbeteren.</p>
36
+
37
+ <p>LET OP:</p>
38
+ <p>Als u denkt dat u klaar bent met de aankoop en vraagt uw af waarom het werd niet afgeleverd, deze e-mail is een indicatie dat uw bestelling was NIET afgerond, en dat u bestelling NIET in rekening is gebracht! Alstublieft, keer terug naar de winkel om uw bestelling af te ronden.</p>
39
+
40
+ <p>Onze excuses, als u al klaar bent met de aankoop en deze bericht dus per ongeluk ontvangt.</p>
41
+
42
+ <p>Nogmaals, wij danken u voor uw tijd en aandacht om ons te helpen onze website te verbeteren.</p>
43
+
44
+ <p>Met vriendelijke groet, {{var store_name}} Team</p>
45
+
46
+ <p><a href="{{var store_url}}">{{var store_name}}</a></p>
47
+ </td>
48
+ </tr>
49
+ </table>
50
+ </td>
51
+ </tr>
52
+ </table>
53
+ </div>
package.xml CHANGED
@@ -1,34 +1,28 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>e-mark_mail</name>
4
- <version>0.9.0</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>E-mark_Mail 0.9</summary>
10
- <description>E-mail marketing made easy&#xD;
11
- &#xD;
12
- Easily integrate with E-mark Mail in seconds to drive traffic and strengthen relationships with your clients.&#xD;
13
- &#xD;
14
- Implemented with no effort, your contacts are synched to your E-mark Mail account, and abandoned cart triggered emails are activated simply by selecting the right campaign to send.&#xD;
15
- &#xD;
16
- Transactional, Intelligent, Targeted email marketing has never been more powerfull! &#xD;
17
- &#xD;
18
- You can request your account at www.emailmarketing.nl</description>
19
- <notes>E-mail marketing made easy&#xD;
20
- &#xD;
21
- Easily integrate with E-mark Mail in seconds to drive traffic and strengthen relationships with your clients.&#xD;
22
- &#xD;
23
- Implemented with no effort, your contacts are synched to your E-mark Mail account, and abandoned cart triggered emails are activated simply by selecting the right campaign to send.&#xD;
24
- &#xD;
25
- Transactional, Intelligent, Targeted email marketing has never been more powerfull! &#xD;
26
- &#xD;
27
- You can request your account at www.emailmarketing.nl</notes>
28
- <authors><author><name>E-Mark</name><user>emarkmail</user><email>timd@e-mark.nl</email></author></authors>
29
- <date>2012-10-09</date>
30
- <time>14:36:33</time>
31
- <contents><target name="magelocal"><dir name="EM"><dir name="Mbbwebservice"><dir name="Helper"><file name="Config.php" hash="ad6f5103f80445a36e49f365c2524432"/><file name="Data.php" hash="25cdc46c1ec2450bf2c43cf689ed5ac7"/></dir><dir name="Model"><dir name="Email"><file name="Template.php" hash="790378827c23864eeabdd28d1d0b3c50"/></dir><file name="Mail.php" hash="4322bdc0866f950d00e97a25c128cb32"/><file name="Observer.php" hash="2edca6169c85f07d6a21e049c4bc7f44"/></dir><dir name="etc"><file name="config.xml" hash="59edeba98a798cc601ecfed013bc2abc"/><file name="system.xml" hash="d4a40cc1c38f0ed8e3ede9606cdd35bc"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="EM_Mbbwebservice.xml" hash="30269dc0ef3f75897095f417564b5942"/></dir></target></contents>
32
  <compatible/>
33
- <dependencies><required><php><min>4.0.0</min><max>5.4.6</max></php></required></dependencies>
34
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>e-mark_mail</name>
4
+ <version>1.3.0</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>This module adds Cart abondement, synchronize newsletter subscribers with E-mark Mail and replace the smtp with E-mark Transactional Mailer.</summary>
10
+ <description>Easily integrate with E-mark Mail in seconds to drive traffic &#xD;
11
+ to your website. Strengthen relationships with your clients and &#xD;
12
+ automatically synchronize newsletter subscribers with E-mark Mail.&#xD;
13
+ &#xD;
14
+ Your customer data will automatically be uploaded into your E-mark Mail &#xD;
15
+ account. Cart abandonment plugin can be used to send emails with a coupon or a discount. &#xD;
16
+ &#xD;
17
+ The transactional mails has a high deliverbility. Targeted email marketing &#xD;
18
+ has never been more powerfull with the E-mark Transactional Mailer. &#xD;
19
+ &#xD;
20
+ You can request your account at www.emailmarketing.nl </description>
21
+ <notes>First Release</notes>
22
+ <authors><author><name>E-mark</name><user>emarkmail</user><email>timd@e-mark.nl</email></author></authors>
23
+ <date>2012-12-03</date>
24
+ <time>13:20:24</time>
25
+ <contents><target name="magecommunity"><dir name="Emark"><dir name="Cartalert"><dir name="Block"><dir name="Adminhtml"><dir name="Cartalert"><dir name="Edit"><file name="Form.php" hash="b69dd8433ff448855e5951a5fb4c63f0"/></dir><file name="Edit.php" hash="2d88794b210f861c6df56a8c197ddcf5"/><file name="Grid.php" hash="4b6cbe2299522cb5ba3c9e9714614867"/></dir><file name="Cartalert.php" hash="cf634456a3a5f1b5254b5d88f4703709"/><dir name="History"><dir name="Edit"><file name="Form.php" hash="5e56569191b343846e2298dd1786da73"/></dir><file name="Edit.php" hash="370895774c0bf4dbce095b781f4acd1d"/><file name="Grid.php" hash="9c168f0cdb906beb28e6542d2cb799b7"/></dir><file name="History.php" hash="0c75017cc414f0c5c49416f75fbec56d"/></dir><dir name="Rewrite"><file name="FrontCheckoutOnepage.data.php" hash="a153e6031f8734cf3ea04ab9deff103d"/><file name="FrontCheckoutOnepage.php" hash="a153e6031f8734cf3ea04ab9deff103d"/></dir></dir><dir name="Helper"><file name="Data.php" hash="601850fae632b07d13241620ad2a42f2"/></dir><dir name="Model"><file name="Cartalert.php" hash="60049fe1d70d97730508414e80a1421b"/><file name="History.php" hash="c3688c79b71c802548655f319ab8aac1"/><dir name="Mysql4"><dir name="Cartalert"><file name="Collection.php" hash="bd291b240625df7dc38386f9e22b387c"/></dir><file name="Cartalert.php" hash="df7acd31249942cc407b900935a90fcc"/><dir name="History"><file name="Collection.php" hash="59bea874c5949b89996bfce882412331"/></dir><file name="History.php" hash="fe2b9724f1715beb7541fd8c7e02ed69"/></dir><file name="Observer.php" hash="c399895ee734e81dff265ff99c0000db"/><dir name="Source"><file name="Discount.php" hash="439f59a1fb3833c49a478ecdda6a74df"/><file name="Step.php" hash="9b2f53ffece8826da14732aba07a833b"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CartalertController.php" hash="261059828c53d9d0aa4ecb6a957f31c0"/><file name="HistoryController.php" hash="664c74ed84b6fa9b4b4ac010c26f216c"/></dir><file name="RecoverController.php" hash="bbfe69fd50b5dddd1656d589ef3d88cb"/></dir><dir name="etc"><file name="config.xml" hash="dea6caab227013fb74e905791db218a9"/><file name="system.xml" hash="00d3e4e746c46dc92dc68b78277065ab"/></dir><dir name="sql"><dir name="emark_cartalert_setup"><file name="mysql4-install-0.1.0.php" hash="076abaf46e259928e344b68f89fd7cdf"/></dir></dir></dir><dir name="Mail"><dir name="Block"><dir name="Admin"><dir name="Newsletter"><dir name="Subscriber"><file name="Grid.php" hash="c927e83f1013c86a62e4455e87a8ec5e"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Customerlabels.php" hash="c7bc6978e4c09f0150e8b0ec694c37c5"/><file name="Label.php" hash="7c28901d593bd017da90a1420137ab92"/><file name="Label2.php" hash="d8a1db311d9aa23c4657a67544dbcd6e"/><file name="Subscriberlabels.php" hash="4db6e0642f1c8a2e40eb47d62ad90b32"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Api.php" hash="dff6ac4431621137e1adc1d2e16c7b3f"/><file name="Connectfields.php" hash="fc75f59f6b164378f0308b61ef75c4f7"/><file name="Customer.php" hash="c2dff83b702d2578253643aed58fb3de"/><file name="Data.php" hash="49b9d8841bc369ea6b6e356206032ab4"/></dir><dir name="Model"><dir name="Admin"><file name="Apidatabase.php" hash="dd938f578e08f2bf96dbf62ac6de927d"/><file name="Apipassword.php" hash="c3bf0e14ab669a04d6c7a6c6793a0ecf"/><file name="Apiurl.php" hash="431cac1a1dcd8232811bab6eb73ba06a"/><file name="Apiuser.php" hash="f10c900e58c2737610a1a5af9ecbe6c4"/><file name="Connectfields.php" hash="3192e1a1b1ab41dc037afdfa93ea34d8"/></dir><dir name="Customer"><dir name="Register"><file name="Observer.php" hash="8e246a3d2ff3a532e42eac0a1bab9739"/></dir></dir><file name="Customer.php" hash="2db01dd15a2d009a851b2db3eba399a2"/><file name="Subscriber.php" hash="49456df72f89b3bcfbab2efa53701e20"/></dir><dir name="controllers"><dir name="Admin"><file name="CustomerController.php" hash="33b8db60597d102d30ff564cafc1777f"/><dir name="Newsletter"><file name="SubscriberController.php" hash="b8ac3b460d1068d336976e2884dc8090"/></dir><file name="SyncController.php" hash="5e2ba19bff2ba0640df29c08dbe136f7"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="8f26879667f5cdea243a37aab21f24fe"/><file name="config.xml" hash="bbd4b7eb28a1e715b14c74bb99c79cad"/><file name="system.xml" hash="3dc3d2b1bdbe3dc615866ba85c69ba8f"/></dir></dir><dir name="Mbbwebservice"><dir name="Helper"><file name="Config.php" hash="c130f58a84000c6e055696753f7e2718"/><file name="Data.php" hash="a70248af3f864e8106ab0c1ea73c09a8"/></dir><dir name="Model"><dir name="Email"><file name="Template.php" hash="823b3eccfda0f94cee9708166b71f70a"/></dir><file name="Mail.php" hash="9f14dff99a0ade7303c5a359481fc413"/><file name="Observer.php" hash="57505f99991a7032ab1899c2f3b26ce1"/></dir><dir name="etc"><file name="config.xml" hash="d1f631afc27c289208cc55f43ee706ea"/><file name="system.xml" hash="0d0ef3af3a7e0c7e1cf458aafb6c0f95"/></dir></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Emark_Cartalert.csv" hash="58f23624ec08e8a170cef868420050ed"/><file name="Emark_Mail.csv" hash="0787c7be450f0034bc81ba021d4df3ac"/><dir name="template"><dir name="email"><file name="abandoned_cart_alert2.html" hash="b5c00ecb929804e17e660275f87586ce"/><file name="abandoned_cart_alert3.html" hash="6ca59dff0ba7ee22729a087ca76e28db"/><file name="abandoned_cart_alert.html" hash="b40c73cff9cece20911902f4713e89f4"/></dir></dir></dir><dir name="es_ES"><file name="Emark_Cartalert.csv" hash="b7d2664a1100183fe188ec0d460bcc76"/><dir name="template"><dir name="email"><file name="abandoned_cart_alert2.html" hash="5d8dc2ea3c28ca1b02300891159b11e0"/><file name="abandoned_cart_alert3.html" hash="9c86886ec274cbdc80dc2cfa020cb03a"/><file name="abandoned_cart_alert.html" hash="b63c7c3c28c6ee8f09c618596cb7145e"/></dir></dir></dir><dir name="fr_FR"><file name="Emark_Cartalert.csv" hash="885b6f63c760eee9dd2d489ea51781a7"/><dir name="template"><dir name="email"><file name="abandoned_cart_alert2.html" hash="a408951e0abe07b53fa92e8228b41636"/><file name="abandoned_cart_alert3.html" hash="e6e2f076772571403dd1541daf8905b2"/><file name="abandoned_cart_alert.html" hash="40170b44284f0eb5ed155c73a86ad2ed"/></dir></dir></dir><dir name="it_IT"><file name="Emark_Cartalert.csv" hash="c92de07536dbafc4fbc88030637f3631"/><dir name="template"><dir name="email"><file name="abandoned_cart_alert2.html" hash="1ef3009836471eedf8ea4338390841fd"/><file name="abandoned_cart_alert3.html" hash="58aa01b767f71a3352bba7c592e8982c"/><file name="abandoned_cart_alert.html" hash="e63c2fee00bc96b2560adca329f2b366"/></dir></dir></dir><dir name="nl_NL"><file name="Emark_Cartalert.csv" hash="eca6ecf5212ed58f410e909f2f2afc51"/><file name="Emark_Mail.csv" hash="5570ae7e7c003c8aabda339ea853c572"/><dir name="template"><dir name="email"><file name="abandoned_cart_alert2.html" hash="1b59f630baf74285bd58c1c32448de02"/><file name="abandoned_cart_alert3.html" hash="9b6a45ff22b1b8d5cc0e00ff1006c052"/><file name="abandoned_cart_alert.html" hash="1b2f55cf99e76bf11af91c4d799c723e"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Emark_Cartalert.xml" hash="ad5a2c97779c4baf9a050d8407aaa7b3"/><file name="Emark_Mail.xml" hash="0a573fc546b8ae474b8af5dfcf485a36"/><file name="Emark_Mbbwebservice.xml" hash="c49b2224b1346682f828b561271f8f8f"/></dir></target></contents>
 
 
 
 
 
 
26
  <compatible/>
27
+ <dependencies><required><php><min>5.3.11</min><max>5.4.8</max></php></required></dependencies>
28
  </package>