INinbox_Emailmarketing - Version 2.0.0

Version Notes

1) Update: Contacts can be added to Multiple Lists, for a particular event.
2) New: Order Contacts can be sent to INinbox at multiple states.
3) New: Customers who Abandon's their Cart, can also be added to INinbox list

Download this release

Release Info

Developer INinbox.com
Extension INinbox_Emailmarketing
Version 2.0.0
Comparing to
See all releases


Code changes from version 1.2.2 to 2.0.0

app/code/local/Ininbox/Emailmarketing/Block/Adminhtml/AbandonedCarts.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ininbox_Emailmarketing_Block_Adminhtml_AbandonedCarts extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ parent::__construct();
7
+ $this->_controller = 'adminhtml_abandonedCarts';
8
+ $this->_blockGroup = 'emailmarketing';
9
+ $this->_headerText = 'Abandoned Carts';
10
+ $this->_removeButton('add');
11
+ }
12
+ }
13
+ ?>
app/code/local/Ininbox/Emailmarketing/Block/Adminhtml/AbandonedCarts/Grid.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Post Grid Container
4
+ *
5
+ * @package - Medma
6
+ * @author - Medma Development Team
7
+ */
8
+ class Ininbox_Emailmarketing_Block_Adminhtml_AbandonedCarts_Grid extends Mage_Adminhtml_Block_Widget_Grid
9
+ {
10
+ public function __construct()
11
+ {
12
+ parent::__construct();
13
+ $this->setId('abandonedCartsGrid');
14
+ $this->setDefaultSort('entity_id');
15
+ $this->setDefaultDir('DESC');
16
+ $this->setSaveParametersInSession(true);
17
+ }
18
+
19
+ protected function _prepareMassaction()
20
+ {
21
+ $this->setMassactionIdField('entity_id');
22
+ $this->getMassactionBlock()->setFormFieldName('quote_ids');
23
+
24
+ $isIninboxAbandonedCartsEnabled = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_settings', $field = 'add_to_list_enabled');
25
+ $ininboxAbandonedCartsList = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_settings', $field = 'abandoned_list');
26
+
27
+ if($isIninboxAbandonedCartsEnabled && !is_null($ininboxAbandonedCartsList))
28
+ {
29
+ $this->getMassactionBlock()->addItem(
30
+ 'emailmarketing',
31
+ array('label' => $this->__('Add to INinbox List'),
32
+ 'url' => $this->getUrl('emailmarketing/adminhtml_massaction/abandonedCarts')
33
+ )
34
+ );
35
+ }
36
+ }
37
+
38
+ protected function _prepareCollection()
39
+ {
40
+ $collection = Mage::getResourceModel('sales/quote_collection')
41
+ ->addFieldToFilter('reserved_order_id', array('null' => true))
42
+ ->addFieldToFilter('customer_email', array('neq' => null));
43
+ $this->setCollection($collection);
44
+ return parent::_prepareCollection();
45
+ }
46
+
47
+ protected function _prepareColumns()
48
+ {
49
+ $this->addColumn('entity_id',
50
+ array(
51
+ 'header' => Mage::helper('adminhtml')->__('ID'),
52
+ 'align' =>'right',
53
+ 'width' => '50px',
54
+ 'index' => 'entity_id',
55
+ ));
56
+ $this->addColumn('customer_firstname',
57
+ array(
58
+ 'header' => Mage::helper('adminhtml')->__('Customer First Name'),
59
+ 'align' =>'left',
60
+ 'index' => 'customer_firstname',
61
+ ));
62
+ $this->addColumn('customer_lastname',
63
+ array(
64
+ 'header' => Mage::helper('adminhtml')->__('Customer Last Name'),
65
+ 'align' =>'left',
66
+ 'index' => 'customer_lastname',
67
+ ));
68
+ $this->addColumn('customer_email',
69
+ array(
70
+ 'header' => Mage::helper('adminhtml')->__('Customer Email'),
71
+ 'align' => 'left',
72
+ 'index' => 'customer_email',
73
+ ));
74
+ $this->addColumn('created_at', array(
75
+ 'header' =>Mage::helper('adminhtml')->__('Created At'),
76
+ 'width' =>'170px',
77
+ 'type' =>'datetime',
78
+ 'index' =>'created_at',
79
+ 'sortable' =>false
80
+ ));
81
+ $this->addColumn('updated_at', array(
82
+ 'header' =>Mage::helper('adminhtml')->__('Updated At'),
83
+ 'width' =>'170px',
84
+ 'type' =>'datetime',
85
+ 'index' =>'updated_at',
86
+ 'sortable' =>false
87
+ ));
88
+
89
+ $this->addColumn('remote_ip', array(
90
+ 'header' =>Mage::helper('adminhtml')->__('IP Address'),
91
+ 'width' =>'80px',
92
+ 'index' =>'remote_ip',
93
+ 'sortable' =>false
94
+ ));
95
+
96
+ $this->addColumn('checkout_method',
97
+ array(
98
+ 'header' => Mage::helper('adminhtml')->__('Checkout Method'),
99
+ 'align' =>'left',
100
+ 'index' => 'checkout_method',
101
+ 'width' => '90px',
102
+ ));
103
+
104
+ $this->addColumn('ininbox_is_abandoned',
105
+ array(
106
+ 'header' => Mage::helper('adminhtml')->__('INinbox Abandoned Carts?'),
107
+ 'align' =>'center',
108
+ 'index' => 'ininbox_is_abandoned',
109
+ 'width' => '90px',
110
+ 'type' => 'options',
111
+ 'options' => array(
112
+ 1 => 'Yes',
113
+ 0 => 'No',
114
+ ),
115
+ ));
116
+
117
+ $this->addExportType('*/*/exportAbandonedCsv', Mage::helper('reports')->__('CSV'));
118
+ $this->addExportType('*/*/exportAbandonedExcel', Mage::helper('reports')->__('Excel XML'));
119
+
120
+ return parent::_prepareColumns();
121
+ }
122
+ }
123
+ ?>
app/code/local/Ininbox/Emailmarketing/Model/Ininbox/Customfield.php CHANGED
@@ -25,9 +25,9 @@ class Ininbox_Emailmarketing_Model_Ininbox_Customfield extends Mage_Core_Model_A
25
  *
26
  * @return list of custom fields in json format
27
  */
28
- public function getPredefinedList()
29
  {
30
- return Mage::getModel('emailmarketing/ininbox_base')->makeCall('customfields/predefined', 'PageSize=500');
31
  }
32
  }
33
  ?>
25
  *
26
  * @return list of custom fields in json format
27
  */
28
+ public function getSystemDefinedList()
29
  {
30
+ return Mage::getModel('emailmarketing/ininbox_base')->makeCall('customfields/systemdefined', 'PageSize=500');
31
  }
32
  }
33
  ?>
app/code/local/Ininbox/Emailmarketing/Model/Observer.php CHANGED
@@ -19,7 +19,7 @@ class Ininbox_Emailmarketing_Model_Observer
19
  if(Mage::helper('emailmarketing')->isEnabled())
20
  {
21
  $isIninboxSendCustomerEnabled = Mage::helper('emailmarketing')->getConfig($group = 'customer_settings', $field = 'send_customer');
22
- $ininboxCustomerGroupList = Mage::helper('emailmarketing')->getConfig($group = 'customer_settings', $field = 'customer_group_list');
23
 
24
  $ininboxResubscriber = Mage::helper('emailmarketing')->getConfig($group = 'customer_misc_settings', $field = 'update_subscriber') ? true : false;
25
  $ininboxSendConfirmationEmail = Mage::helper('emailmarketing')->getConfig($group = 'customer_misc_settings', $field = 'confirm_email') ? true : false;
@@ -101,12 +101,55 @@ class Ininbox_Emailmarketing_Model_Observer
101
  }
102
  }
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  /**
105
  * event listener on sales order place when customer place new order.
106
  *
107
  * @Params
108
  * $observer - contains order details
109
  */
 
110
  public function salesOrderPlaceAfterObserver(Varien_Event_Observer $observer)
111
  {
112
  if(Mage::helper('emailmarketing')->isEnabled())
@@ -141,7 +184,7 @@ class Ininbox_Emailmarketing_Model_Observer
141
 
142
  if($isIninboxSendCustomerEnabled && !is_null($ininboxCustomerGroupList))
143
  {
144
- /*$currentCustomer = Mage::getModel('customer/customer')->load($observer->getEvent()->getOrder()->getCustomerId());*/
145
  $currentCustomer = $observer->getEvent()->getOrder()->getBillingAddress();
146
  //die($observer->getEvent()->getOrder()->custome());
147
  //die(json_encode($currentCustomer));
@@ -150,6 +193,7 @@ class Ininbox_Emailmarketing_Model_Observer
150
  }
151
  }
152
  }
 
153
 
154
  /**
155
  * event listener on customer account edit.
@@ -223,19 +267,30 @@ class Ininbox_Emailmarketing_Model_Observer
223
  {
224
  $customerAttribute = $mappedField['customer_attributes'];
225
  $ininboxCustomField = $mappedField['ininbox_custom_fields'];
 
 
 
226
  if(array_key_exists($ininboxCustomField, $ininboxPredefinedCustomFields))
227
- $params['params'][$ininboxCustomField] = $currentCustomer->getData($customerAttribute);
228
  else
229
- $params['params']['CustomFields'][] = array('Key' => $ininboxCustomField, 'Value' => $currentCustomer->getData($customerAttribute));
230
  }
231
 
232
  $params['params']['Resubscribe'] = $ininboxResubscriber;
233
  $params['params']['SendConfirmationEmail'] = $ininboxSendConfirmationEmail;
234
  $params['params']['AddContactToAutoresponderCycle'] = $ininboxAddContactToAutoresponderCycle;
235
- $params['params']['ListIDs'] = array(intval($ininboxGroupList));
236
-
237
  $result = Mage::getModel('emailmarketing/ininbox_contact')->add($params);
238
-
 
 
 
 
 
 
 
 
239
  if(isset($result['Code']) && isset($result['Message']))
240
  {
241
  $error_message = Mage::helper('adminhtml')->__('ERROR (' . $result['Code'] . '): ' . $result['Message']);
@@ -290,38 +345,34 @@ class Ininbox_Emailmarketing_Model_Observer
290
  $customerAttribute = $mappedField['customer_attributes'];
291
  $ininboxCustomField = $mappedField['ininbox_custom_fields'];
292
  if($customerAttribute == 'default_billing' || $customerAttribute == 'default_shipping')
293
- {
294
- if($ininboxCustomField == 'Address')
295
- {
296
- $params['params']['Address'] = $currentCustomer->getStreet1() . ' ' . $currentCustomer->getStreet2();
297
- $params['params']['CountryCode'] = $currentCustomer->getCountryId();
298
- $params['params']['City'] = $currentCustomer->getCity();
299
- $params['params']['Zip'] = $currentCustomer->getPostcode();
300
- $params['params']['MobilePhone'] = $currentCustomer->getTelephone();
301
- $params['params']['Fax'] = $currentCustomer->getFax();
302
- }
303
  else
304
- {
305
- if(array_key_exists($ininboxCustomField, $ininboxPredefinedCustomFields))
306
- $params['params'][$ininboxCustomField] = $currentCustomer->getStreet1() . ' ' . $currentCustomer->getStreet2();
307
- else
308
- $params['params']['CustomFields'][] = array('Key' => $ininboxCustomField, 'Value' => ($currentCustomer->getStreet1() . ' ' . $currentCustomer->getStreet2()));
309
- }
 
310
  }
311
  else
312
  {
 
 
313
  if(array_key_exists($ininboxCustomField, $ininboxPredefinedCustomFields))
314
- $params['params'][$ininboxCustomField] = $currentCustomer->getData($customerAttribute);
315
  else
316
- $params['params']['CustomFields'][] = array('Key' => $ininboxCustomField, 'Value' => $currentCustomer->getData($customerAttribute));
317
  }
318
  }
319
 
320
  $params['params']['Resubscribe'] = $ininboxResubscriber;
321
  $params['params']['SendConfirmationEmail'] = $ininboxSendConfirmationEmail;
322
  $params['params']['AddContactToAutoresponderCycle'] = $ininboxAddContactToAutoresponderCycle;
323
- $params['params']['ListIDs'] = array(intval($ininboxGroupList));
324
-
325
  $result = Mage::getModel('emailmarketing/ininbox_contact')->add($params);
326
 
327
  if(isset($result['Code']) && isset($result['Message']))
@@ -362,7 +413,8 @@ class Ininbox_Emailmarketing_Model_Observer
362
  $params['params']['Resubscribe'] = $ininboxResubscriber;
363
  $params['params']['SendConfirmationEmail'] = $ininboxSendConfirmationEmail;
364
  $params['params']['AddContactToAutoresponderCycle'] = $ininboxAddContactToAutoresponderCycle;
365
- $params['params']['ListIDs'] = array(intval($ininboxGroupList));
 
366
  $result = Mage::getModel('emailmarketing/ininbox_contact')->add($params);
367
 
368
  if(isset($result['Code']) && isset($result['Message']))
@@ -411,10 +463,13 @@ class Ininbox_Emailmarketing_Model_Observer
411
  {
412
  $customerAttribute = $mappedField['customer_attributes'];
413
  $ininboxCustomField = $mappedField['ininbox_custom_fields'];
 
 
 
414
  if(array_key_exists($ininboxCustomField, $ininboxPredefinedCustomFields))
415
- $array[$ininboxCustomField] = $currentCustomer->getData($customerAttribute);
416
  else
417
- $array['CustomFields'][] = array('Key' => $ininboxCustomField, 'Value' => $currentCustomer->getData($customerAttribute));
418
  }
419
 
420
  $params['params']['Contacts'][$count++] = $array;
@@ -422,7 +477,7 @@ class Ininbox_Emailmarketing_Model_Observer
422
  $params['params']['Resubscribe'] = $ininboxResubscriber;
423
  $params['params']['SendConfirmationEmail'] = $ininboxSendConfirmationEmail;
424
  $params['params']['AddContactToAutoresponderCycle'] = $ininboxAddContactToAutoresponderCycle;
425
- $params['params']['ListIDs'] = array(intval($ininboxGroupList));
426
 
427
  $result = Mage::getModel('emailmarketing/ininbox_contact')->import($params);
428
 
@@ -469,7 +524,7 @@ class Ininbox_Emailmarketing_Model_Observer
469
  $params['params']['Resubscribe'] = $ininboxResubscriber;
470
  $params['params']['SendConfirmationEmail'] = $ininboxSendConfirmationEmail;
471
  $params['params']['AddContactToAutoresponderCycle'] = $ininboxAddContactToAutoresponderCycle;
472
- $params['params']['ListIDs'] = array(intval($ininboxGroupList));
473
 
474
  $result = Mage::getModel('emailmarketing/ininbox_contact')->import($params);
475
 
@@ -532,29 +587,25 @@ class Ininbox_Emailmarketing_Model_Observer
532
  $ininboxCustomField = $mappedField['ininbox_custom_fields'];
533
  if($customerAttribute == 'default_billing' || $customerAttribute == 'default_shipping')
534
  {
535
- if($ininboxCustomField == 'Address')
536
- {
537
- $array['Address'] = $currentCustomer->getStreet1() . ' ' . $currentCustomer->getStreet2();
538
- $array['CountryCode'] = $currentCustomer->getCountryId();
539
- $array['City'] = $currentCustomer->getCity();
540
- $array['Zip'] = $currentCustomer->getPostcode();
541
- $array['MobilePhone'] = $currentCustomer->getTelephone();
542
- $array['Fax'] = $currentCustomer->getFax();
543
- }
544
  else
545
- {
546
- if(array_key_exists($ininboxCustomField, $ininboxPredefinedCustomFields))
547
- $array[$ininboxCustomField] = $currentCustomer->getStreet1() . ' ' . $currentCustomer->getStreet2();
548
- else
549
- $array['CustomFields'][] = array('Key' => $ininboxCustomField, 'Value' => ($currentCustomer->getStreet1() . ' ' . $currentCustomer->getStreet2()));
550
- }
 
551
  }
552
  else
553
  {
 
 
554
  if(array_key_exists($ininboxCustomField, $ininboxPredefinedCustomFields))
555
- $array[$ininboxCustomField] = $currentCustomer->getData($customerAttribute);
556
  else
557
- $array['CustomFields'][] = array('Key' => $ininboxCustomField, 'Value' => $currentCustomer->getData($customerAttribute));
558
  }
559
  }
560
 
@@ -564,7 +615,7 @@ class Ininbox_Emailmarketing_Model_Observer
564
  $params['params']['Resubscribe'] = $ininboxResubscriber;
565
  $params['params']['SendConfirmationEmail'] = $ininboxSendConfirmationEmail;
566
  $params['params']['AddContactToAutoresponderCycle'] = $ininboxAddContactToAutoresponderCycle;
567
- $params['params']['ListIDs'] = array(intval($ininboxGroupList));
568
 
569
  $result = Mage::getModel('emailmarketing/ininbox_contact')->import($params);
570
 
@@ -581,6 +632,146 @@ class Ininbox_Emailmarketing_Model_Observer
581
 
582
  return $error_message;
583
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
584
 
585
  public function validateIninboxConfig()
586
  {
19
  if(Mage::helper('emailmarketing')->isEnabled())
20
  {
21
  $isIninboxSendCustomerEnabled = Mage::helper('emailmarketing')->getConfig($group = 'customer_settings', $field = 'send_customer');
22
+ $ininboxCustomerGroupList = Mage::helper('emailmarketing')->getConfig($group = 'customer_settings', $field = 'customer_group_list');
23
 
24
  $ininboxResubscriber = Mage::helper('emailmarketing')->getConfig($group = 'customer_misc_settings', $field = 'update_subscriber') ? true : false;
25
  $ininboxSendConfirmationEmail = Mage::helper('emailmarketing')->getConfig($group = 'customer_misc_settings', $field = 'confirm_email') ? true : false;
101
  }
102
  }
103
 
104
+ public function salesOrderStatusAfterObserver(Varien_Event_Observer $observer)
105
+ {
106
+ if(Mage::helper('emailmarketing')->isEnabled())
107
+ {
108
+ $isIninboxSendOrderEnabled = Mage::helper('emailmarketing')->getConfig($group = 'order_settings', $field = 'send_order');
109
+ $ininboxOrderGroupList = Mage::helper('emailmarketing')->getConfig($group = 'order_settings', $field = 'order_group_list');
110
+ $ininboxOrderStatusList = Mage::helper('emailmarketing')->getConfig($group = 'order_settings', $field = 'order_status_list');
111
+
112
+ $ininboxResubscriber = Mage::helper('emailmarketing')->getConfig($group = 'order_misc_settings', $field = 'update_subscriber') ? true : false;
113
+ $ininboxSendConfirmationEmail = Mage::helper('emailmarketing')->getConfig($group = 'order_misc_settings', $field = 'confirm_email') ? true : false;
114
+ $ininboxAddContactToAutoresponderCycle = Mage::helper('emailmarketing')->getConfig($group = 'order_misc_settings', $field = 'send_autoresponder') ? true : false;
115
+
116
+ if ($isIninboxSendOrderEnabled && !is_null($ininboxOrderGroupList) && in_array($observer->getEvent()->getStatus(), explode(',', $ininboxOrderStatusList)))
117
+ {
118
+ $this->createIninboxContactForSales($observer->getEvent()->getOrder(), $ininboxOrderGroupList, $ininboxResubscriber, $ininboxSendConfirmationEmail, $ininboxAddContactToAutoresponderCycle);
119
+ }
120
+ }
121
+
122
+ $quote_id = $observer->getEvent()->getOrder()->getQuoteId();
123
+ $quote = Mage::getModel('sales/quote')->load($quote_id);
124
+ $method = $quote->getCheckoutMethod(true);
125
+
126
+ if($method == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER)
127
+ {
128
+ if(Mage::helper('emailmarketing')->isEnabled())
129
+ {
130
+ $isIninboxSendCustomerEnabled = Mage::helper('emailmarketing')->getConfig($group = 'customer_settings', $field = 'send_customer');
131
+ $ininboxCustomerGroupList = Mage::helper('emailmarketing')->getConfig($group = 'customer_settings', $field = 'customer_group_list');
132
+
133
+ $ininboxResubscriber = Mage::helper('emailmarketing')->getConfig($group = 'customer_misc_settings', $field = 'update_subscriber') ? true : false;
134
+ $ininboxSendConfirmationEmail = Mage::helper('emailmarketing')->getConfig($group = 'customer_misc_settings', $field = 'confirm_email') ? true : false;
135
+ $ininboxAddContactToAutoresponderCycle = Mage::helper('emailmarketing')->getConfig($group = 'customer_misc_settings', $field = 'send_autoresponder') ? true : false;
136
+
137
+ if($isIninboxSendCustomerEnabled && !is_null($ininboxCustomerGroupList))
138
+ {
139
+ $currentCustomer = $observer->getEvent()->getOrder()->getBillingAddress();
140
+ $this->createIninboxContact($currentCustomer, $ininboxCustomerGroupList, $ininboxResubscriber, $ininboxSendConfirmationEmail, $ininboxAddContactToAutoresponderCycle);
141
+ }
142
+ }
143
+ }
144
+ }
145
+
146
  /**
147
  * event listener on sales order place when customer place new order.
148
  *
149
  * @Params
150
  * $observer - contains order details
151
  */
152
+ /*
153
  public function salesOrderPlaceAfterObserver(Varien_Event_Observer $observer)
154
  {
155
  if(Mage::helper('emailmarketing')->isEnabled())
184
 
185
  if($isIninboxSendCustomerEnabled && !is_null($ininboxCustomerGroupList))
186
  {
187
+ // $currentCustomer = Mage::getModel('customer/customer')->load($observer->getEvent()->getOrder()->getCustomerId());
188
  $currentCustomer = $observer->getEvent()->getOrder()->getBillingAddress();
189
  //die($observer->getEvent()->getOrder()->custome());
190
  //die(json_encode($currentCustomer));
193
  }
194
  }
195
  }
196
+ */
197
 
198
  /**
199
  * event listener on customer account edit.
267
  {
268
  $customerAttribute = $mappedField['customer_attributes'];
269
  $ininboxCustomField = $mappedField['ininbox_custom_fields'];
270
+
271
+ $customerAttributeValue = $currentCustomer->getData($customerAttribute);
272
+ $customerAttributeValue = is_null($customerAttributeValue) ? '': $customerAttributeValue;
273
  if(array_key_exists($ininboxCustomField, $ininboxPredefinedCustomFields))
274
+ $params['params'][$ininboxCustomField] = $customerAttributeValue;
275
  else
276
+ $params['params']['CustomFields'][] = array('Key' => $ininboxCustomField, 'Value' => $customerAttributeValue);
277
  }
278
 
279
  $params['params']['Resubscribe'] = $ininboxResubscriber;
280
  $params['params']['SendConfirmationEmail'] = $ininboxSendConfirmationEmail;
281
  $params['params']['AddContactToAutoresponderCycle'] = $ininboxAddContactToAutoresponderCycle;
282
+ $params['params']['ListIDs'] = array_map('intval', explode(',', $ininboxGroupList));
283
+
284
  $result = Mage::getModel('emailmarketing/ininbox_contact')->add($params);
285
+
286
+ /*
287
+ echo '<pre>';
288
+ echo json_encode($params);
289
+ echo json_encode($result);
290
+ echo '</pre>';
291
+ die('DIED');
292
+ */
293
+
294
  if(isset($result['Code']) && isset($result['Message']))
295
  {
296
  $error_message = Mage::helper('adminhtml')->__('ERROR (' . $result['Code'] . '): ' . $result['Message']);
345
  $customerAttribute = $mappedField['customer_attributes'];
346
  $ininboxCustomField = $mappedField['ininbox_custom_fields'];
347
  if($customerAttribute == 'default_billing' || $customerAttribute == 'default_shipping')
348
+ {
349
+ if(array_key_exists($ininboxCustomField, $ininboxPredefinedCustomFields))
350
+ $params['params'][$ininboxCustomField] = $currentCustomer->getStreet1() . ' ' . $currentCustomer->getStreet2();
 
 
 
 
 
 
 
351
  else
352
+ $params['params']['CustomFields'][] = array('Key' => $ininboxCustomField, 'Value' => ($currentCustomer->getStreet1() . ' ' . $currentCustomer->getStreet2()));
353
+
354
+ $params['params']['CountryCode'] = $currentCustomer->getCountryId();
355
+ $params['params']['City'] = $currentCustomer->getCity();
356
+ $params['params']['Zip'] = $currentCustomer->getPostcode();
357
+ $params['params']['MobilePhone'] = $currentCustomer->getTelephone();
358
+ $params['params']['Fax'] = $currentCustomer->getFax();
359
  }
360
  else
361
  {
362
+ $customerAttributeValue = $currentCustomer->getData($customerAttribute);
363
+ $customerAttributeValue = is_null($customerAttributeValue) ? '': $customerAttributeValue;
364
  if(array_key_exists($ininboxCustomField, $ininboxPredefinedCustomFields))
365
+ $params['params'][$ininboxCustomField] = $customerAttributeValue;
366
  else
367
+ $params['params']['CustomFields'][] = array('Key' => $ininboxCustomField, 'Value' => $customerAttributeValue);
368
  }
369
  }
370
 
371
  $params['params']['Resubscribe'] = $ininboxResubscriber;
372
  $params['params']['SendConfirmationEmail'] = $ininboxSendConfirmationEmail;
373
  $params['params']['AddContactToAutoresponderCycle'] = $ininboxAddContactToAutoresponderCycle;
374
+ $params['params']['ListIDs'] = array_map('intval', explode(',', $ininboxGroupList));
375
+
376
  $result = Mage::getModel('emailmarketing/ininbox_contact')->add($params);
377
 
378
  if(isset($result['Code']) && isset($result['Message']))
413
  $params['params']['Resubscribe'] = $ininboxResubscriber;
414
  $params['params']['SendConfirmationEmail'] = $ininboxSendConfirmationEmail;
415
  $params['params']['AddContactToAutoresponderCycle'] = $ininboxAddContactToAutoresponderCycle;
416
+ $params['params']['ListIDs'] = array_map('intval', explode(',', $ininboxGroupList));
417
+
418
  $result = Mage::getModel('emailmarketing/ininbox_contact')->add($params);
419
 
420
  if(isset($result['Code']) && isset($result['Message']))
463
  {
464
  $customerAttribute = $mappedField['customer_attributes'];
465
  $ininboxCustomField = $mappedField['ininbox_custom_fields'];
466
+
467
+ $customerAttributeValue = $currentCustomer->getData($customerAttribute);
468
+ $customerAttributeValue = is_null($customerAttributeValue) ? '': $customerAttributeValue;
469
  if(array_key_exists($ininboxCustomField, $ininboxPredefinedCustomFields))
470
+ $params['params'][$ininboxCustomField] = $customerAttributeValue;
471
  else
472
+ $params['params']['CustomFields'][] = array('Key' => $ininboxCustomField, 'Value' => $customerAttributeValue);
473
  }
474
 
475
  $params['params']['Contacts'][$count++] = $array;
477
  $params['params']['Resubscribe'] = $ininboxResubscriber;
478
  $params['params']['SendConfirmationEmail'] = $ininboxSendConfirmationEmail;
479
  $params['params']['AddContactToAutoresponderCycle'] = $ininboxAddContactToAutoresponderCycle;
480
+ $params['params']['ListIDs'] = array_map('intval', explode(',', $ininboxGroupList));
481
 
482
  $result = Mage::getModel('emailmarketing/ininbox_contact')->import($params);
483
 
524
  $params['params']['Resubscribe'] = $ininboxResubscriber;
525
  $params['params']['SendConfirmationEmail'] = $ininboxSendConfirmationEmail;
526
  $params['params']['AddContactToAutoresponderCycle'] = $ininboxAddContactToAutoresponderCycle;
527
+ $params['params']['ListIDs'] = array_map('intval', explode(',', $ininboxGroupList));
528
 
529
  $result = Mage::getModel('emailmarketing/ininbox_contact')->import($params);
530
 
587
  $ininboxCustomField = $mappedField['ininbox_custom_fields'];
588
  if($customerAttribute == 'default_billing' || $customerAttribute == 'default_shipping')
589
  {
590
+ if(array_key_exists($ininboxCustomField, $ininboxPredefinedCustomFields))
591
+ $array[$ininboxCustomField] = $currentCustomer->getStreet1() . ' ' . $currentCustomer->getStreet2();
 
 
 
 
 
 
 
592
  else
593
+ $array['CustomFields'][] = array('Key' => $ininboxCustomField, 'Value' => ($currentCustomer->getStreet1() . ' ' . $currentCustomer->getStreet2()));
594
+
595
+ $array['CountryCode'] = $currentCustomer->getCountryId();
596
+ $array['City'] = $currentCustomer->getCity();
597
+ $array['Zip'] = $currentCustomer->getPostcode();
598
+ $array['MobilePhone'] = $currentCustomer->getTelephone();
599
+ $array['Fax'] = $currentCustomer->getFax();
600
  }
601
  else
602
  {
603
+ $customerAttributeValue = $currentCustomer->getData($customerAttribute);
604
+ $customerAttributeValue = is_null($customerAttributeValue) ? '': $customerAttributeValue;
605
  if(array_key_exists($ininboxCustomField, $ininboxPredefinedCustomFields))
606
+ $params['params'][$ininboxCustomField] = $customerAttributeValue;
607
  else
608
+ $params['params']['CustomFields'][] = array('Key' => $ininboxCustomField, 'Value' => $customerAttributeValue);
609
  }
610
  }
611
 
615
  $params['params']['Resubscribe'] = $ininboxResubscriber;
616
  $params['params']['SendConfirmationEmail'] = $ininboxSendConfirmationEmail;
617
  $params['params']['AddContactToAutoresponderCycle'] = $ininboxAddContactToAutoresponderCycle;
618
+ $params['params']['ListIDs'] = array_map('intval', explode(',', $ininboxGroupList));
619
 
620
  $result = Mage::getModel('emailmarketing/ininbox_contact')->import($params);
621
 
632
 
633
  return $error_message;
634
  }
635
+
636
+ public function importIninboxContactForAbandonedCarts($quoteIds, $ininboxGroupList)
637
+ {
638
+ try
639
+ {
640
+ $ininboxPredefinedCustomFields = Mage::getModel('emailmarketing/system_config_source_field_list')->getPredefinedCustomList();
641
+ $ininboxMappedCustomFields = unserialize(Mage::helper('emailmarketing')->getConfig($group = 'field_mapping', $field = 'field'));
642
+
643
+ $ininboxResubscriber = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_massaction_settings', $field = 'update_subscriber') ? true : false;
644
+ $ininboxSendConfirmationEmail = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_massaction_settings', $field = 'confirm_email') ? true : false;
645
+ $ininboxAddContactToAutoresponderCycle = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_massaction_settings', $field = 'send_autoresponder') ? true : false;
646
+
647
+ $count = 0;
648
+ foreach ($quoteIds as $quoteId)
649
+ {
650
+ $currentOuote = Mage::getResourceModel('sales/quote_collection')->addFieldToFilter('entity_id', $quoteId)->getFirstItem();
651
+ $currentOuote->setData('ininbox_is_abandoned', 1);
652
+ $currentOuote->save();
653
+
654
+ $array = array();
655
+ foreach($ininboxMappedCustomFields as $mappedField)
656
+ {
657
+ $customerAttribute = 'customer_' . $mappedField['customer_attributes'];
658
+ $ininboxCustomField = $mappedField['ininbox_custom_fields'];
659
+
660
+ $customerAttributeValue = $currentOuote->getData($customerAttribute);
661
+ $customerAttributeValue = is_null($customerAttributeValue) ? '': $customerAttributeValue;
662
+ if(array_key_exists($ininboxCustomField, $ininboxPredefinedCustomFields))
663
+ $params['params'][$ininboxCustomField] = $customerAttributeValue;
664
+ else
665
+ $params['params']['CustomFields'][] = array('Key' => $ininboxCustomField, 'Value' => $customerAttributeValue);
666
+ }
667
+
668
+ $params['params']['Contacts'][$count++] = $array;
669
+ }
670
+
671
+ $params['params']['Resubscribe'] = $ininboxResubscriber;
672
+ $params['params']['SendConfirmationEmail'] = $ininboxSendConfirmationEmail;
673
+ $params['params']['AddContactToAutoresponderCycle'] = $ininboxAddContactToAutoresponderCycle;
674
+
675
+ $params['params']['ListIDs'] = array_map('intval', explode(',', $ininboxGroupList));
676
+
677
+ $result = Mage::getModel('emailmarketing/ininbox_contact')->import($params);
678
+
679
+ if(isset($result['Code']) && isset($result['Message']))
680
+ {
681
+ $error_message = Mage::helper('adminhtml')->__('ERROR (' . $result['Code'] . '): ' . $result['Message']);
682
+ Mage::log($error_message, null, $this->_logFile);
683
+ }
684
+ }
685
+ catch (Exception $e) {
686
+ $error_message = Mage::helper('adminhtml')->__('ERROR: Error in importing contacts to INinbox. <br />' . $e->getMessage());
687
+ Mage::log($error_message, null, $this->_logFile);
688
+ }
689
+
690
+ return $error_message;
691
+ }
692
+
693
+ function processAbandonedCarts(Varien_Event_Observer $observer)
694
+ {
695
+ $ininboxAbandonedCartsEnabled = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_settings', $field = 'add_to_list_enabled');
696
+ $ininboxAbandonedCartsList = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_settings', $field = 'abandoned_list');
697
+ $ininboxAbandonedCartsTime = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_settings', $field = 'abandoned_time');
698
+ $ininboxAbandonedCartsCaptureRegistered = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_settings', $field = 'register_capture');
699
+
700
+ if($ininboxAbandonedCartsEnabled)
701
+ {
702
+ $adapter = Mage::getSingleton('core/resource')->getConnection('sales_read');
703
+ $minutes = $ininboxAbandonedCartsTime;
704
+ $from = $adapter->getDateSubSql(
705
+ $adapter->quote(now()),
706
+ $minutes,
707
+ Varien_Db_Adapter_Interface::INTERVAL_MINUTE
708
+ );
709
+ $quotes = Mage::getResourceModel('sales/quote_collection')
710
+ ->addFieldToFilter('reserved_order_id', array('null' => true))
711
+ ->addFieldToFilter('customer_email', array('neq' => null))
712
+ ->addFieldToFilter('updated_at', array('to' => $from))
713
+ ->addFieldToFilter('ininbox_is_abandoned', array('eq' => false));
714
+
715
+ if(!$ininboxAbandonedCartsCaptureRegistered)
716
+ $quotes->addFieldToFilter('checkout_method', array('eq' => 'guest'));
717
+
718
+ if($quotes->count() > 0)
719
+ {
720
+ foreach($quotes as $quote)
721
+ {
722
+ $quote->setData('ininbox_is_abandoned', 1);
723
+ $quote->save();
724
+ $this->addIninboxContactForAbandonedCarts($quote, $ininboxAbandonedCartsList);
725
+ }
726
+ }
727
+ }
728
+ }
729
+
730
+ public function addIninboxContactForAbandonedCarts($currentQuote, $ininboxGroupList)
731
+ {
732
+ try
733
+ {
734
+ $ininboxPredefinedCustomFields = Mage::getModel('emailmarketing/system_config_source_field_list')->getPredefinedCustomList();
735
+ $ininboxMappedCustomFields = unserialize(Mage::helper('emailmarketing')->getConfig($group = 'field_mapping', $field = 'field'));
736
+
737
+ $ininboxResubscriber = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_misc_settings', $field = 'update_subscriber') ? true : false;
738
+ $ininboxSendConfirmationEmail = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_misc_settings', $field = 'confirm_email') ? true : false;
739
+ $ininboxAddContactToAutoresponderCycle = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_misc_settings', $field = 'send_autoresponder') ? true : false;
740
+
741
+ foreach($ininboxMappedCustomFields as $mappedField)
742
+ {
743
+ $customerAttribute = 'customer_' . $mappedField['customer_attributes'];
744
+ $ininboxCustomField = $mappedField['ininbox_custom_fields'];
745
+
746
+ $customerAttributeValue = $currentOuote->getData($customerAttribute);
747
+ $customerAttributeValue = is_null($customerAttributeValue) ? '': $customerAttributeValue;
748
+ if(array_key_exists($ininboxCustomField, $ininboxPredefinedCustomFields))
749
+ $params['params'][$ininboxCustomField] = $customerAttributeValue;
750
+ else
751
+ $params['params']['CustomFields'][] = array('Key' => $ininboxCustomField, 'Value' => $customerAttributeValue);
752
+ }
753
+
754
+ $params['params']['Resubscribe'] = $ininboxResubscriber;
755
+ $params['params']['SendConfirmationEmail'] = $ininboxSendConfirmationEmail;
756
+ $params['params']['AddContactToAutoresponderCycle'] = $ininboxAddContactToAutoresponderCycle;
757
+
758
+ $params['params']['ListIDs'] = array_map('intval', explode(',', $ininboxGroupList));
759
+
760
+ $result = Mage::getModel('emailmarketing/ininbox_contact')->add($params);
761
+
762
+ if(isset($result['Code']) && isset($result['Message']))
763
+ {
764
+ $error_message = Mage::helper('adminhtml')->__('ERROR (' . $result['Code'] . '): ' . $result['Message']);
765
+ Mage::log($error_message, null, $this->_logFile);
766
+ }
767
+ }
768
+ catch (Exception $e) {
769
+ $error_message = Mage::helper('adminhtml')->__('ERROR: Error in importing contacts to INinbox. <br />' . $e->getMessage());
770
+ Mage::log($error_message, null, $this->_logFile);
771
+ }
772
+
773
+ return $error_message;
774
+ }
775
 
776
  public function validateIninboxConfig()
777
  {
app/code/local/Ininbox/Emailmarketing/Model/Sales/Order.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ininbox_Emailmarketing_Model_Sales_Order extends Mage_Sales_Model_Order
4
+ {
5
+ public function setState($state, $status = false, $comment = '', $isCustomerNotified = null)
6
+ {
7
+ $value = parent::setState($state, $status, $comment, $isCustomerNotified);
8
+ Mage::dispatchEvent('sales_order_status_after', array('order' => $this, 'state' => $state, 'status' => $status, 'comment' => $comment, 'isCustomerNotified' => $isCustomerNotified, 'shouldProtectState' => $shouldProtectState));
9
+ return $value;
10
+ }
11
+ }
12
+
13
+ ?>
app/code/local/Ininbox/Emailmarketing/Model/System/Config/Source/Customer/Attribute.php CHANGED
@@ -6,10 +6,9 @@
6
  **/
7
  class Ininbox_Emailmarketing_Model_System_Config_Source_Customer_Attribute
8
  {
9
- protected function _construct() {
10
-
11
- $this->_init('emailmarketing/system_config_source_customer_attribute');
12
-
13
  }
14
 
15
  /**
@@ -29,14 +28,28 @@ class Ininbox_Emailmarketing_Model_System_Config_Source_Customer_Attribute
29
 
30
  $result = array();
31
 
32
- foreach ($attributes as $attribute) {
33
-
34
- if (($label = $attribute->getFrontendLabel()))
35
- $result[$attribute->getAttributeCode()] = $label;
36
-
37
  }
38
 
39
  return $result;
40
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  }
42
  ?>
6
  **/
7
  class Ininbox_Emailmarketing_Model_System_Config_Source_Customer_Attribute
8
  {
9
+ protected function _construct()
10
+ {
11
+ $this->_init('emailmarketing/system_config_source_customer_attribute');
 
12
  }
13
 
14
  /**
28
 
29
  $result = array();
30
 
31
+ foreach ($attributes as $attribute)
32
+ {
33
+ if (($label = $attribute->getFrontendLabel()))
34
+ $result[] = array('value' => $attribute->getAttributeCode(), 'label'=>Mage::helper('adminhtml')->__($label));
 
35
  }
36
 
37
  return $result;
38
  }
39
+
40
+ public function toArray()
41
+ {
42
+ $attributes = Mage::getModel('customer/entity_attribute_collection');
43
+
44
+ $result = array();
45
+
46
+ foreach ($attributes as $attribute)
47
+ {
48
+ if (($label = $attribute->getFrontendLabel()))
49
+ $result[$attribute->getAttributeCode()] = $label;
50
+ }
51
+
52
+ return $result;
53
+ }
54
  }
55
  ?>
app/code/local/Ininbox/Emailmarketing/Model/System/Config/Source/Field/List.php CHANGED
@@ -6,6 +6,7 @@
6
  **/
7
  class Ininbox_Emailmarketing_Model_System_Config_Source_Field_List
8
  {
 
9
  protected $_predefinedCustomFields = array
10
  (
11
  'FirstName' => 'first_name',
@@ -14,16 +15,17 @@ class Ininbox_Emailmarketing_Model_System_Config_Source_Field_List
14
  'Gender' => 'gender',
15
  'Company' => 'company',
16
  'Address' => 'address'
17
- /*'CountryCode' => 'country',
18
- 'StateCode' => 'state',
19
- 'City' => 'city',
20
- 'Zip' => 'zip_code',
21
- 'HomePhone' => 'home_phone',
22
- 'MobilePhone' => 'mobile_phone',
23
- 'WorkPhone' => 'work_phone',
24
- 'Fax' => 'fax'*/
25
  );
26
-
 
27
  /**
28
  * use to get the list of custome fields
29
  *
@@ -31,17 +33,23 @@ class Ininbox_Emailmarketing_Model_System_Config_Source_Field_List
31
  */
32
  public function toOptionArray()
33
  {
34
- $result = $this->_predefinedCustomFields;
35
 
36
- $data = Mage::getModel('emailmarketing/ininbox_customfield')->getList();
37
-
38
- if(!is_null($data))
39
  {
40
- foreach($data['Results'] as $row)
41
- {
42
- $result[$row['FieldName']]= $row['FieldName'];
43
- }
44
  }
 
 
 
 
 
 
 
 
45
 
46
  return $result;
47
  }
@@ -53,8 +61,18 @@ class Ininbox_Emailmarketing_Model_System_Config_Source_Field_List
53
  */
54
  public function getPredefinedCustomList()
55
  {
56
- return $this->_predefinedCustomFields;
57
- }
 
 
 
 
 
 
 
 
 
 
58
  }
59
 
60
  ?>
6
  **/
7
  class Ininbox_Emailmarketing_Model_System_Config_Source_Field_List
8
  {
9
+ /*
10
  protected $_predefinedCustomFields = array
11
  (
12
  'FirstName' => 'first_name',
15
  'Gender' => 'gender',
16
  'Company' => 'company',
17
  'Address' => 'address'
18
+ //~ 'CountryCode' => 'country',
19
+ //~ 'StateCode' => 'state',
20
+ //~ 'City' => 'city',
21
+ //~ 'Zip' => 'zip_code',
22
+ //~ 'HomePhone' => 'home_phone',
23
+ //~ 'MobilePhone' => 'mobile_phone',
24
+ //~ 'WorkPhone' => 'work_phone',
25
+ //~ 'Fax' => 'fax'
26
  );
27
+ */
28
+
29
  /**
30
  * use to get the list of custome fields
31
  *
33
  */
34
  public function toOptionArray()
35
  {
36
+ //$result = $this->_predefinedCustomFields;
37
 
38
+ $system_defined = Mage::getModel('emailmarketing/ininbox_customfield')->getSystemDefinedList();
39
+
40
+ if(!is_null($system_defined))
41
  {
42
+ foreach($system_defined['SystemFields'] as $row)
43
+ $result[$row['FieldName']] = Mage::helper('adminhtml')->__($row['FieldLabel']);
 
 
44
  }
45
+
46
+ $custom_data = Mage::getModel('emailmarketing/ininbox_customfield')->getList();
47
+
48
+ if(!is_null($custom_data))
49
+ {
50
+ foreach($custom_data['Results'] as $row)
51
+ $result[$row['FieldName']] = Mage::helper('adminhtml')->__($row['FieldName']);
52
+ }
53
 
54
  return $result;
55
  }
61
  */
62
  public function getPredefinedCustomList()
63
  {
64
+ $result = array();
65
+
66
+ $system_defined = Mage::getModel('emailmarketing/ininbox_customfield')->getSystemDefinedList();
67
+
68
+ if(!is_null($system_defined))
69
+ {
70
+ foreach($system_defined['SystemFields'] as $row)
71
+ $result[$row['FieldName']] = Mage::helper('adminhtml')->__($row['FieldLabel']);
72
+ }
73
+
74
+ return $result;
75
+ }
76
  }
77
 
78
  ?>
app/code/local/Ininbox/Emailmarketing/Model/System/Config/Source/Group/List.php CHANGED
@@ -19,14 +19,32 @@ class Ininbox_Emailmarketing_Model_System_Config_Source_Group_List
19
 
20
  if(!is_null($data))
21
  {
22
- foreach($data['Results'] as $row)
23
- {
24
- $result[$row['ListID']] = $row['Title'];
25
- }
26
  }
27
 
28
  return $result;
29
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  }
31
 
32
  ?>
19
 
20
  if(!is_null($data))
21
  {
22
+ foreach($data['Results'] as $row)
23
+ $result[] = array('value' => $row['ListID'], 'label'=>Mage::helper('adminhtml')->__($row['Title']));
 
 
24
  }
25
 
26
  return $result;
27
  }
28
+
29
+ /**
30
+ * Get options in "key-value" format
31
+ *
32
+ * @return array
33
+ */
34
+ public function toArray()
35
+ {
36
+ $result = array();
37
+
38
+ $data = Mage::getModel('emailmarketing/ininbox_group')->getList();
39
+
40
+ if(!is_null($data))
41
+ {
42
+ foreach($data['Results'] as $row)
43
+ $result[$row['ListID']] = $row['Title'];
44
+ }
45
+
46
+ return $result;
47
+ }
48
  }
49
 
50
  ?>
app/code/local/Ininbox/Emailmarketing/Model/System/Config/Source/Order/Status.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * INinbox Email Marketing
4
+ * @category INinbox
5
+ * @package INinbox_Emailmarketing
6
+ **/
7
+ class Ininbox_Emailmarketing_Model_System_Config_Source_Order_Status
8
+ {
9
+ /**
10
+ * use to get the list of order status in magento
11
+ *
12
+ * @return list of contact
13
+ */
14
+ public function toOptionArray()
15
+ {
16
+ $result = array();
17
+
18
+ $data = Mage::getModel('sales/order_status')->getResourceCollection()->getData();
19
+
20
+ if(!is_null($data))
21
+ {
22
+ foreach($data as $row)
23
+ $result[] = array('value' => $row['status'], 'label'=>Mage::helper('adminhtml')->__($row['label']));
24
+ }
25
+
26
+ return $result;
27
+ }
28
+
29
+ /**
30
+ * Get options in "key-value" format
31
+ *
32
+ * @return array
33
+ */
34
+ public function toArray()
35
+ {
36
+ $result = array();
37
+
38
+ $data = Mage::getModel('sales/order_status')->getResourceCollection()->getData();
39
+
40
+ if(!is_null($data))
41
+ {
42
+ foreach($data as $row)
43
+ $result[$row['status']] = $row['label'];
44
+ }
45
+
46
+ return $result;
47
+ }
48
+ }
49
+
50
+ ?>
app/code/local/Ininbox/Emailmarketing/controllers/Adminhtml/AbandonedCartsController.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ininbox_Emailmarketing_Adminhtml_AbandonedCartsController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ protected function _initAction()
5
+ {
6
+ $this->loadLayout()->_setActiveMenu('ininbox/ininboxabandonedcarts');
7
+ return $this;
8
+ }
9
+
10
+ function indexAction()
11
+ {
12
+ $this->_initAction();
13
+ $this->_addContent($this->getLayout()->createBlock('emailmarketing/adminhtml_abandonedCarts'));
14
+ $this->renderLayout();
15
+ }
16
+ }
17
+ ?>
app/code/local/Ininbox/Emailmarketing/controllers/Adminhtml/IndexController.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ininbox_Emailmarketing_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ function indexAction()
5
+ {
6
+ $ininboxAbandonedCartsEnabled = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_settings', $field = 'add_to_list_enabled');
7
+ $ininboxAbandonedCartsList = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_settings', $field = 'abandoned_list');
8
+ $ininboxAbandonedCartsTime = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_settings', $field = 'abandoned_time');
9
+ $ininboxAbandonedCartsCaptureRegistered = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_settings', $field = 'register_capture');
10
+
11
+ if($ininboxAbandonedCartsEnabled)
12
+ {
13
+ $adapter = Mage::getSingleton('core/resource')->getConnection('sales_read');
14
+ $minutes = $ininboxAbandonedCartsTime;
15
+ $from = $adapter->getDateSubSql(
16
+ $adapter->quote(now()),
17
+ $minutes,
18
+ Varien_Db_Adapter_Interface::INTERVAL_MINUTE
19
+ );
20
+ $quotes = Mage::getResourceModel('sales/quote_collection')
21
+ ->addFieldToFilter('reserved_order_id', array('null' => true))
22
+ ->addFieldToFilter('customer_email', array('neq' => null))
23
+ ->addFieldToFilter('updated_at', array('to' => $from));
24
+
25
+ if(!$ininboxAbandonedCartsCaptureRegistered)
26
+ $quotes->addFieldToFilter('customer_is_guest', array('eq' => true));
27
+
28
+ if($quotes->count() > 0)
29
+ {
30
+ foreach($quotes as $quote)
31
+ Mage::getModel('emailmarketing/observer')->addIninboxContactForAbandonedCarts($quote, $ininboxAbandonedCartsList);
32
+ }
33
+ }
34
+ }
35
+ }
36
+ ?>
app/code/local/Ininbox/Emailmarketing/controllers/Adminhtml/MassactionController.php CHANGED
@@ -122,6 +122,44 @@ class Ininbox_Emailmarketing_Adminhtml_MassactionController extends Mage_Adminht
122
  $this->_redirect('adminhtml/sales_order/index/');
123
  return;
124
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  }
126
 
127
  ?>
122
  $this->_redirect('adminhtml/sales_order/index/');
123
  return;
124
  }
125
+
126
+
127
+ /**
128
+ * Action on mass action in sales order to add customer to INinbox list
129
+ */
130
+ public function abandonedCartsAction()
131
+ {
132
+ $quoteIds = $this->getRequest()->getPost('quote_ids', array());
133
+
134
+ if (!is_array($quoteIds)) {
135
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('newsletter')->__('Please select cart(s)'));
136
+ }
137
+ else {
138
+ try {
139
+ $isIninboxAbandonedCartsEnabled = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_settings', $field = 'add_to_list_enabled');
140
+ $ininboxAbandonedCartsList = Mage::helper('emailmarketing')->getConfig($group = 'abandoned_carts_settings', $field = 'abandoned_list');
141
+
142
+ if($isIninboxAbandonedCartsEnabled && !is_null($ininboxAbandonedCartsList))
143
+ {
144
+ $message = Mage::getModel('emailmarketing/observer')->importIninboxContactForAbandonedCarts($quoteIds, $ininboxAbandonedCartsList);
145
+
146
+ if(isset($message) && $message != '')
147
+ Mage::getSingleton('adminhtml/session')->addError($message);
148
+ else
149
+ {
150
+ Mage::getSingleton('adminhtml/session')->addSuccess(
151
+ Mage::helper('adminhtml')->__('Total of %d record(s) were added.', count($quoteIds))
152
+ );
153
+ }
154
+ }
155
+ } catch (Exception $e) {
156
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
157
+ }
158
+ }
159
+
160
+ $this->_redirect('admin_ininbox_emailmarketing/adminhtml_abandonedCarts/index/');
161
+ return;
162
+ }
163
  }
164
 
165
  ?>
app/code/local/Ininbox/Emailmarketing/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Ininbox_Emailmarketing>
5
- <version>1.2.2</version>
6
  </Ininbox_Emailmarketing>
7
  </modules>
8
  <frontend>
@@ -54,6 +54,11 @@
54
  <emailmarketing>
55
  <class>Ininbox_Emailmarketing_Model</class>
56
  </emailmarketing>
 
 
 
 
 
57
  </models>
58
  <resources>
59
  <emailmarketing_setup>
@@ -112,7 +117,7 @@
112
  </Ininbox_Emailmarketing_Model_Observer>
113
  </observers>
114
  </adminhtml_customer_save_after>
115
- <sales_order_place_after><!-- Default Event -->
116
  <observers>
117
  <Ininbox_Emailmarketing_Model_Observer>
118
  <type>singleton</type>
@@ -120,16 +125,16 @@
120
  <method>salesOrderPlaceAfterObserver</method>
121
  </Ininbox_Emailmarketing_Model_Observer>
122
  </observers>
123
- </sales_order_place_after>
124
- <sales_order_save_after><!-- Default Event -->
125
  <observers>
126
  <Ininbox_Emailmarketing_Model_Observer>
127
  <type>singleton</type>
128
  <class>Ininbox_Emailmarketing_Model_Observer</class>
129
- <method>salesOrderPlaceAfterObserver</method>
130
  </Ininbox_Emailmarketing_Model_Observer>
131
  </observers>
132
- </sales_order_save_after>
133
  <newsletter_subscribe_after>
134
  <observers>
135
  <Ininbox_Emailmarketing_Model_Observer>
@@ -174,6 +179,10 @@
174
  <title>INinbox</title>
175
  <sort_order>90</sort_order>
176
  <children>
 
 
 
 
177
  <emailmarketing>
178
  <title>Email Marketing Settings</title>
179
  <action>adminhtml/system_config/edit/section/ininbox_emailmarketing_options</action>
@@ -220,5 +229,22 @@
220
  <url>http://api.ininbox.com/v1/</url>
221
  </general>
222
  </ininbox_emailmarketing_options>
 
 
 
 
 
223
  </default>
 
 
 
 
 
 
 
 
 
 
 
 
224
  </config>
2
  <config>
3
  <modules>
4
  <Ininbox_Emailmarketing>
5
+ <version>2.0.0</version>
6
  </Ininbox_Emailmarketing>
7
  </modules>
8
  <frontend>
54
  <emailmarketing>
55
  <class>Ininbox_Emailmarketing_Model</class>
56
  </emailmarketing>
57
+ <sales>
58
+ <rewrite>
59
+ <order>Ininbox_Emailmarketing_Model_Sales_Order</order>
60
+ </rewrite>
61
+ </sales>
62
  </models>
63
  <resources>
64
  <emailmarketing_setup>
117
  </Ininbox_Emailmarketing_Model_Observer>
118
  </observers>
119
  </adminhtml_customer_save_after>
120
+ <!--<sales_order_place_after>
121
  <observers>
122
  <Ininbox_Emailmarketing_Model_Observer>
123
  <type>singleton</type>
125
  <method>salesOrderPlaceAfterObserver</method>
126
  </Ininbox_Emailmarketing_Model_Observer>
127
  </observers>
128
+ </sales_order_place_after>-->
129
+ <sales_order_status_after>
130
  <observers>
131
  <Ininbox_Emailmarketing_Model_Observer>
132
  <type>singleton</type>
133
  <class>Ininbox_Emailmarketing_Model_Observer</class>
134
+ <method>salesOrderStatusAfterObserver</method>
135
  </Ininbox_Emailmarketing_Model_Observer>
136
  </observers>
137
+ </sales_order_status_after>
138
  <newsletter_subscribe_after>
139
  <observers>
140
  <Ininbox_Emailmarketing_Model_Observer>
179
  <title>INinbox</title>
180
  <sort_order>90</sort_order>
181
  <children>
182
+ <ininboxabandonedcarts>
183
+ <title>Abandoned Carts</title>
184
+ <action>admin_ininbox_emailmarketing/adminhtml_abandonedCarts</action>
185
+ </ininboxabandonedcarts>
186
  <emailmarketing>
187
  <title>Email Marketing Settings</title>
188
  <action>adminhtml/system_config/edit/section/ininbox_emailmarketing_options</action>
229
  <url>http://api.ininbox.com/v1/</url>
230
  </general>
231
  </ininbox_emailmarketing_options>
232
+ <ininbox_emailmarketing_options>
233
+ <abandoned_carts_settings>
234
+ <abandoned_time>30</abandoned_time>
235
+ </abandoned_carts_settings>
236
+ </ininbox_emailmarketing_options>
237
  </default>
238
+ <crontab>
239
+ <jobs>
240
+ <ininbox_process_abandoned_carts>
241
+ <schedule>
242
+ <cron_expr>*/10 * * * *</cron_expr>
243
+ </schedule>
244
+ <run>
245
+ <model>emailmarketing/observer::processAbandonedCarts</model>
246
+ </run>
247
+ </ininbox_process_abandoned_carts>
248
+ </jobs>
249
+ </crontab>
250
  </config>
app/code/local/Ininbox/Emailmarketing/etc/system.xml CHANGED
@@ -80,7 +80,7 @@
80
  <customer_group_list translate="label">
81
  <label>Customer Group List: </label>
82
  <comment>Select the list where you want to add new customer account contacts.</comment>
83
- <frontend_type>select</frontend_type>
84
  <sort_order>2</sort_order>
85
  <show_in_default>1</show_in_default>
86
  <show_in_website>1</show_in_website>
@@ -90,6 +90,14 @@
90
  <send_customer>1</send_customer>
91
  </depends>
92
  </customer_group_list>
 
 
 
 
 
 
 
 
93
  </fields>
94
  </customer_settings>
95
  <customer_misc_settings translate="label">
@@ -183,7 +191,7 @@
183
  <order_group_list translate="label">
184
  <label>Order Group List: </label>
185
  <comment>Select the list where you want to add contacts that order.</comment>
186
- <frontend_type>select</frontend_type>
187
  <sort_order>2</sort_order>
188
  <show_in_default>1</show_in_default>
189
  <show_in_website>1</show_in_website>
@@ -192,7 +200,19 @@
192
  <depends>
193
  <send_order>1</send_order>
194
  </depends>
195
- </order_group_list>
 
 
 
 
 
 
 
 
 
 
 
 
196
  </fields>
197
  </order_settings>
198
  <order_misc_settings translate="label">
@@ -286,7 +306,7 @@
286
  <subscriber_group_list translate="label">
287
  <label>Newsletter Subscriber Group List: </label>
288
  <comment>Select the list where you want to add new subscribers.</comment>
289
- <frontend_type>select</frontend_type>
290
  <sort_order>2</sort_order>
291
  <show_in_default>1</show_in_default>
292
  <show_in_website>1</show_in_website>
@@ -369,11 +389,128 @@
369
  <source_model>adminhtml/system_config_source_yesno</source_model>
370
  </send_autoresponder>
371
  </fields>
372
- </newsletter_massaction_settings>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  <field_mapping translate="label">
374
  <label>Field Mapping</label>
375
  <frontend_type>text</frontend_type>
376
- <sort_order>11</sort_order>
377
  <show_in_default>1</show_in_default>
378
  <show_in_website>1</show_in_website>
379
  <fields>
80
  <customer_group_list translate="label">
81
  <label>Customer Group List: </label>
82
  <comment>Select the list where you want to add new customer account contacts.</comment>
83
+ <frontend_type>multiselect</frontend_type>
84
  <sort_order>2</sort_order>
85
  <show_in_default>1</show_in_default>
86
  <show_in_website>1</show_in_website>
90
  <send_customer>1</send_customer>
91
  </depends>
92
  </customer_group_list>
93
+ <!--<customer_group_list_multi translate="label">
94
+ <label>Customer Group List: </label>
95
+ <frontend_type>multiselect</frontend_type>
96
+ <sort_order>3</sort_order>
97
+ <show_in_default>1</show_in_default>
98
+ <show_in_website>1</show_in_website>
99
+ <source_model>emailmarketing/system_config_source_group_list</source_model>
100
+ </customer_group_list_multi>-->
101
  </fields>
102
  </customer_settings>
103
  <customer_misc_settings translate="label">
191
  <order_group_list translate="label">
192
  <label>Order Group List: </label>
193
  <comment>Select the list where you want to add contacts that order.</comment>
194
+ <frontend_type>multiselect</frontend_type>
195
  <sort_order>2</sort_order>
196
  <show_in_default>1</show_in_default>
197
  <show_in_website>1</show_in_website>
200
  <depends>
201
  <send_order>1</send_order>
202
  </depends>
203
+ </order_group_list>
204
+ <order_status_list translate="label">
205
+ <label>Send on which state(s): </label>
206
+ <comment>Choose one or more Status to determine when to subscribe in INinbox.</comment>
207
+ <frontend_type>multiselect</frontend_type>
208
+ <sort_order>3</sort_order>
209
+ <show_in_default>1</show_in_default>
210
+ <show_in_website>1</show_in_website>
211
+ <source_model>emailmarketing/system_config_source_order_status</source_model>
212
+ <depends>
213
+ <send_order>1</send_order>
214
+ </depends>
215
+ </order_status_list>
216
  </fields>
217
  </order_settings>
218
  <order_misc_settings translate="label">
306
  <subscriber_group_list translate="label">
307
  <label>Newsletter Subscriber Group List: </label>
308
  <comment>Select the list where you want to add new subscribers.</comment>
309
+ <frontend_type>multiselect</frontend_type>
310
  <sort_order>2</sort_order>
311
  <show_in_default>1</show_in_default>
312
  <show_in_website>1</show_in_website>
389
  <source_model>adminhtml/system_config_source_yesno</source_model>
390
  </send_autoresponder>
391
  </fields>
392
+ </newsletter_massaction_settings>
393
+ <abandoned_carts_settings>
394
+ <label>Abandoned Carts Settings</label>
395
+ <frontend_type>text</frontend_type>
396
+ <sort_order>11</sort_order>
397
+ <show_in_default>1</show_in_default>
398
+ <show_in_website>1</show_in_website>
399
+ <fields>
400
+ <add_to_list_enabled translate="label">
401
+ <label>Add Abandoned Carts To INinbox: </label>
402
+ <comment>This will add any abandoned shopping cart to the INinbox List.</comment>
403
+ <frontend_type>select</frontend_type>
404
+ <sort_order>1</sort_order>
405
+ <show_in_default>1</show_in_default>
406
+ <show_in_website>1</show_in_website>
407
+ <source_model>adminhtml/system_config_source_yesno</source_model>
408
+ </add_to_list_enabled>
409
+ <abandoned_time translate="label">
410
+ <label>Abandoned Time: </label>
411
+ <comment>How long(in minutes) before a cart is considered abandoned?</comment>
412
+ <frontend_type>text</frontend_type>
413
+ <sort_order>2</sort_order>
414
+ <show_in_default>1</show_in_default>
415
+ <show_in_website>1</show_in_website>
416
+ <validate>validate-digits</validate>
417
+ </abandoned_time>
418
+ <abandoned_list translate="label">
419
+ <label>Abandoned List: </label>
420
+ <comment>These are the List(s) that you will put abandoned shoppers into.</comment>
421
+ <frontend_type>multiselect</frontend_type>
422
+ <sort_order>3</sort_order>
423
+ <show_in_default>1</show_in_default>
424
+ <show_in_website>1</show_in_website>
425
+ <source_model>emailmarketing/system_config_source_group_list</source_model>
426
+ </abandoned_list>
427
+ <register_capture translate="label">
428
+ <label>Capture registered emails? </label>
429
+ <comment>When enabled, this feature will capture register emails from various forms within site to be used with abandoned carts.</comment>
430
+ <frontend_type>select</frontend_type>
431
+ <sort_order>4</sort_order>
432
+ <show_in_default>1</show_in_default>
433
+ <show_in_website>1</show_in_website>
434
+ <source_model>adminhtml/system_config_source_yesno</source_model>
435
+ </register_capture>
436
+ </fields>
437
+ </abandoned_carts_settings>
438
+ <abandoned_carts_misc_settings translate="label">
439
+ <label>Abandoned Carts Miscellaneous Settings</label>
440
+ <frontend_type>text</frontend_type>
441
+ <sort_order>12</sort_order>
442
+ <show_in_default>1</show_in_default>
443
+ <show_in_website>1</show_in_website>
444
+ <fields>
445
+ <confirm_email translate="label">
446
+ <label>Confirmation Email (for double optin lists): </label>
447
+ <comment>Select 'YES' will send the confirmation email when the list is set to double optin. For single optin no mail will be send.</comment>
448
+ <frontend_type>select</frontend_type>
449
+ <sort_order>1</sort_order>
450
+ <show_in_default>1</show_in_default>
451
+ <show_in_website>1</show_in_website>
452
+ <source_model>adminhtml/system_config_source_yesno</source_model>
453
+ </confirm_email>
454
+ <update_subscriber translate="label">
455
+ <label>Update existing subscriber: </label>
456
+ <comment>Select 'YES' will allow to update existing subscriber.</comment>
457
+ <frontend_type>select</frontend_type>
458
+ <sort_order>2</sort_order>
459
+ <show_in_default>1</show_in_default>
460
+ <show_in_website>1</show_in_website>
461
+ <source_model>adminhtml/system_config_source_yesno</source_model>
462
+ </update_subscriber>
463
+ <send_autoresponder translate="label">
464
+ <label>Send Autoresponders: </label>
465
+ <comment>Select 'YES' will add contacts to the autoresponder cycle.</comment>
466
+ <frontend_type>select</frontend_type>
467
+ <sort_order>3</sort_order>
468
+ <show_in_default>1</show_in_default>
469
+ <show_in_website>1</show_in_website>
470
+ <source_model>adminhtml/system_config_source_yesno</source_model>
471
+ </send_autoresponder>
472
+ </fields>
473
+ </abandoned_carts_misc_settings>
474
+ <abandoned_carts_massaction_settings translate="label">
475
+ <label>Abandoned Carts Miscellaneous Massaction Settings</label>
476
+ <frontend_type>text</frontend_type>
477
+ <sort_order>13</sort_order>
478
+ <show_in_default>1</show_in_default>
479
+ <show_in_website>1</show_in_website>
480
+ <fields>
481
+ <confirm_email translate="label">
482
+ <label>Confirmation Email (for double optin lists): </label>
483
+ <comment>Select 'YES' will send the confirmation email when the list is set to double optin. For single optin no mail will be send.</comment>
484
+ <frontend_type>select</frontend_type>
485
+ <sort_order>1</sort_order>
486
+ <show_in_default>1</show_in_default>
487
+ <show_in_website>1</show_in_website>
488
+ <source_model>adminhtml/system_config_source_yesno</source_model>
489
+ </confirm_email>
490
+ <update_subscriber translate="label">
491
+ <label>Update existing subscriber: </label>
492
+ <comment>Select 'YES' will allow to update existing subscriber.</comment>
493
+ <frontend_type>select</frontend_type>
494
+ <sort_order>2</sort_order>
495
+ <show_in_default>1</show_in_default>
496
+ <show_in_website>1</show_in_website>
497
+ <source_model>adminhtml/system_config_source_yesno</source_model>
498
+ </update_subscriber>
499
+ <send_autoresponder translate="label">
500
+ <label>Send Autoresponders: </label>
501
+ <comment>Select 'YES' will add contacts to the autoresponder cycle.</comment>
502
+ <frontend_type>select</frontend_type>
503
+ <sort_order>3</sort_order>
504
+ <show_in_default>1</show_in_default>
505
+ <show_in_website>1</show_in_website>
506
+ <source_model>adminhtml/system_config_source_yesno</source_model>
507
+ </send_autoresponder>
508
+ </fields>
509
+ </abandoned_carts_massaction_settings>
510
  <field_mapping translate="label">
511
  <label>Field Mapping</label>
512
  <frontend_type>text</frontend_type>
513
+ <sort_order>14</sort_order>
514
  <show_in_default>1</show_in_default>
515
  <show_in_website>1</show_in_website>
516
  <fields>
app/code/local/Ininbox/Emailmarketing/sql/emailmarketing_setup/mysql4-upgrade-1.2.1-2.0.0.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * INinbox Email Marketing
4
+ * @category INinbox
5
+ * @package INinbox_Emailmarketing
6
+ **/
7
+ $installer = $this;
8
+ $installer->startSetup();
9
+
10
+ $installer->run("
11
+ ALTER TABLE `" . $this->getTable('sales/quote') . "` ADD `ininbox_is_abandoned` BOOLEAN DEFAULT 0;
12
+ ");
13
+
14
+ $installer->endSetup();
15
+ ?>
app/design/adminhtml/default/default/template/ininbox/system/config/button.phtml CHANGED
@@ -79,6 +79,15 @@
79
  $('ininbox_emailmarketing_options_newsletter_massaction_settings').setStyle({display: display});
80
  $('ininbox_emailmarketing_options_newsletter_massaction_settings-head').up().setStyle({display: display});
81
 
 
 
 
 
 
 
 
 
 
82
  $('ininbox_emailmarketing_options_field_mapping').setStyle({display: display});
83
  $('ininbox_emailmarketing_options_field_mapping-head').up().setStyle({display: display});
84
  }
79
  $('ininbox_emailmarketing_options_newsletter_massaction_settings').setStyle({display: display});
80
  $('ininbox_emailmarketing_options_newsletter_massaction_settings-head').up().setStyle({display: display});
81
 
82
+ $('ininbox_emailmarketing_options_abandoned_carts_settings').setStyle({display: display});
83
+ $('ininbox_emailmarketing_options_abandoned_carts_settings-head').up().setStyle({display: display});
84
+
85
+ $('ininbox_emailmarketing_options_abandoned_carts_misc_settings').setStyle({display: display});
86
+ $('ininbox_emailmarketing_options_abandoned_carts_misc_settings-head').up().setStyle({display: display});
87
+
88
+ $('ininbox_emailmarketing_options_abandoned_carts_massaction_settings').setStyle({display: display});
89
+ $('ininbox_emailmarketing_options_abandoned_carts_massaction_settings-head').up().setStyle({display: display});
90
+
91
  $('ininbox_emailmarketing_options_field_mapping').setStyle({display: display});
92
  $('ininbox_emailmarketing_options_field_mapping-head').up().setStyle({display: display});
93
  }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>INinbox_Emailmarketing</name>
4
- <version>1.2.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
@@ -41,13 +41,13 @@ You can create your free INinbox account today &lt;a href="https://www.ininbox.c
41
  &lt;br /&gt;&#xD;
42
  &lt;strong&gt;Is there support available for this Extension?&lt;/strong&gt;&lt;br /&gt;&#xD;
43
  This is an official INinbox extension. If you need support you can contact INspired support here &lt;a href="http://www.INinbox.com/support"&gt;http://www.INinbox.com/support&lt;/a&gt;</description>
44
- <notes>1) Set API Key as required field.&#xD;
45
- 2) Connect button to check if API key entered is correct or not.&#xD;
46
- 3) Changed API call for Mass Action</notes>
47
  <authors><author><name>INinbox.com</name><user>INinbox</user><email>inspiredsupport@ininbox.com</email></author></authors>
48
- <date>2014-04-10</date>
49
- <time>12:42:27</time>
50
- <contents><target name="magelocal"><dir name="Ininbox"><dir name="Emailmarketing"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><file name="Grid.php" hash="86d1a54eae6be39062ba283dded1fc74"/></dir><file name="Menu.php" hash="d4392133285bca70425219a11ca073e0"/><dir name="Newsletter"><dir name="Subscriber"><file name="Grid.php" hash="181d4c1264cec1046c3fce78959fd170"/></dir></dir><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="26bb2b0670797ad9f00313efd3a40c6d"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="0ddf67423a255dea6607235a54491ff6"/></dir></dir></dir></dir><file name="Field.php" hash="beed8fad3c2700554d81d56b06f2b84f"/><file name="Select.php" hash="d116f5d18322d15def9f41416c489cc9"/></dir><dir name="Helper"><file name="Data.php" hash="5527375ebf9d821f021568c75ff6a10e"/></dir><dir name="Model"><dir name="Ininbox"><file name="Base.php" hash="2d2217079b82973ab6dd5d5622e3693b"/><file name="Contact.php" hash="5d85cf8a8fa36059685f9b27721e7dbb"/><file name="Customfield.php" hash="03cc50ad57bef11548762bee41425361"/><file name="General.php" hash="84be3f680d5050f89f6fd8a5225c0a41"/><file name="Group.php" hash="901d6a5a34c3ef49b7ab518eb276d0bd"/><file name=".goutputstream-QK2YCX" hash="dd0eae4a36ed0679651000ed78636cd9"/></dir><file name="Observer.php" hash="eaf32e775c73de69267262da3562d725"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Customer"><file name="Attribute.php" hash="b087317b0ec0479bb06b6f5492ec2ea3"/></dir><dir name="Field"><file name="List.php" hash="d47b67045c04f12ef5a1caae7aabb2ac"/></dir><dir name="Group"><file name="List.php" hash="ecbc9d7c8ead7301616570025761957f"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="AccountController.php" hash="7ef76d434c3f9a29724ec53176ac06f4"/><dir name="Adminhtml"><file name="ButtonController.php" hash="afabf8082be3321a7075418dd6b61fea"/><file name="CustomerController.php" hash="f55eda498c79e532f931b2b6a25f2c1f"/><file name="MassactionController.php" hash="da21c48b46a5445287741c0ab0846c51"/></dir><file name="ManageController.php" hash="a1afb00c33151ca164ce6a69d08d276f"/><file name="SubscriberController.php" hash="c1ccc8f3c75be9de1f3b2e26a7f730c8"/></dir><dir name="etc"><file name="config.xml" hash="68ac7bc58cbbbe58306d799b6ca847a6"/><file name="system.xml" hash="80f6ffd39392066affd0d68b8732811f"/></dir><dir name="sql"><dir name="emailmarketing_setup"><file name="mysql4-install-0.1.0.php" hash="90441bd504fcde8f0a292e53385ccd53"/><file name="mysql4-upgrade-0.1.0-1.2.1.php" hash="e8b63f7abfe1f414357a630def284140"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ininbox_Emailmarketing.xml" hash="ad90bc3dde0b7f34463702f9e8e8041d"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="ininbox"><dir name="css"><file name="ininbox.css" hash="f3bcef1095d4657aa830aa43e0d3d815"/></dir><dir name="images"><file name="ininbox.png" hash="ad2cecd7c657e4bd2c6d9f99f60389d2"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ininbox.xml" hash="eab17d72e6cf575936bdf69d34153f20"/></dir><dir name="template"><dir name="ininbox"><dir name="system"><dir name="config"><file name="button.phtml" hash="d4b6d99bf1b6179d123442ec530d208f"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
51
  <compatible/>
52
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
53
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>INinbox_Emailmarketing</name>
4
+ <version>2.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
41
  &lt;br /&gt;&#xD;
42
  &lt;strong&gt;Is there support available for this Extension?&lt;/strong&gt;&lt;br /&gt;&#xD;
43
  This is an official INinbox extension. If you need support you can contact INspired support here &lt;a href="http://www.INinbox.com/support"&gt;http://www.INinbox.com/support&lt;/a&gt;</description>
44
+ <notes>1) Update: Contacts can be added to Multiple Lists, for a particular event.&#xD;
45
+ 2) New: Order Contacts can be sent to INinbox at multiple states.&#xD;
46
+ 3) New: Customers who Abandon's their Cart, can also be added to INinbox list</notes>
47
  <authors><author><name>INinbox.com</name><user>INinbox</user><email>inspiredsupport@ininbox.com</email></author></authors>
48
+ <date>2014-04-21</date>
49
+ <time>11:25:26</time>
50
+ <contents><target name="magelocal"><dir name="Ininbox"><dir name="Emailmarketing"><dir name="Block"><dir name="Adminhtml"><dir name="AbandonedCarts"><file name="Grid.php" hash="973852b0d8995e7cde8ac9ba4f1bb304"/></dir><file name="AbandonedCarts.php" hash="50fd509e9ab91bd8c0f999b19db91cf7"/><dir name="Customer"><file name="Grid.php" hash="86d1a54eae6be39062ba283dded1fc74"/></dir><file name="Menu.php" hash="d4392133285bca70425219a11ca073e0"/><dir name="Newsletter"><dir name="Subscriber"><file name="Grid.php" hash="181d4c1264cec1046c3fce78959fd170"/></dir></dir><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="26bb2b0670797ad9f00313efd3a40c6d"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="0ddf67423a255dea6607235a54491ff6"/></dir></dir></dir></dir><file name="Field.php" hash="beed8fad3c2700554d81d56b06f2b84f"/><file name="Select.php" hash="d116f5d18322d15def9f41416c489cc9"/></dir><dir name="Helper"><file name="Data.php" hash="5527375ebf9d821f021568c75ff6a10e"/></dir><dir name="Model"><dir name="Ininbox"><file name="Base.php" hash="2d2217079b82973ab6dd5d5622e3693b"/><file name="Contact.php" hash="5d85cf8a8fa36059685f9b27721e7dbb"/><file name="Customfield.php" hash="4b97fb0acbcb7f0f44b3102448f0ba61"/><file name="General.php" hash="84be3f680d5050f89f6fd8a5225c0a41"/><file name="Group.php" hash="901d6a5a34c3ef49b7ab518eb276d0bd"/><file name=".goutputstream-QK2YCX" hash="dd0eae4a36ed0679651000ed78636cd9"/></dir><file name="Observer.php" hash="8fed8ba33a607b0803d04a5c3f5ce096"/><dir name="Sales"><file name="Order.php" hash="48e4aa009cfd082760e25b73c9962b72"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Customer"><file name="Attribute.php" hash="f6463ebff0b1db14d31f8eb0e14afc55"/></dir><dir name="Field"><file name="List.php" hash="e06aca5e8283a8e6a3ceb3c1967b3850"/></dir><dir name="Group"><file name="List.php" hash="4e993ce28bc761454080d94bb542636a"/></dir><dir name="Order"><file name="Status.php" hash="ee9074964634be50e8f9774c75d642a1"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="AccountController.php" hash="7ef76d434c3f9a29724ec53176ac06f4"/><dir name="Adminhtml"><file name="AbandonedCartsController.php" hash="17e73dec3c5aaa06b2fc8c053c1dda77"/><file name="ButtonController.php" hash="afabf8082be3321a7075418dd6b61fea"/><file name="CustomerController.php" hash="f55eda498c79e532f931b2b6a25f2c1f"/><file name="IndexController.php" hash="b9ff3edf31dd6a6727e257314efe6d9b"/><file name="MassactionController.php" hash="f40e87bfa0ffd33eb9c4cdd3ec9ca458"/></dir><file name="ManageController.php" hash="a1afb00c33151ca164ce6a69d08d276f"/><file name="SubscriberController.php" hash="c1ccc8f3c75be9de1f3b2e26a7f730c8"/></dir><dir name="etc"><file name="config.xml" hash="c4e79f587b2d7f52fa07abc72f6bcdb5"/><file name="system.xml" hash="cd9763602329263ecaff9cd161dea3f6"/></dir><dir name="sql"><dir name="emailmarketing_setup"><file name="mysql4-install-0.1.0.php" hash="90441bd504fcde8f0a292e53385ccd53"/><file name="mysql4-upgrade-0.1.0-1.2.1.php" hash="e8b63f7abfe1f414357a630def284140"/><file name="mysql4-upgrade-1.2.1-2.0.0.php" hash="d81c181e4c81a3e259d7e8b56d8451c7"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ininbox_Emailmarketing.xml" hash="ad90bc3dde0b7f34463702f9e8e8041d"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="ininbox"><dir name="css"><file name="ininbox.css" hash="f3bcef1095d4657aa830aa43e0d3d815"/></dir><dir name="images"><file name="ininbox.png" hash="ad2cecd7c657e4bd2c6d9f99f60389d2"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ininbox.xml" hash="eab17d72e6cf575936bdf69d34153f20"/></dir><dir name="template"><dir name="ininbox"><dir name="system"><dir name="config"><file name="button.phtml" hash="07ad763cd0bc79c18677d10b77b62e13"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
51
  <compatible/>
52
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
53
  </package>