Ebizmarts_MageMonkey - Version 1.1.33

Version Notes

1.1.33
--------
Improvement on the code display to fit Magento new standards.

Removed filter to resend subscription confirmation email.

Download this release

Release Info

Developer Magento Core Team
Extension Ebizmarts_MageMonkey
Version 1.1.33
Comparing to
See all releases


Code changes from version 1.1.32 to 1.1.33

Files changed (34) hide show
  1. app/code/community/Ebizmarts/AbandonedCart/Block/Adminhtml/Dashboard.php +0 -1
  2. app/code/community/Ebizmarts/AbandonedCart/Model/Cron.php +469 -206
  3. app/code/community/Ebizmarts/AbandonedCart/Model/EventObserver.php +3 -2
  4. app/code/community/Ebizmarts/AbandonedCart/etc/config.xml +1 -1
  5. app/code/community/Ebizmarts/Autoresponder/Model/Cron.php +137 -117
  6. app/code/community/Ebizmarts/Autoresponder/Model/EventObserver.php +29 -26
  7. app/code/community/Ebizmarts/Autoresponder/controllers/AutoresponderController.php +3 -2
  8. app/code/community/Ebizmarts/Autoresponder/etc/config.xml +1 -1
  9. app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/Transactionalemail/Mandrill.php +0 -33
  10. app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/Transactionalemail/Mandrill/Grid.php +0 -103
  11. app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/Transactionalemail/Newemail.php +0 -30
  12. app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/Transactionalemail/Newemail/Form.php +0 -55
  13. app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/Transactionalemail/Sts.php +0 -33
  14. app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/Transactionalemail/Sts/Grid.php +0 -87
  15. app/code/community/Ebizmarts/MageMonkey/Block/Lists.php +120 -46
  16. app/code/community/Ebizmarts/MageMonkey/Helper/Data.php +149 -118
  17. app/code/community/Ebizmarts/MageMonkey/Model/Cron.php +1 -19
  18. app/code/community/Ebizmarts/MageMonkey/Model/MCAPI.php +4 -0
  19. app/code/community/Ebizmarts/MageMonkey/Model/MCEXPORTAPI.php +6 -2
  20. app/code/community/Ebizmarts/MageMonkey/Model/Monkey.php +0 -13
  21. app/code/community/Ebizmarts/MageMonkey/Model/Observer.php +62 -4
  22. app/code/community/Ebizmarts/MageMonkey/Model/TransactionalEmail/Adapter.php +0 -30
  23. app/code/community/Ebizmarts/MageMonkey/Model/TransactionalEmail/MANDRILL.php +0 -355
  24. app/code/community/Ebizmarts/MageMonkey/Model/TransactionalEmail/STS.php +0 -243
  25. app/code/community/Ebizmarts/MageMonkey/controllers/Adminhtml/ConfigController.php +0 -2
  26. app/code/community/Ebizmarts/MageMonkey/controllers/Adminhtml/TransactionalemailController.php +0 -134
  27. app/code/community/Ebizmarts/MageMonkey/controllers/WebhookController.php +1 -1
  28. app/code/community/Ebizmarts/MageMonkey/etc/config.xml +1 -1
  29. app/code/community/Ebizmarts/Mandrill/Model/Email/Template.php +2 -2
  30. app/code/community/Ebizmarts/Mandrill/etc/config.xml +1 -1
  31. app/code/community/Ebizmarts/SweetMonkey/Model/Observer.php +52 -28
  32. app/code/community/Ebizmarts/SweetMonkey/controllers/Adminhtml/MageMonkeyController.php +6 -3
  33. app/code/community/Ebizmarts/SweetMonkey/etc/config.xml +1 -1
  34. package.xml +8 -6
app/code/community/Ebizmarts/AbandonedCart/Block/Adminhtml/Dashboard.php CHANGED
@@ -37,6 +37,5 @@ class Ebizmarts_AbandonedCart_Block_Adminhtml_Dashboard extends Mage_Adminhtml_B
37
  $output = $this->getLayout()->createBlock('ebizmarts_abandonedcart/adminhtml_dashboard_' . $blockTab)->toHtml();
38
  }
39
  $this->getResponse()->setBody($output);
40
- return;
41
  }
42
  }
37
  $output = $this->getLayout()->createBlock('ebizmarts_abandonedcart/adminhtml_dashboard_' . $blockTab)->toHtml();
38
  }
39
  $this->getResponse()->setBody($output);
 
40
  }
41
  }
app/code/community/Ebizmarts/AbandonedCart/Model/Cron.php CHANGED
@@ -11,6 +11,18 @@ class Ebizmarts_AbandonedCart_Model_Cron
11
  {
12
  // const EMAIL_TEMPLATE_XML_PATH = 'ebizmarts_abandonedcart/general/template';
13
  // const EMAIL_TEMPLATE_XML_PATH_W_COUPON = 'ebizmarts_abandonedcart/general/coupon_template';
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  /**
16
  *
@@ -61,235 +73,486 @@ class Ebizmarts_AbandonedCart_Model_Cron
61
  }
62
 
63
  $adapter = Mage::getSingleton('core/resource')->getConnection('sales_read');
64
- $days = array(
65
  0 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_1, $storeId),
66
  1 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_2, $storeId),
67
  2 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_3, $storeId),
68
  3 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_4, $storeId),
69
  4 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_5, $storeId)
70
  );
71
- $maxtimes = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::MAXTIMES, $storeId) + 1;
72
- $sendcoupon = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::SEND_COUPON, $storeId);
73
- $firstdate = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::FIRST_DATE, $storeId);
74
- $unit = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::UNIT, $storeId);
75
- $customergroups = explode(",", Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::CUSTOMER_GROUPS, $storeId));
76
- $mandrillTag = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::MANDRILL_TAG, $storeId) . "_$storeId";
77
 
78
  if ($abTesting) {
79
- $mandrillTag .= '_' . $suffix;
80
- $sendcoupondays = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::AB_TESTING_COUPON_SENDON, $storeId);
81
  } else {
82
- $sendcoupondays = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_DAYS, $storeId);
83
  }
84
 
85
  //coupon vars
86
- $couponamount = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_AMOUNT, $storeId);
87
- $couponexpiredays = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_EXPIRE, $storeId);
88
- $coupontype = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_TYPE, $storeId);
89
- $couponlength = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_LENGTH, $storeId);
90
- $couponlabel = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_LABEL, $storeId);
91
 
92
  // iterates one time for each mail number
93
- for ($run = 0; $run < $maxtimes; $run++) {
94
- if (!$days[$run]) {
95
  return;
96
  }
97
-
98
- // subtract days from latest run to get difference from the actual abandon date of the cart
99
- $diff = $days[$run];
100
- if ($run == 1 && $unit == Ebizmarts_AbandonedCart_Model_Config::IN_HOURS) {
101
- $diff -= $days[0] / 24;
102
- } elseif ($run != 0) {
103
- $diff -= $days[$run - 1];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  }
 
 
 
 
 
 
 
 
 
 
105
 
106
- // set the top date of the carts to get
107
- $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($diff, 'DAY'));
108
- if ($run == 0 && $unit == Ebizmarts_AbandonedCart_Model_Config::IN_HOURS) {
109
- $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($diff, 'HOUR'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
111
- $from = new Zend_Db_Expr($expr);
112
-
113
- // get collection of abandoned carts with cart_counter == $run
114
- $collection = Mage::getResourceModel('reports/quote_collection');
115
- $collection->addFieldToFilter('items_count', array('neq' => '0'))
116
- ->addFieldToFilter('main_table.is_active', '1')
117
- ->addFieldToFilter('main_table.store_id', array('eq' => $storeId))
118
- ->addSubtotal($storeId)
119
- ->setOrder('updated_at');
120
-
121
- $collection->addFieldToFilter('main_table.converted_at', array(array('null' => true), $this->_getSuggestedZeroDate()))
122
- ->addFieldToFilter('main_table.updated_at', array('to' => $from, 'from' => $firstdate))
123
- ->addFieldToFilter('main_table.ebizmarts_abandonedcart_counter', array('eq' => $run));
124
-
125
- $collection->addFieldToFilter('main_table.customer_email', array('neq' => ''));
126
- if (count($customergroups)) {
127
- $collection->addFieldToFilter('main_table.customer_group_id', array('in' => $customergroups));
128
  }
129
 
130
- // for each cart of the current run
131
- foreach ($collection as $quote) {
132
- foreach ($quote->getAllVisibleItems() as $item) {
133
- $removeFromQuote = false;
134
- $product = Mage::getModel('catalog/product')->setStoreId($storeId)->load($item->getProductId());
135
- if (!$product || $product->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
136
- Mage::log('AbandonedCart; ' . $product->getSku() . ' is no longer present or enabled; remove from quote ' . $quote->getId() . ' for email', null, 'Ebizmarts_AbandonedCart.log');
137
- $removeFromQuote = true;
138
- }
139
 
140
- if ($product->getTypeId() == 'configurable') {
141
- $simpleProductId = Mage::getModel('catalog/product')->getIdBySku($item->getSku());
142
- $simpleProduct = Mage::getModel('catalog/product')->load($simpleProductId);
143
- $stock = $simpleProduct->getStockItem();
144
- $stockQty = $stock->getQty();
145
- } elseif ($product->getTypeId() == 'bundle') {
146
- $options = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());
147
- $bundled_product = new Mage_Catalog_Model_Product();
148
- $bundled_product->load($product->getId());
149
- $selectionCollection = $bundled_product->getTypeInstance(true)->getSelectionsCollection(
150
- $bundled_product->getTypeInstance(true)->getOptionsIds($bundled_product), $bundled_product
151
- );
152
- $stockQty = -1;
153
- foreach ($selectionCollection as $option) {
154
- foreach ($options['bundle_options'] as $bundle) {
155
- if ($bundle['value'][0]['title'] == $option->getName()) {
156
- $label = $bundle['label'];
157
- $qty = $bundle['value'][0]['qty'];
158
- if ($stockQty == -1 || $stockQty > $qty) {
159
- $stockQty = $qty;
160
- }
161
- }
162
- }
163
- }
164
 
165
- } else {
166
- $stock = $product->getStockItem();
167
- $stockQty = $stock->getQty();
168
- }
169
 
170
- if (
171
- (
172
- is_object($stock) && ($stock->getManageStock() ||
173
- ($stock->getUseConfigManageStock() && Mage::getStoreConfig('cataloginventory/item_options/manage_stock', $quote->getStoreId())))
174
- )
175
- && $stockQty < $item->getQty()
176
- ) {
177
- Mage::log('AbandonedCart; ' . $product->getSku() . ' is no longer in stock; remove from quote ' . $quote->getId() . ' for email', null, 'Ebizmarts_AbandonedCart.log');
178
- $removeFromQuote = true;
179
- }
180
- if ($removeFromQuote) {
181
- $quote->removeItem($item->getId());
182
- }
183
- }
184
 
185
- if (count($quote->getAllVisibleItems()) < 1) {
186
- $quote2 = Mage::getModel('sales/quote')->loadByIdWithoutStore($quote->getId());
187
- $quote2->setEbizmartsAbandonedcartCounter($quote2->getEbizmartsAbandonedcartCounter() + 1);
188
- $quote2->save();
189
- continue;
190
- }
191
- // check if they are any order from the customer with date >=
192
- $collection2 = Mage::getResourceModel('reports/quote_collection');
193
- $collection2->addFieldToFilter('main_table.is_active', '0')
194
- ->addFieldToFilter('main_table.reserved_order_id', array('neq' => 'NULL'))
195
- ->addFieldToFilter('main_table.customer_email', array('eq' => $quote->getCustomerEmail()))
196
- ->addFieldToFilter('main_table.updated_at', array('from' => $quote->getUpdatedAt()));
197
- if ($collection2->getSize()) {
198
- continue;
199
- }
200
- //
201
- //$url = Mage::getBaseUrl('web').'ebizmarts_abandonedcart/abandoned/loadquote?id='.$quote->getEntityId();
202
- //srand((double)microtime()*1000000);
203
- $token = md5(rand(0, 9999999));
204
- if ($abTesting) {
205
- $url = Mage::getModel('core/url')->setStore($storeId)->getUrl('', array('_nosid' => true)) . 'ebizmarts_abandonedcart/abandoned/loadquote?id=' . $quote->getEntityId() . '&token=' . $token . '&' . $suffix;
206
- } else {
207
- $url = Mage::getModel('core/url')->setStore($storeId)->getUrl('', array('_nosid' => true)) . 'ebizmarts_abandonedcart/abandoned/loadquote?id=' . $quote->getEntityId() . '&token=' . $token;
208
  }
209
 
210
- $data = array('AbandonedURL' => $url, 'AbandonedDate' => $quote->getUpdatedAt());
211
-
212
- // send email
213
- $senderid = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::SENDER, $storeId);
214
- $sender = array('name' => Mage::getStoreConfig("trans_email/ident_$senderid/name", $storeId), 'email' => Mage::getStoreConfig("trans_email/ident_$senderid/email", $storeId));
215
-
216
- $email = $quote->getCustomerEmail();
217
-
218
- if (Mage::helper('ebizmarts_autoresponder')->isSubscribed($email, 'abandonedcart', $storeId)) {
219
- $name = $quote->getCustomerFirstname() . ' ' . $quote->getCustomerLastname();
220
- $quote2 = Mage::getModel('sales/quote')->loadByIdWithoutStore($quote->getId());
221
- $unsubscribeUrl = Mage::getModel('core/url')->setStore($storeId)->getUrl() . 'ebizautoresponder/autoresponder/unsubscribe?list=abandonedcart&email=' . $email . '&store=' . $storeId;
222
- $couponcode = '';
223
-
224
- //if hour is set for first run calculates hours since cart was created else calculates days
225
- $today = idate('U', strtotime(now()));
226
- $updatedAt = idate('U', strtotime($quote2->getUpdatedAt()));
227
- $updatedAtDiff = ($today - $updatedAt) / 60 / 60 / 24;
228
- if ($unit == Ebizmarts_AbandonedCart_Model_Config::IN_HOURS && $run == 0) {
229
- $updatedAtDiff = ($today - $updatedAt) / 60 / 60;
230
- }
231
-
232
- // if days have passed proceed to send mail
233
- if ($updatedAtDiff >= $diff) {
234
- $mailsubject = $this->_getMailSubject($run, $abTesting, $storeId);
235
- $templateId = $this->_getTemplateId($run, $abTesting, $storeId);
236
- if ($sendcoupon && $run + 1 == $sendcoupondays) {
237
- //$templateId = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::EMAIL_TEMPLATE_XML_PATH);
238
- // create a new coupon
239
- if (Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_AUTOMATIC) == 2) {
240
- list($couponcode, $discount, $toDate) = $this->_createNewCoupon($storeId, $email, $couponamount, $couponexpiredays, $coupontype, $couponlength, $couponlabel);
241
- $url .= '&coupon=' . $couponcode;
242
- $vars = array('quote' => $quote, 'url' => $url, 'couponcode' => $couponcode, 'discount' => $discount,
243
- 'todate' => $toDate, 'name' => $name, 'tags' => array($mandrillTag), 'unsubscribeurl' => $unsubscribeUrl);
244
- } else {
245
- $couponcode = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_CODE);
246
- $url .= '&coupon=' . $couponcode;
247
- $vars = array('quote' => $quote, 'url' => $url, 'couponcode' => $couponcode, 'name' => $name, 'tags' => array($mandrillTag), 'unsubscribeurl' => $unsubscribeUrl);
248
- }
249
  } else {
250
- //$templateId = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::EMAIL_TEMPLATE_XML_PATH);
251
- $vars = array('quote' => $quote, 'url' => $url, 'unsubscribeurl' => $unsubscribeUrl, 'tags' => array($mandrillTag));
252
-
253
  }
 
 
 
 
 
254
 
255
- $customer = Mage::getModel('customer/customer')
256
- ->setStore(Mage::app()->getStore($storeId))
257
- ->loadByEmail($email);
258
- if ($customer->getId()) {
259
- $tbtPoints = Mage::helper('ebizmarts_abandonedcart')->getTBTPoints($customer->getId(), $storeId);
260
- foreach ($tbtPoints as $key => $field) {
261
- if ($key == 'points') {
262
- if ($field >= Mage::getStoreConfig('sweetmonkey/general/email_points', $storeId)) {
263
- $vars[$key] = $field;
264
- }
265
- } else {
266
  $vars[$key] = $field;
267
  }
 
 
268
  }
269
  }
 
270
 
271
- Mage::app()->getTranslator()->init('frontend', true);
272
- $translate = Mage::getSingleton('core/translate');
273
- $mail = Mage::getModel('core/email_template')->setTemplateSubject($mailsubject)->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
274
- $translate->setTranslateInLine(true);
275
- $quote2->setEbizmartsAbandonedcartCounter($quote2->getEbizmartsAbandonedcartCounter() + 1);
276
- $quote2->setEbizmartsAbandonedcartToken($token);
277
- $quote2->save();
278
-
279
- if (Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::AB_TESTING_ACTIVE, $storeId)) {
280
- $counterCollection = Mage::getModel('ebizmarts_abandonedcart/abtesting')->getCollection()
281
- ->addFieldToFilter('store_id', array('eq' => $storeId));
282
- $counter = $counterCollection->getFirstItem();
283
- $counter->setCurrentStatus($counter->getCurrentStatus() + 1)
284
- ->save();
285
- }
286
- Mage::helper('ebizmarts_abandonedcart')->saveMail('abandoned cart', $email, $name, $couponcode, $storeId);
287
  }
 
288
  }
289
  }
290
  }
 
291
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  protected function _sendPopupCoupon($storeId)
294
  {
295
  $templateId = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_TEMPLATE_XML_PATH, $storeId);
@@ -300,11 +563,11 @@ class Ebizmarts_AbandonedCart_Model_Cron
300
 
301
 
302
  //coupon vars
303
- $couponamount = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_DISCOUNT, $storeId);
304
- $couponexpiredays = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_EXPIRE, $storeId);
305
- $coupontype = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_DISCOUNTTYPE, $storeId);
306
- $couponlength = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_LENGTH, $storeId);
307
- $couponlabel = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_LABEL, $storeId);
308
 
309
  $collection = Mage::getModel('ebizmarts_abandonedcart/popup')->getCollection()
310
  ->addFieldToFilter('email', array('neq' => ''))
@@ -315,7 +578,7 @@ class Ebizmarts_AbandonedCart_Model_Cron
315
  $emailArr = explode('@', $email);
316
  $pseudoName = $emailArr[0];
317
  if (Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_AUTOMATIC, $storeId) == 2) {
318
- list($couponcode, $discount, $toDate) = $this->_createNewCoupon($storeId, $email, $couponamount, $couponexpiredays, $coupontype, $couponlength, $couponlabel);
319
  $vars = array('couponcode' => $couponcode, 'discount' => $discount, 'todate' => $toDate, 'name' => $pseudoName, 'tags' => array($tags));
320
  } else {
321
  $couponcode = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_CODE);
@@ -334,7 +597,7 @@ class Ebizmarts_AbandonedCart_Model_Cron
334
  * @param $email
335
  * @return array
336
  */
337
- protected function _createNewCoupon($store, $email, $couponamount, $couponexpiredays, $coupontype, $couponlength, $couponlabel)
338
  {
339
  $collection = Mage::getModel('salesrule/rule')->getCollection()
340
  ->addFieldToFilter('name', array('like' => 'Abandoned coupon ' . $email));
@@ -343,13 +606,13 @@ class Ebizmarts_AbandonedCart_Model_Cron
343
  $websiteid = Mage::getModel('core/store')->load($store)->getWebsiteId();
344
 
345
  $fromDate = date("Y-m-d");
346
- $toDate = date('Y-m-d', strtotime($fromDate . " + $couponexpiredays day"));
347
- if ($coupontype == 1) {
348
  $action = 'cart_fixed';
349
- $discount = Mage::app()->getStore($store)->getCurrentCurrencyCode() . "$couponamount";
350
- } elseif ($coupontype == 2) {
351
  $action = 'by_percent';
352
- $discount = "$couponamount%";
353
  }
354
  $customer_group = new Mage_Customer_Model_Group();
355
  $allGroups = $customer_group->getCollection()->toOptionHash();
@@ -369,19 +632,19 @@ class Ebizmarts_AbandonedCart_Model_Cron
369
  ->setUsesPerCustomer(1)
370
  ->setCustomerGroupIds($groups)
371
  ->setProductIds('')
372
- ->setLengthMin($couponlength)
373
- ->setLengthMax($couponlength)
374
  ->setSortOrder(0)
375
- ->setStoreLabels(array($couponlabel))
376
  ->setSimpleAction($action)
377
- ->setDiscountAmount($couponamount)
378
  ->setDiscountQty(0)
379
  ->setDiscountStep('0')
380
  ->setSimpleFreeShipping('0')
381
  ->setApplyToShipping('0')
382
  ->setIsRss(0)
383
  ->setWebsiteIds($websiteid);
384
- $uniqueId = Mage::getSingleton('salesrule/coupon_codegenerator', array('length' => $couponlength))->generateCode();
385
  $coupon_rule->setCouponCode($uniqueId);
386
  $coupon_rule->save();
387
  return array($uniqueId, $discount, $toDate);
@@ -398,7 +661,7 @@ class Ebizmarts_AbandonedCart_Model_Cron
398
 
399
  /**
400
  * @param $interval
401
- * @param $unit
402
  * @return string
403
  */
404
  function _getIntervalUnitSql($interval, $unit)
11
  {
12
  // const EMAIL_TEMPLATE_XML_PATH = 'ebizmarts_abandonedcart/general/template';
13
  // const EMAIL_TEMPLATE_XML_PATH_W_COUPON = 'ebizmarts_abandonedcart/general/coupon_template';
14
+ protected $days;
15
+ protected $maxtimes;
16
+ protected $sendcoupon;
17
+ protected $firstdate;
18
+ protected $unit;
19
+ protected $customergroups;
20
+ protected $mandrillTag;
21
+ protected $couponamount;
22
+ protected $couponexpiredays;
23
+ protected $coupontype;
24
+ protected $couponlength;
25
+ protected $couponlabel;
26
 
27
  /**
28
  *
73
  }
74
 
75
  $adapter = Mage::getSingleton('core/resource')->getConnection('sales_read');
76
+ $this->days = array(
77
  0 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_1, $storeId),
78
  1 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_2, $storeId),
79
  2 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_3, $storeId),
80
  3 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_4, $storeId),
81
  4 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_5, $storeId)
82
  );
83
+ $this->maxtimes = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::MAXTIMES, $storeId) + 1;
84
+ $this->sendcoupon = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::SEND_COUPON, $storeId);
85
+ $this->firstdate = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::FIRST_DATE, $storeId);
86
+ $this->unit = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::UNIT, $storeId);
87
+ $this->customergroups = explode(",", Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::CUSTOMER_GROUPS, $storeId));
88
+ $this->mandrillTag = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::MANDRILL_TAG, $storeId) . "_$storeId";
89
 
90
  if ($abTesting) {
91
+ $this->mandrillTag .= '_' . $suffix;
92
+ $this->sendcoupondays = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::AB_TESTING_COUPON_SENDON, $storeId);
93
  } else {
94
+ $this->sendcoupondays = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_DAYS, $storeId);
95
  }
96
 
97
  //coupon vars
98
+ $this->couponamount = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_AMOUNT, $storeId);
99
+ $this->couponexpiredays = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_EXPIRE, $storeId);
100
+ $this->coupontype = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_TYPE, $storeId);
101
+ $this->couponlength = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_LENGTH, $storeId);
102
+ $this->couponlabel = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_LABEL, $storeId);
103
 
104
  // iterates one time for each mail number
105
+ for ($run = 0; $run < $this->maxtimes; $run++) {
106
+ if (!$this->days[$run]) {
107
  return;
108
  }
109
+ $this->_processRun($adapter, $run, $storeId, $abTesting, $suffix);
110
+ // // subtract days from latest run to get difference from the actual abandon date of the cart
111
+ // $diff = $this->days[$run];
112
+ // if ($run == 1 && $this->unit == Ebizmarts_AbandonedCart_Model_Config::IN_HOURS) {
113
+ // $diff -= $this->days[0] / 24;
114
+ // } elseif ($run != 0) {
115
+ // $diff -= $this->days[$run - 1];
116
+ // }
117
+ //
118
+ // // set the top date of the carts to get
119
+ // $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($diff, 'DAY'));
120
+ // if ($run == 0 && $this->unit == Ebizmarts_AbandonedCart_Model_Config::IN_HOURS) {
121
+ // $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($diff, 'HOUR'));
122
+ // }
123
+ // $from = new Zend_Db_Expr($expr);
124
+ //
125
+ // // get collection of abandoned carts with cart_counter == $run
126
+ // $collection = Mage::getResourceModel('reports/quote_collection');
127
+ // $collection->addFieldToFilter('items_count', array('neq' => '0'))
128
+ // ->addFieldToFilter('main_table.is_active', '1')
129
+ // ->addFieldToFilter('main_table.store_id', array('eq' => $storeId))
130
+ // ->addSubtotal($storeId)
131
+ // ->setOrder('updated_at');
132
+ //
133
+ // $collection->addFieldToFilter('main_table.converted_at', array(array('null' => true), $this->_getSuggestedZeroDate()))
134
+ // ->addFieldToFilter('main_table.updated_at', array('to' => $from, 'from' => $this->firstdate))
135
+ // ->addFieldToFilter('main_table.ebizmarts_abandonedcart_counter', array('eq' => $run));
136
+ //
137
+ // $collection->addFieldToFilter('main_table.customer_email', array('neq' => ''));
138
+ // if (count($this->customergroups)) {
139
+ // $collection->addFieldToFilter('main_table.customer_group_id', array('in' => $this->customergroups));
140
+ // }
141
+ //
142
+ // // for each cart of the current run
143
+ // foreach ($collection as $quote) {
144
+ // foreach ($quote->getAllVisibleItems() as $item) {
145
+ // $removeFromQuote = false;
146
+ // $product = Mage::getModel('catalog/product')->setStoreId($storeId)->load($item->getProductId());
147
+ // if (!$product || $product->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
148
+ // Mage::log('AbandonedCart; ' . $product->getSku() . ' is no longer present or enabled; remove from quote ' . $quote->getId() . ' for email', null, 'Ebizmarts_AbandonedCart.log');
149
+ // $removeFromQuote = true;
150
+ // }
151
+ //
152
+ // if ($product->getTypeId() == 'configurable') {
153
+ // $simpleProductId = Mage::getModel('catalog/product')->getIdBySku($item->getSku());
154
+ // $simpleProduct = Mage::getModel('catalog/product')->load($simpleProductId);
155
+ // $stock = $simpleProduct->getStockItem();
156
+ // $stockQty = $stock->getQty();
157
+ // } elseif ($product->getTypeId() == 'bundle') {
158
+ // $options = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());
159
+ // $bundled_product = new Mage_Catalog_Model_Product();
160
+ // $bundled_product->load($product->getId());
161
+ // $selectionCollection = $bundled_product->getTypeInstance(true)->getSelectionsCollection(
162
+ // $bundled_product->getTypeInstance(true)->getOptionsIds($bundled_product), $bundled_product
163
+ // );
164
+ // $stockQty = -1;
165
+ // foreach ($selectionCollection as $option) {
166
+ // foreach ($options['bundle_options'] as $bundle) {
167
+ // if ($bundle['value'][0]['title'] == $option->getName()) {
168
+ // $label = $bundle['label'];
169
+ // $qty = $bundle['value'][0]['qty'];
170
+ // if ($stockQty == -1 || $stockQty > $qty) {
171
+ // $stockQty = $qty;
172
+ // }
173
+ // }
174
+ // }
175
+ // }
176
+ //
177
+ // } else {
178
+ // $stock = $product->getStockItem();
179
+ // $stockQty = $stock->getQty();
180
+ // }
181
+ //
182
+ // if (
183
+ // (
184
+ // is_object($stock) && ($stock->getManageStock() ||
185
+ // ($stock->getUseConfigManageStock() && Mage::getStoreConfig('cataloginventory/item_options/manage_stock', $quote->getStoreId())))
186
+ // )
187
+ // && $stockQty < $item->getQty()
188
+ // ) {
189
+ // Mage::log('AbandonedCart; ' . $product->getSku() . ' is no longer in stock; remove from quote ' . $quote->getId() . ' for email', null, 'Ebizmarts_AbandonedCart.log');
190
+ // $removeFromQuote = true;
191
+ // }
192
+ // if ($removeFromQuote) {
193
+ // $quote->removeItem($item->getId());
194
+ // }
195
+ // }
196
+ //
197
+ // if (count($quote->getAllVisibleItems()) < 1) {
198
+ // $quote2 = Mage::getModel('sales/quote')->loadByIdWithoutStore($quote->getId());
199
+ // $quote2->setEbizmartsAbandonedcartCounter($quote2->getEbizmartsAbandonedcartCounter() + 1);
200
+ // $quote2->save();
201
+ // continue;
202
+ // }
203
+ // // check if they are any order from the customer with date >=
204
+ // $collection2 = Mage::getResourceModel('reports/quote_collection');
205
+ // $collection2->addFieldToFilter('main_table.is_active', '0')
206
+ // ->addFieldToFilter('main_table.reserved_order_id', array('neq' => 'NULL'))
207
+ // ->addFieldToFilter('main_table.customer_email', array('eq' => $quote->getCustomerEmail()))
208
+ // ->addFieldToFilter('main_table.updated_at', array('from' => $quote->getUpdatedAt()));
209
+ // if ($collection2->getSize()) {
210
+ // continue;
211
+ // }
212
+ // //
213
+ // //$url = Mage::getBaseUrl('web').'ebizmarts_abandonedcart/abandoned/loadquote?id='.$quote->getEntityId();
214
+ // //srand((double)microtime()*1000000);
215
+ // $token = md5(rand(0, 9999999));
216
+ // if ($abTesting) {
217
+ // $url = Mage::getModel('core/url')->setStore($storeId)->getUrl('', array('_nosid' => true)) . 'ebizmarts_abandonedcart/abandoned/loadquote?id=' . $quote->getEntityId() . '&token=' . $token . '&' . $suffix;
218
+ // } else {
219
+ // $url = Mage::getModel('core/url')->setStore($storeId)->getUrl('', array('_nosid' => true)) . 'ebizmarts_abandonedcart/abandoned/loadquote?id=' . $quote->getEntityId() . '&token=' . $token;
220
+ // }
221
+ //
222
+ // $data = array('AbandonedURL' => $url, 'AbandonedDate' => $quote->getUpdatedAt());
223
+ //
224
+ // // send email
225
+ // $senderid = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::SENDER, $storeId);
226
+ // $sender = array('name' => Mage::getStoreConfig("trans_email/ident_$senderid/name", $storeId), 'email' => Mage::getStoreConfig("trans_email/ident_$senderid/email", $storeId));
227
+ //
228
+ // $email = $quote->getCustomerEmail();
229
+ //
230
+ // if (Mage::helper('ebizmarts_autoresponder')->isSubscribed($email, 'abandonedcart', $storeId)) {
231
+ // $name = $quote->getCustomerFirstname() . ' ' . $quote->getCustomerLastname();
232
+ // $quote2 = Mage::getModel('sales/quote')->loadByIdWithoutStore($quote->getId());
233
+ // $unsubscribeUrl = Mage::getModel('core/url')->setStore($storeId)->getUrl() . 'ebizautoresponder/autoresponder/unsubscribe?list=abandonedcart&email=' . $email . '&store=' . $storeId;
234
+ // $couponcode = '';
235
+ //
236
+ // //if hour is set for first run calculates hours since cart was created else calculates days
237
+ // $today = idate('U', strtotime(now()));
238
+ // $updatedAt = idate('U', strtotime($quote2->getUpdatedAt()));
239
+ // $updatedAtDiff = ($today - $updatedAt) / 60 / 60 / 24;
240
+ // if ($this->unit == Ebizmarts_AbandonedCart_Model_Config::IN_HOURS && $run == 0) {
241
+ // $updatedAtDiff = ($today - $updatedAt) / 60 / 60;
242
+ // }
243
+ //
244
+ // // if days have passed proceed to send mail
245
+ // if ($updatedAtDiff >= $diff) {
246
+ // $mailsubject = $this->_getMailSubject($run, $abTesting, $storeId);
247
+ // $templateId = $this->_getTemplateId($run, $abTesting, $storeId);
248
+ // if ($this->sendcoupon && $run + 1 == $this->sendcoupondays) {
249
+ // //$templateId = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::EMAIL_TEMPLATE_XML_PATH);
250
+ // // create a new coupon
251
+ // if (Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_AUTOMATIC) == 2) {
252
+ // list($couponcode, $discount, $toDate) = $this->_createNewCoupon($storeId, $email, $this->couponamount, $this->couponexpiredays, $this->coupontype, $this->couponlength, $this->couponlabel);
253
+ // $url .= '&coupon=' . $couponcode;
254
+ // $vars = array('quote' => $quote, 'url' => $url, 'couponcode' => $couponcode, 'discount' => $discount,
255
+ // 'todate' => $toDate, 'name' => $name, 'tags' => array($this->mandrillTag), 'unsubscribeurl' => $unsubscribeUrl);
256
+ // } else {
257
+ // $couponcode = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_CODE);
258
+ // $url .= '&coupon=' . $couponcode;
259
+ // $vars = array('quote' => $quote, 'url' => $url, 'couponcode' => $couponcode, 'name' => $name, 'tags' => array($this->mandrillTag), 'unsubscribeurl' => $unsubscribeUrl);
260
+ // }
261
+ // } else {
262
+ // //$templateId = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::EMAIL_TEMPLATE_XML_PATH);
263
+ // $vars = array('quote' => $quote, 'url' => $url, 'unsubscribeurl' => $unsubscribeUrl, 'tags' => array($this->mandrillTag));
264
+ //
265
+ // }
266
+ //
267
+ // $customer = Mage::getModel('customer/customer')
268
+ // ->setStore(Mage::app()->getStore($storeId))
269
+ // ->loadByEmail($email);
270
+ // if ($customer->getId()) {
271
+ // $tbtPoints = Mage::helper('ebizmarts_abandonedcart')->getTBTPoints($customer->getId(), $storeId);
272
+ // foreach ($tbtPoints as $key => $field) {
273
+ // if ($key == 'points') {
274
+ // if ($field >= Mage::getStoreConfig('sweetmonkey/general/email_points', $storeId)) {
275
+ // $vars[$key] = $field;
276
+ // }
277
+ // } else {
278
+ // $vars[$key] = $field;
279
+ // }
280
+ // }
281
+ // }
282
+ //
283
+ // Mage::app()->getTranslator()->init('frontend', true);
284
+ // $translate = Mage::getSingleton('core/translate');
285
+ // $mail = Mage::getModel('core/email_template')->setTemplateSubject($mailsubject)->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
286
+ // $translate->setTranslateInLine(true);
287
+ // $quote2->setEbizmartsAbandonedcartCounter($quote2->getEbizmartsAbandonedcartCounter() + 1);
288
+ // $quote2->setEbizmartsAbandonedcartToken($token);
289
+ // $quote2->save();
290
+ //
291
+ // if (Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::AB_TESTING_ACTIVE, $storeId)) {
292
+ // $counterCollection = Mage::getModel('ebizmarts_abandonedcart/abtesting')->getCollection()
293
+ // ->addFieldToFilter('store_id', array('eq' => $storeId));
294
+ // $counter = $counterCollection->getFirstItem();
295
+ // $counter->setCurrentStatus($counter->getCurrentStatus() + 1)
296
+ // ->save();
297
+ // }
298
+ // Mage::helper('ebizmarts_abandonedcart')->saveMail('abandoned cart', $email, $name, $couponcode, $storeId);
299
+ // }
300
+ // }
301
+ // }
302
  }
303
+ }
304
+ protected function _processRun($adapter, $run, $storeId, $abTesting, $suffix)
305
+ {
306
+ // subtract days from latest run to get difference from the actual abandon date of the cart
307
+ $diff = $this->days[$run];
308
+ if ($run == 1 && $this->unit == Ebizmarts_AbandonedCart_Model_Config::IN_HOURS) {
309
+ $diff -= $this->days[0] / 24;
310
+ } elseif ($run != 0) {
311
+ $diff -= $this->days[$run - 1];
312
+ }
313
 
314
+ // set the top date of the carts to get
315
+ $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($diff, 'DAY'));
316
+ if ($run == 0 && $this->unit == Ebizmarts_AbandonedCart_Model_Config::IN_HOURS) {
317
+ $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($diff, 'HOUR'));
318
+ }
319
+ $from = new Zend_Db_Expr($expr);
320
+
321
+ // get collection of abandoned carts with cart_counter == $run
322
+ $collection = Mage::getResourceModel('reports/quote_collection');
323
+ $collection->addFieldToFilter('items_count', array('neq' => '0'))
324
+ ->addFieldToFilter('main_table.is_active', '1')
325
+ ->addFieldToFilter('main_table.store_id', array('eq' => $storeId))
326
+ ->addSubtotal($storeId)
327
+ ->setOrder('updated_at');
328
+
329
+ $collection->addFieldToFilter('main_table.converted_at', array(array('null' => true), $this->_getSuggestedZeroDate()))
330
+ ->addFieldToFilter('main_table.updated_at', array('to' => $from, 'from' => $this->firstdate))
331
+ ->addFieldToFilter('main_table.ebizmarts_abandonedcart_counter', array('eq' => $run));
332
+
333
+ $collection->addFieldToFilter('main_table.customer_email', array('neq' => ''));
334
+ if (count($this->customergroups)) {
335
+ $collection->addFieldToFilter('main_table.customer_group_id', array('in' => $this->customergroups));
336
+ }
337
+
338
+ // for each cart of the current run
339
+ foreach ($collection as $quote) {
340
+ $this->_proccessCollection($quote, $storeId);
341
+ // foreach ($quote->getAllVisibleItems() as $item) {
342
+ // $removeFromQuote = false;
343
+ // $product = Mage::getModel('catalog/product')->setStoreId($storeId)->load($item->getProductId());
344
+ // if (!$product || $product->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
345
+ // Mage::log('AbandonedCart; ' . $product->getSku() . ' is no longer present or enabled; remove from quote ' . $quote->getId() . ' for email', null, 'Ebizmarts_AbandonedCart.log');
346
+ // $removeFromQuote = true;
347
+ // }
348
+ //
349
+ // if ($product->getTypeId() == 'configurable') {
350
+ // $simpleProductId = Mage::getModel('catalog/product')->getIdBySku($item->getSku());
351
+ // $simpleProduct = Mage::getModel('catalog/product')->load($simpleProductId);
352
+ // $stock = $simpleProduct->getStockItem();
353
+ // $stockQty = $stock->getQty();
354
+ // } elseif ($product->getTypeId() == 'bundle') {
355
+ // $options = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());
356
+ // $bundled_product = new Mage_Catalog_Model_Product();
357
+ // $bundled_product->load($product->getId());
358
+ // $selectionCollection = $bundled_product->getTypeInstance(true)->getSelectionsCollection(
359
+ // $bundled_product->getTypeInstance(true)->getOptionsIds($bundled_product), $bundled_product
360
+ // );
361
+ // $stockQty = -1;
362
+ // foreach ($selectionCollection as $option) {
363
+ // foreach ($options['bundle_options'] as $bundle) {
364
+ // if ($bundle['value'][0]['title'] == $option->getName()) {
365
+ // $label = $bundle['label'];
366
+ // $qty = $bundle['value'][0]['qty'];
367
+ // if ($stockQty == -1 || $stockQty > $qty) {
368
+ // $stockQty = $qty;
369
+ // }
370
+ // }
371
+ // }
372
+ // }
373
+ //
374
+ // } else {
375
+ // $stock = $product->getStockItem();
376
+ // $stockQty = $stock->getQty();
377
+ // }
378
+ //
379
+ // if (
380
+ // (
381
+ // is_object($stock) && ($stock->getManageStock() ||
382
+ // ($stock->getUseConfigManageStock() && Mage::getStoreConfig('cataloginventory/item_options/manage_stock', $quote->getStoreId())))
383
+ // )
384
+ // && $stockQty < $item->getQty()
385
+ // ) {
386
+ // Mage::log('AbandonedCart; ' . $product->getSku() . ' is no longer in stock; remove from quote ' . $quote->getId() . ' for email', null, 'Ebizmarts_AbandonedCart.log');
387
+ // $removeFromQuote = true;
388
+ // }
389
+ // if ($removeFromQuote) {
390
+ // $quote->removeItem($item->getId());
391
+ // }
392
+ // }
393
+
394
+ if (count($quote->getAllVisibleItems()) < 1) {
395
+ $quote2 = Mage::getModel('sales/quote')->loadByIdWithoutStore($quote->getId());
396
+ $quote2->setEbizmartsAbandonedcartCounter($quote2->getEbizmartsAbandonedcartCounter() + 1);
397
+ $quote2->save();
398
+ continue;
399
  }
400
+ // check if they are any order from the customer with date >=
401
+ $collection2 = Mage::getResourceModel('reports/quote_collection');
402
+ $collection2->addFieldToFilter('main_table.is_active', '0')
403
+ ->addFieldToFilter('main_table.reserved_order_id', array('neq' => 'NULL'))
404
+ ->addFieldToFilter('main_table.customer_email', array('eq' => $quote->getCustomerEmail()))
405
+ ->addFieldToFilter('main_table.updated_at', array('from' => $quote->getUpdatedAt()));
406
+ if ($collection2->getSize()) {
407
+ continue;
408
+ }
409
+ //
410
+ //$url = Mage::getBaseUrl('web').'ebizmarts_abandonedcart/abandoned/loadquote?id='.$quote->getEntityId();
411
+ //srand((double)microtime()*1000000);
412
+ $token = md5(rand(0, 9999999));
413
+ if ($abTesting) {
414
+ $url = Mage::getModel('core/url')->setStore($storeId)->getUrl('', array('_nosid' => true)) . 'ebizmarts_abandonedcart/abandoned/loadquote?id=' . $quote->getEntityId() . '&token=' . $token . '&' . $suffix;
415
+ } else {
416
+ $url = Mage::getModel('core/url')->setStore($storeId)->getUrl('', array('_nosid' => true)) . 'ebizmarts_abandonedcart/abandoned/loadquote?id=' . $quote->getEntityId() . '&token=' . $token;
417
  }
418
 
419
+ $data = array('AbandonedURL' => $url, 'AbandonedDate' => $quote->getUpdatedAt());
 
 
 
 
 
 
 
 
420
 
421
+ // send email
422
+ $senderid = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::SENDER, $storeId);
423
+ $sender = array('name' => Mage::getStoreConfig("trans_email/ident_$senderid/name", $storeId), 'email' => Mage::getStoreConfig("trans_email/ident_$senderid/email", $storeId));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
424
 
425
+ $email = $quote->getCustomerEmail();
 
 
 
426
 
427
+ if (Mage::helper('ebizmarts_autoresponder')->isSubscribed($email, 'abandonedcart', $storeId)) {
428
+ $name = $quote->getCustomerFirstname() . ' ' . $quote->getCustomerLastname();
429
+ $quote2 = Mage::getModel('sales/quote')->loadByIdWithoutStore($quote->getId());
430
+ $unsubscribeUrl = Mage::getModel('core/url')->setStore($storeId)->getUrl() . 'ebizautoresponder/autoresponder/unsubscribe?list=abandonedcart&email=' . $email . '&store=' . $storeId;
431
+ $couponcode = '';
 
 
 
 
 
 
 
 
 
432
 
433
+ //if hour is set for first run calculates hours since cart was created else calculates days
434
+ $today = idate('U', strtotime(now()));
435
+ $updatedAt = idate('U', strtotime($quote2->getUpdatedAt()));
436
+ $updatedAtDiff = ($today - $updatedAt) / 60 / 60 / 24;
437
+ if ($this->unit == Ebizmarts_AbandonedCart_Model_Config::IN_HOURS && $run == 0) {
438
+ $updatedAtDiff = ($today - $updatedAt) / 60 / 60;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
439
  }
440
 
441
+ // if days have passed proceed to send mail
442
+ if ($updatedAtDiff >= $diff) {
443
+ $mailsubject = $this->_getMailSubject($run, $abTesting, $storeId);
444
+ $templateId = $this->_getTemplateId($run, $abTesting, $storeId);
445
+ if ($this->sendcoupon && $run + 1 == $this->sendcoupondays) {
446
+ //$templateId = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::EMAIL_TEMPLATE_XML_PATH);
447
+ // create a new coupon
448
+ if (Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_AUTOMATIC) == 2) {
449
+ list($couponcode, $discount, $toDate) = $this->_createNewCoupon($storeId, $email );
450
+ $url .= '&coupon=' . $couponcode;
451
+ $vars = array('quote' => $quote, 'url' => $url, 'couponcode' => $couponcode, 'discount' => $discount,
452
+ 'todate' => $toDate, 'name' => $name, 'tags' => array($this->mandrillTag), 'unsubscribeurl' => $unsubscribeUrl);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
  } else {
454
+ $couponcode = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_CODE);
455
+ $url .= '&coupon=' . $couponcode;
456
+ $vars = array('quote' => $quote, 'url' => $url, 'couponcode' => $couponcode, 'name' => $name, 'tags' => array($this->mandrillTag), 'unsubscribeurl' => $unsubscribeUrl);
457
  }
458
+ } else {
459
+ //$templateId = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::EMAIL_TEMPLATE_XML_PATH);
460
+ $vars = array('quote' => $quote, 'url' => $url, 'unsubscribeurl' => $unsubscribeUrl, 'tags' => array($this->mandrillTag));
461
+
462
+ }
463
 
464
+ $customer = Mage::getModel('customer/customer')
465
+ ->setStore(Mage::app()->getStore($storeId))
466
+ ->loadByEmail($email);
467
+ if ($customer->getId()) {
468
+ $tbtPoints = Mage::helper('ebizmarts_abandonedcart')->getTBTPoints($customer->getId(), $storeId);
469
+ foreach ($tbtPoints as $key => $field) {
470
+ if ($key == 'points') {
471
+ if ($field >= Mage::getStoreConfig('sweetmonkey/general/email_points', $storeId)) {
 
 
 
472
  $vars[$key] = $field;
473
  }
474
+ } else {
475
+ $vars[$key] = $field;
476
  }
477
  }
478
+ }
479
 
480
+ Mage::app()->getTranslator()->init('frontend', true);
481
+ $translate = Mage::getSingleton('core/translate');
482
+ $mail = Mage::getModel('core/email_template')->setTemplateSubject($mailsubject)->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
483
+ $translate->setTranslateInLine(true);
484
+ $quote2->setEbizmartsAbandonedcartCounter($quote2->getEbizmartsAbandonedcartCounter() + 1);
485
+ $quote2->setEbizmartsAbandonedcartToken($token);
486
+ $quote2->save();
487
+
488
+ if (Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::AB_TESTING_ACTIVE, $storeId)) {
489
+ $counterCollection = Mage::getModel('ebizmarts_abandonedcart/abtesting')->getCollection()
490
+ ->addFieldToFilter('store_id', array('eq' => $storeId));
491
+ $counter = $counterCollection->getFirstItem();
492
+ $counter->setCurrentStatus($counter->getCurrentStatus() + 1)
493
+ ->save();
 
 
494
  }
495
+ Mage::helper('ebizmarts_abandonedcart')->saveMail('abandoned cart', $email, $name, $couponcode, $storeId);
496
  }
497
  }
498
  }
499
+
500
  }
501
+ protected function _proccessCollection($quote, $storeId)
502
+ {
503
+ foreach ($quote->getAllVisibleItems() as $item) {
504
+ $removeFromQuote = false;
505
+ $product = Mage::getModel('catalog/product')->setStoreId($storeId)->load($item->getProductId());
506
+ if (!$product || $product->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED) {
507
+ Mage::log('AbandonedCart; ' . $product->getSku() . ' is no longer present or enabled; remove from quote ' . $quote->getId() . ' for email', null, 'Ebizmarts_AbandonedCart.log');
508
+ $removeFromQuote = true;
509
+ }
510
+
511
+ if ($product->getTypeId() == 'configurable') {
512
+ $simpleProductId = Mage::getModel('catalog/product')->getIdBySku($item->getSku());
513
+ $simpleProduct = Mage::getModel('catalog/product')->load($simpleProductId);
514
+ $stock = $simpleProduct->getStockItem();
515
+ $stockQty = $stock->getQty();
516
+ } elseif ($product->getTypeId() == 'bundle') {
517
+ $options = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());
518
+ $bundled_product = new Mage_Catalog_Model_Product();
519
+ $bundled_product->load($product->getId());
520
+ $selectionCollection = $bundled_product->getTypeInstance(true)->getSelectionsCollection(
521
+ $bundled_product->getTypeInstance(true)->getOptionsIds($bundled_product), $bundled_product
522
+ );
523
+ $stockQty = -1;
524
+ foreach ($selectionCollection as $option) {
525
+ foreach ($options['bundle_options'] as $bundle) {
526
+ if ($bundle['value'][0]['title'] == $option->getName()) {
527
+ $label = $bundle['label'];
528
+ $qty = $bundle['value'][0]['qty'];
529
+ if ($stockQty == -1 || $stockQty > $qty) {
530
+ $stockQty = $qty;
531
+ }
532
+ }
533
+ }
534
+ }
535
 
536
+ } else {
537
+ $stock = $product->getStockItem();
538
+ $stockQty = $stock->getQty();
539
+ }
540
+
541
+ if (
542
+ (
543
+ is_object($stock) && ($stock->getManageStock() ||
544
+ ($stock->getUseConfigManageStock() && Mage::getStoreConfig('cataloginventory/item_options/manage_stock', $quote->getStoreId())))
545
+ )
546
+ && $stockQty < $item->getQty()
547
+ ) {
548
+ Mage::log('AbandonedCart; ' . $product->getSku() . ' is no longer in stock; remove from quote ' . $quote->getId() . ' for email', null, 'Ebizmarts_AbandonedCart.log');
549
+ $removeFromQuote = true;
550
+ }
551
+ if ($removeFromQuote) {
552
+ $quote->removeItem($item->getId());
553
+ }
554
+ }
555
+ }
556
  protected function _sendPopupCoupon($storeId)
557
  {
558
  $templateId = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_TEMPLATE_XML_PATH, $storeId);
563
 
564
 
565
  //coupon vars
566
+ $this->couponamount = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_DISCOUNT, $storeId);
567
+ $this->couponexpiredays = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_EXPIRE, $storeId);
568
+ $this->coupontype = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_DISCOUNTTYPE, $storeId);
569
+ $this->couponlength = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_LENGTH, $storeId);
570
+ $this->couponlabel = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_LABEL, $storeId);
571
 
572
  $collection = Mage::getModel('ebizmarts_abandonedcart/popup')->getCollection()
573
  ->addFieldToFilter('email', array('neq' => ''))
578
  $emailArr = explode('@', $email);
579
  $pseudoName = $emailArr[0];
580
  if (Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_AUTOMATIC, $storeId) == 2) {
581
+ list($couponcode, $discount, $toDate) = $this->_createNewCoupon($storeId, $email);
582
  $vars = array('couponcode' => $couponcode, 'discount' => $discount, 'todate' => $toDate, 'name' => $pseudoName, 'tags' => array($tags));
583
  } else {
584
  $couponcode = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::POPUP_COUPON_CODE);
597
  * @param $email
598
  * @return array
599
  */
600
+ protected function _createNewCoupon($store, $email )
601
  {
602
  $collection = Mage::getModel('salesrule/rule')->getCollection()
603
  ->addFieldToFilter('name', array('like' => 'Abandoned coupon ' . $email));
606
  $websiteid = Mage::getModel('core/store')->load($store)->getWebsiteId();
607
 
608
  $fromDate = date("Y-m-d");
609
+ $toDate = date('Y-m-d', strtotime($fromDate . " + $this->couponexpiredays day"));
610
+ if ($this->coupontype == 1) {
611
  $action = 'cart_fixed';
612
+ $discount = Mage::app()->getStore($store)->getCurrentCurrencyCode() . "$this->couponamount";
613
+ } elseif ($this->coupontype == 2) {
614
  $action = 'by_percent';
615
+ $discount = "$this->couponamount%";
616
  }
617
  $customer_group = new Mage_Customer_Model_Group();
618
  $allGroups = $customer_group->getCollection()->toOptionHash();
632
  ->setUsesPerCustomer(1)
633
  ->setCustomerGroupIds($groups)
634
  ->setProductIds('')
635
+ ->setLengthMin($this->couponlength)
636
+ ->setLengthMax($this->couponlength)
637
  ->setSortOrder(0)
638
+ ->setStoreLabels(array($this->couponlabel))
639
  ->setSimpleAction($action)
640
+ ->setDiscountAmount($this->couponamount)
641
  ->setDiscountQty(0)
642
  ->setDiscountStep('0')
643
  ->setSimpleFreeShipping('0')
644
  ->setApplyToShipping('0')
645
  ->setIsRss(0)
646
  ->setWebsiteIds($websiteid);
647
+ $uniqueId = Mage::getSingleton('salesrule/coupon_codegenerator', array('length' => $this->couponlength))->generateCode();
648
  $coupon_rule->setCouponCode($uniqueId);
649
  $coupon_rule->save();
650
  return array($uniqueId, $discount, $toDate);
661
 
662
  /**
663
  * @param $interval
664
+ * @param $this->unit
665
  * @return string
666
  */
667
  function _getIntervalUnitSql($interval, $unit)
app/code/community/Ebizmarts/AbandonedCart/Model/EventObserver.php CHANGED
@@ -76,8 +76,9 @@ class Ebizmarts_AbandonedCart_Model_EventObserver
76
  if (!Mage::getSingleton('customer/session')->isLoggedIn() && Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::ENABLE_POPUP, $quote->getStoreId())) {
77
  $action = Mage::app()->getRequest()->getActionName();
78
  $onCheckout = ($action == 'saveOrder' || $action == 'savePayment' || $action == 'saveShippingMethod' || $action == 'saveBilling');
79
- if (isset($_COOKIE['email']) && $_COOKIE['email'] != 'none' && !$onCheckout) {
80
- $email = str_replace(' ', '+', $_COOKIE['email']);
 
81
  if ($quote->getCustomerEmail() != $email) {
82
  $quote->setCustomerEmail($email)
83
  ->save();
76
  if (!Mage::getSingleton('customer/session')->isLoggedIn() && Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::ENABLE_POPUP, $quote->getStoreId())) {
77
  $action = Mage::app()->getRequest()->getActionName();
78
  $onCheckout = ($action == 'saveOrder' || $action == 'savePayment' || $action == 'saveShippingMethod' || $action == 'saveBilling');
79
+ if(Mage::getModel('core/cookie')->get('email') && Mage::getModel('core/cookie')->get('email')!= 'none' && !$onCheckout) {
80
+ // if (isset($_COOKIE['email']) && $_COOKIE['email'] != 'none' && !$onCheckout) {
81
+ $email = str_replace(' ', '+', Mage::getModel('core/cookie')->get('email'));
82
  if ($quote->getCustomerEmail() != $email) {
83
  $quote->setCustomerEmail($email)
84
  ->save();
app/code/community/Ebizmarts/AbandonedCart/etc/config.xml CHANGED
@@ -10,7 +10,7 @@
10
  <config>
11
  <modules>
12
  <Ebizmarts_AbandonedCart>
13
- <version>1.1.32</version>
14
  </Ebizmarts_AbandonedCart>
15
  </modules>
16
  <global>
10
  <config>
11
  <modules>
12
  <Ebizmarts_AbandonedCart>
13
+ <version>1.1.33</version>
14
  </Ebizmarts_AbandonedCart>
15
  </modules>
16
  <global>
app/code/community/Ebizmarts/Autoresponder/Model/Cron.php CHANGED
@@ -70,9 +70,9 @@ class Ebizmarts_Autoresponder_Model_Cron
70
  $sender = array('name' => Mage::getStoreConfig("trans_email/ident_$senderId/name", $storeId), 'email' => Mage::getStoreConfig("trans_email/ident_$senderId/email", $storeId));
71
  $templateId = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_TEMPLATE, $storeId);
72
 
73
- $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days, 'DAY'));
74
  $from = new Zend_Db_Expr($expr);
75
- $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days - 1, 'DAY'));
76
  $to = new Zend_Db_Expr($expr);
77
  $collection = Mage::getResourceModel('sales/order_collection');
78
  $collection->addFieldToFilter('main_table.store_id', array('eq' => $storeId))
@@ -262,9 +262,9 @@ class Ebizmarts_Autoresponder_Model_Cron
262
  $maxRelated = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::RELATED_MAX, $storeId);
263
  $status = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::RELATED_STATUS, $storeId);
264
 
265
- $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days, 'DAY'));
266
  $from = new Zend_Db_Expr($expr);
267
- $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days - 1, 'DAY'));
268
  $to = new Zend_Db_Expr($expr);
269
  $collection = Mage::getResourceModel('sales/order_collection');
270
  $collection->addFieldToFilter('main_table.store_id', array('eq' => $storeId))
@@ -335,10 +335,11 @@ class Ebizmarts_Autoresponder_Model_Cron
335
  $templateId = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::REVIEW_TEMPLATE, $storeId);
336
  $status = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::REVIEW_STATUS, $storeId);
337
 
338
- $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days, 'DAY'));
339
- $from = new Zend_Db_Expr($expr);
340
- $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days - 1, 'DAY'));
341
- $to = new Zend_Db_Expr($expr);
 
342
  $collection = Mage::getResourceModel('sales/order_collection');
343
  $collection->addFieldToFilter('main_table.store_id', array('eq' => $storeId))
344
  // ->addFieldToFilter('main_table.created_at',array('from'=>$from,'to'=>$to))
@@ -416,9 +417,9 @@ class Ebizmarts_Autoresponder_Model_Cron
416
  $sender = array('name' => Mage::getStoreConfig("trans_email/ident_$senderId/name", $storeId), 'email' => Mage::getStoreConfig("trans_email/ident_$senderId/email", $storeId));
417
  $templateId = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::WISHLIST_TEMPLATE, $storeId);
418
 
419
- $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days, 'DAY'));
420
  $from = new Zend_Db_Expr($expr);
421
- $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days - 1, 'DAY'));
422
  $to = new Zend_Db_Expr($expr);
423
 
424
  $collection = Mage::getModel('wishlist/item')->getCollection();
@@ -507,16 +508,12 @@ class Ebizmarts_Autoresponder_Model_Cron
507
  $customerGroups = explode(",", Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::VISITED_CUSTOMER_GROUPS, $storeId));
508
  $days = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::VISITED_DAYS, $storeId);
509
  $tags = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::VISITED_MANDRILL_TAG, $storeId) . "_$storeId";
510
- $mailSubject = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::VISITED_SUBJECT, $storeId);
511
- $senderId = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::GENERAL_SENDER, $storeId);
512
- $sender = array('name' => Mage::getStoreConfig("trans_email/ident_$senderId/name", $storeId), 'email' => Mage::getStoreConfig("trans_email/ident_$senderId/email", $storeId));
513
- $templateId = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::VISITED_TEMPLATE, $storeId);
514
  $adapter = Mage::getSingleton('core/resource')->getConnection('sales_read');
515
  $max = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::VISITED_MAX, $storeId);
516
 
517
- $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days, 'DAY'));
518
  $from = new Zend_Db_Expr($expr);
519
- $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days - 1, 'DAY'));
520
  $to = new Zend_Db_Expr($expr);
521
 
522
  $collection = Mage::getModel('ebizmarts_autoresponder/visited')->getCollection();
@@ -534,28 +531,30 @@ class Ebizmarts_Autoresponder_Model_Cron
534
  if (Mage::helper('ebizmarts_autoresponder')->isSubscribed($email, 'visitedproducts', $storeId)) {
535
  $translate = Mage::getSingleton('core/translate');
536
  $name = $customer->getFirstname() . ' ' . $customer->getLastname();
537
- $url = Mage::getModel('core/url')->setStore($storeId)->getUrl() . 'ebizautoresponder/autoresponder/unsubscribe?list=visitedproducts&email=' . $email . '&store=' . $storeId;
538
- $vars = array('name' => $name, 'tags' => array($tags), 'products' => $products, 'url' => $url);
539
-
540
- $customer = Mage::getModel('customer/customer')
541
- ->setStore(Mage::app()->getStore($storeId))
542
- ->loadByEmail($email);
543
- if ($customer->getId()) {
544
- $tbtPoints = Mage::helper('ebizmarts_autoresponder')->getTBTPoints($customer->getId(), $storeId);
545
- foreach ($tbtPoints as $key => $field) {
546
- if ($key == 'points') {
547
- if ($field >= Mage::getStoreConfig('sweetmonkey/general/email_points', $storeId)) {
548
- $vars[$key] = $field;
549
- }
550
- } else {
551
- $vars[$key] = $field;
552
- }
553
- }
554
- }
555
-
556
- $mail = Mage::getModel('core/email_template')->setTemplateSubject($mailSubject)->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
557
- $translate->setTranslateInLine(true);
558
- Mage::helper('ebizmarts_abandonedcart')->saveMail('visitedproducts', $email, $name, "", $storeId);
 
 
559
  }
560
  }
561
  $products = array();
@@ -568,20 +567,6 @@ class Ebizmarts_Autoresponder_Model_Cron
568
  if (count($products) > $max && $max != 0 || ($customer && !in_array($customer->getGroupId(), $customerGroups))) {
569
  continue;
570
  }
571
- // $itemscollection = Mage::getModel('sales/order_item')->getCollection();
572
- // $itemscollection->addFieldToFilter('main_table.created_at',array('from'=>$from))
573
- // ->addFieldToFilter('main_table.product_id',array('eq'=>$item->getProductId()));
574
- // if($itemscollection->getSize() == 0) { // if not orders from date which include this product
575
- // if(Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::ACTIVE,$storeId)) { // if the abandoned cart module is active
576
- // $itemscollection2 = Mage::getModel('sales/quote_item')->getCollection();
577
- // $itemscollection2->addFieldToFilter('main_table.created_at',array('from'=>$from))
578
- // ->addFieldToFilter('main_table.product_id',array('eq'=>$item->getProductId()));
579
- // if($itemscollection2->getSize() > 0) { // if there are an abandoned cart which include this product
580
- // continue;
581
- // }
582
- // }
583
- // $products[]= Mage::getModel('catalog/product')->load($item->getProductId());
584
- // }
585
  $itemscollection = Mage::getModel('sales/quote')->getCollection();
586
  if ($item->getCustomerId()) {
587
  $itemscollection->addFieldToFilter('main_table.customer_id', array('eq' => $item->getCustomerId()));
@@ -601,28 +586,31 @@ class Ebizmarts_Autoresponder_Model_Cron
601
  $translate = Mage::getSingleton('core/translate');
602
  $email = $item->getCustomerEmail();
603
  $name = 'customer';
604
- $url = Mage::getModel('core/url')->setStore($storeId)->getUrl() . 'ebizautoresponder/autoresponder/unsubscribe?list=visitedproducts&email=' . $email . '&store=' . $storeId;
605
- $vars = array('name' => $name, 'tags' => array($tags), 'products' => $products, 'url' => $url);
606
-
607
- $customer = Mage::getModel('customer/customer')
608
- ->setStore(Mage::app()->getStore($storeId))
609
- ->loadByEmail($email);
610
- if ($customer->getId()) {
611
- $tbtPoints = Mage::helper('ebizmarts_autoresponder')->getTBTPoints($customer->getId(), $storeId);
612
- foreach ($tbtPoints as $key => $field) {
613
- if ($key == 'points') {
614
- if ($field >= Mage::getStoreConfig('sweetmonkey/general/email_points', $storeId)) {
615
- $vars[$key] = $field;
616
- }
617
- } else {
618
- $vars[$key] = $field;
619
- }
620
- }
621
- }
622
-
623
- $mail = Mage::getModel('core/email_template')->setTemplateSubject($mailSubject)->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
624
- $translate->setTranslateInLine(true);
625
- Mage::helper('ebizmarts_abandonedcart')->saveMail('visitedproducts', $email, $name, "", $storeId);
 
 
 
626
  }
627
  }
628
  if (count($products)) {
@@ -631,61 +619,93 @@ class Ebizmarts_Autoresponder_Model_Cron
631
  if (Mage::helper('ebizmarts_autoresponder')->isSubscribed($email, 'visitedproducts', $storeId)) {
632
  $translate = Mage::getSingleton('core/translate');
633
  $name = $customer->getFirstname() . ' ' . $customer->getLastname();
634
- $url = Mage::getModel('core/url')->setStore($storeId)->getUrl() . 'ebizautoresponder/autoresponder/unsubscribe?list=visitedproducts&email=' . $email . '&store=' . $storeId;
635
- $vars = array('name' => $name, 'tags' => array($tags), 'products' => $products, 'url' => $url);
636
-
637
- $customer = Mage::getModel('customer/customer')
638
- ->setStore(Mage::app()->getStore($storeId))
639
- ->loadByEmail($email);
640
- if ($customer->getId()) {
641
- $tbtPoints = Mage::helper('ebizmarts_autoresponder')->getTBTPoints($customer->getId(), $storeId);
642
- foreach ($tbtPoints as $key => $field) {
643
- if ($key == 'points') {
644
- if ($field >= Mage::getStoreConfig('sweetmonkey/general/email_points', $storeId)) {
645
- $vars[$key] = $field;
646
- }
647
- } else {
648
- $vars[$key] = $field;
649
- }
650
- }
651
- }
652
-
653
- $mail = Mage::getModel('core/email_template')->setTemplateSubject($mailSubject)->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
654
- $translate->setTranslateInLine(true);
655
- Mage::helper('ebizmarts_abandonedcart')->saveMail('visitedproducts', $email, $name, "", $storeId);
 
 
656
  }
657
  } else {
658
  //add customer by email placed on Abandoned Cart Popup
659
- $translate = Mage::getSingleton('core/translate');
660
  $email = $item->getCustomerEmail();
661
  $name = 'customer';
662
- $url = Mage::getModel('core/url')->setStore($storeId)->getUrl() . 'ebizautoresponder/autoresponder/unsubscribe?list=visitedproducts&email=' . $email . '&store=' . $storeId;
663
- $vars = array('name' => $name, 'tags' => array($tags), 'products' => $products, 'url' => $url);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664
 
665
- $customer = Mage::getModel('customer/customer')
666
- ->setStore(Mage::app()->getStore($storeId))
667
- ->loadByEmail($email);
668
- if ($customer->getId()) {
669
- $tbtPoints = Mage::helper('ebizmarts_autoresponder')->getTBTPoints($customer->getId(), $storeId);
670
- foreach ($tbtPoints as $key => $field) {
671
- if ($key == 'points') {
672
- if ($field >= Mage::getStoreConfig('sweetmonkey/general/email_points', $storeId)) {
673
- $vars[$key] = $field;
674
- }
675
- } else {
676
- $vars[$key] = $field;
677
- }
 
 
 
 
 
 
678
  }
 
 
679
  }
680
-
681
- $mail = Mage::getModel('core/email_template')->setTemplateSubject($mailSubject)->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
682
- $translate->setTranslateInLine(true);
683
- Mage::helper('ebizmarts_abandonedcart')->saveMail('visitedproducts', $email, $name, "", $storeId);
684
  }
685
  }
686
 
687
- }
 
 
 
688
 
 
689
  /**
690
  * Process and send all notifications of Back To Stock
691
  * @param $storeId
70
  $sender = array('name' => Mage::getStoreConfig("trans_email/ident_$senderId/name", $storeId), 'email' => Mage::getStoreConfig("trans_email/ident_$senderId/email", $storeId));
71
  $templateId = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_TEMPLATE, $storeId);
72
 
73
+ $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days + 1, 'DAY'));
74
  $from = new Zend_Db_Expr($expr);
75
+ $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days, 'DAY'));
76
  $to = new Zend_Db_Expr($expr);
77
  $collection = Mage::getResourceModel('sales/order_collection');
78
  $collection->addFieldToFilter('main_table.store_id', array('eq' => $storeId))
262
  $maxRelated = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::RELATED_MAX, $storeId);
263
  $status = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::RELATED_STATUS, $storeId);
264
 
265
+ $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days + 1, 'DAY'));
266
  $from = new Zend_Db_Expr($expr);
267
+ $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days, 'DAY'));
268
  $to = new Zend_Db_Expr($expr);
269
  $collection = Mage::getResourceModel('sales/order_collection');
270
  $collection->addFieldToFilter('main_table.store_id', array('eq' => $storeId))
335
  $templateId = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::REVIEW_TEMPLATE, $storeId);
336
  $status = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::REVIEW_STATUS, $storeId);
337
 
338
+ $exprFrom = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days + 1, 'DAY'));
339
+ $from = new Zend_Db_Expr($exprFrom);
340
+ $exprTo = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days, 'DAY'));
341
+ $to = new Zend_Db_Expr($exprTo);
342
+
343
  $collection = Mage::getResourceModel('sales/order_collection');
344
  $collection->addFieldToFilter('main_table.store_id', array('eq' => $storeId))
345
  // ->addFieldToFilter('main_table.created_at',array('from'=>$from,'to'=>$to))
417
  $sender = array('name' => Mage::getStoreConfig("trans_email/ident_$senderId/name", $storeId), 'email' => Mage::getStoreConfig("trans_email/ident_$senderId/email", $storeId));
418
  $templateId = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::WISHLIST_TEMPLATE, $storeId);
419
 
420
+ $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days + 1, 'DAY'));
421
  $from = new Zend_Db_Expr($expr);
422
+ $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days, 'DAY'));
423
  $to = new Zend_Db_Expr($expr);
424
 
425
  $collection = Mage::getModel('wishlist/item')->getCollection();
508
  $customerGroups = explode(",", Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::VISITED_CUSTOMER_GROUPS, $storeId));
509
  $days = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::VISITED_DAYS, $storeId);
510
  $tags = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::VISITED_MANDRILL_TAG, $storeId) . "_$storeId";
 
 
 
 
511
  $adapter = Mage::getSingleton('core/resource')->getConnection('sales_read');
512
  $max = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::VISITED_MAX, $storeId);
513
 
514
+ $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days + 1, 'DAY'));
515
  $from = new Zend_Db_Expr($expr);
516
+ $expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days, 'DAY'));
517
  $to = new Zend_Db_Expr($expr);
518
 
519
  $collection = Mage::getModel('ebizmarts_autoresponder/visited')->getCollection();
531
  if (Mage::helper('ebizmarts_autoresponder')->isSubscribed($email, 'visitedproducts', $storeId)) {
532
  $translate = Mage::getSingleton('core/translate');
533
  $name = $customer->getFirstname() . ' ' . $customer->getLastname();
534
+ $this->sendVisitedProductEmail($email,$storeId,$products,$name,$tags);
535
+
536
+ // $url = Mage::getModel('core/url')->setStore($storeId)->getUrl() . 'ebizautoresponder/autoresponder/unsubscribe?list=visitedproducts&email=' . $email . '&store=' . $storeId;
537
+ // $vars = array('name' => $name, 'tags' => array($tags), 'products' => $products, 'url' => $url);
538
+ //
539
+ // $customer = Mage::getModel('customer/customer')
540
+ // ->setStore(Mage::app()->getStore($storeId))
541
+ // ->loadByEmail($email);
542
+ // if ($customer->getId()) {
543
+ // $tbtPoints = Mage::helper('ebizmarts_autoresponder')->getTBTPoints($customer->getId(), $storeId);
544
+ // foreach ($tbtPoints as $key => $field) {
545
+ // if ($key == 'points') {
546
+ // if ($field >= Mage::getStoreConfig('sweetmonkey/general/email_points', $storeId)) {
547
+ // $vars[$key] = $field;
548
+ // }
549
+ // } else {
550
+ // $vars[$key] = $field;
551
+ // }
552
+ // }
553
+ // }
554
+ //
555
+ // $mail = Mage::getModel('core/email_template')->setTemplateSubject($mailSubject)->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
556
+ // $translate->setTranslateInLine(true);
557
+ // Mage::helper('ebizmarts_abandonedcart')->saveMail('visitedproducts', $email, $name, "", $storeId);
558
  }
559
  }
560
  $products = array();
567
  if (count($products) > $max && $max != 0 || ($customer && !in_array($customer->getGroupId(), $customerGroups))) {
568
  continue;
569
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
570
  $itemscollection = Mage::getModel('sales/quote')->getCollection();
571
  if ($item->getCustomerId()) {
572
  $itemscollection->addFieldToFilter('main_table.customer_id', array('eq' => $item->getCustomerId()));
586
  $translate = Mage::getSingleton('core/translate');
587
  $email = $item->getCustomerEmail();
588
  $name = 'customer';
589
+ $this->sendVisitedProductEmail($email,$storeId,$products,$name,$tags);
590
+
591
+
592
+ // $url = Mage::getModel('core/url')->setStore($storeId)->getUrl() . 'ebizautoresponder/autoresponder/unsubscribe?list=visitedproducts&email=' . $email . '&store=' . $storeId;
593
+ // $vars = array('name' => $name, 'tags' => array($tags), 'products' => $products, 'url' => $url);
594
+ //
595
+ // $customer = Mage::getModel('customer/customer')
596
+ // ->setStore(Mage::app()->getStore($storeId))
597
+ // ->loadByEmail($email);
598
+ // if ($customer->getId()) {
599
+ // $tbtPoints = Mage::helper('ebizmarts_autoresponder')->getTBTPoints($customer->getId(), $storeId);
600
+ // foreach ($tbtPoints as $key => $field) {
601
+ // if ($key == 'points') {
602
+ // if ($field >= Mage::getStoreConfig('sweetmonkey/general/email_points', $storeId)) {
603
+ // $vars[$key] = $field;
604
+ // }
605
+ // } else {
606
+ // $vars[$key] = $field;
607
+ // }
608
+ // }
609
+ // }
610
+ //
611
+ // $mail = Mage::getModel('core/email_template')->setTemplateSubject($mailSubject)->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
612
+ // $translate->setTranslateInLine(true);
613
+ // Mage::helper('ebizmarts_abandonedcart')->saveMail('visitedproducts', $email, $name, "", $storeId);
614
  }
615
  }
616
  if (count($products)) {
619
  if (Mage::helper('ebizmarts_autoresponder')->isSubscribed($email, 'visitedproducts', $storeId)) {
620
  $translate = Mage::getSingleton('core/translate');
621
  $name = $customer->getFirstname() . ' ' . $customer->getLastname();
622
+ $this->sendVisitedProductEmail($email,$storeId,$products,$name,$tags);
623
+
624
+ // $url = Mage::getModel('core/url')->setStore($storeId)->getUrl() . 'ebizautoresponder/autoresponder/unsubscribe?list=visitedproducts&email=' . $email . '&store=' . $storeId;
625
+ // $vars = array('name' => $name, 'tags' => array($tags), 'products' => $products, 'url' => $url);
626
+ //
627
+ // $customer = Mage::getModel('customer/customer')
628
+ // ->setStore(Mage::app()->getStore($storeId))
629
+ // ->loadByEmail($email);
630
+ // if ($customer->getId()) {
631
+ // $tbtPoints = Mage::helper('ebizmarts_autoresponder')->getTBTPoints($customer->getId(), $storeId);
632
+ // foreach ($tbtPoints as $key => $field) {
633
+ // if ($key == 'points') {
634
+ // if ($field >= Mage::getStoreConfig('sweetmonkey/general/email_points', $storeId)) {
635
+ // $vars[$key] = $field;
636
+ // }
637
+ // } else {
638
+ // $vars[$key] = $field;
639
+ // }
640
+ // }
641
+ // }
642
+ //
643
+ // $mail = Mage::getModel('core/email_template')->setTemplateSubject($mailSubject)->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
644
+ // $translate->setTranslateInLine(true);
645
+ // Mage::helper('ebizmarts_abandonedcart')->saveMail('visitedproducts', $email, $name, "", $storeId);
646
  }
647
  } else {
648
  //add customer by email placed on Abandoned Cart Popup
 
649
  $email = $item->getCustomerEmail();
650
  $name = 'customer';
651
+ $this->_sendVisitedProductEmail($email,$storeId,$products,$name,$tags);
652
+ // $url = Mage::getModel('core/url')->setStore($storeId)->getUrl() . 'ebizautoresponder/autoresponder/unsubscribe?list=visitedproducts&email=' . $email . '&store=' . $storeId;
653
+ // $vars = array('name' => $name, 'tags' => array($tags), 'products' => $products, 'url' => $url);
654
+ //
655
+ // $customer = Mage::getModel('customer/customer')
656
+ // ->setStore(Mage::app()->getStore($storeId))
657
+ // ->loadByEmail($email);
658
+ // if ($customer->getId()) {
659
+ // $tbtPoints = Mage::helper('ebizmarts_autoresponder')->getTBTPoints($customer->getId(), $storeId);
660
+ // foreach ($tbtPoints as $key => $field) {
661
+ // if ($key == 'points') {
662
+ // if ($field >= Mage::getStoreConfig('sweetmonkey/general/email_points', $storeId)) {
663
+ // $vars[$key] = $field;
664
+ // }
665
+ // } else {
666
+ // $vars[$key] = $field;
667
+ // }
668
+ // }
669
+ // }
670
+ //
671
+ // $mail = Mage::getModel('core/email_template')->setTemplateSubject($mailSubject)->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
672
+ // $translate->setTranslateInLine(true);
673
+ // Mage::helper('ebizmarts_abandonedcart')->saveMail('visitedproducts', $email, $name, "", $storeId);
674
+ }
675
+ }
676
 
677
+ }
678
+ protected function _sendVisitedProductEmail($email,$storeId,$products,$name,$tags)
679
+ {
680
+ $mailSubject = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::VISITED_SUBJECT, $storeId);
681
+ $senderId = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::GENERAL_SENDER, $storeId);
682
+ $sender = array('name' => Mage::getStoreConfig("trans_email/ident_$senderId/name", $storeId), 'email' => Mage::getStoreConfig("trans_email/ident_$senderId/email", $storeId));
683
+ $templateId = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::VISITED_TEMPLATE, $storeId);
684
+ $url = Mage::getModel('core/url')->setStore($storeId)->getUrl() . 'ebizautoresponder/autoresponder/unsubscribe?list=visitedproducts&email=' . $email . '&store=' . $storeId;
685
+ $vars = array('name' => $name, 'tags' => array($tags), 'products' => $products, 'url' => $url);
686
+
687
+ $customer = Mage::getModel('customer/customer')
688
+ ->setStore(Mage::app()->getStore($storeId))
689
+ ->loadByEmail($email);
690
+ if ($customer->getId()) {
691
+ $tbtPoints = Mage::helper('ebizmarts_autoresponder')->getTBTPoints($customer->getId(), $storeId);
692
+ foreach ($tbtPoints as $key => $field) {
693
+ if ($key == 'points') {
694
+ if ($field >= Mage::getStoreConfig('sweetmonkey/general/email_points', $storeId)) {
695
+ $vars[$key] = $field;
696
  }
697
+ } else {
698
+ $vars[$key] = $field;
699
  }
 
 
 
 
700
  }
701
  }
702
 
703
+ $translate = Mage::getSingleton('core/translate');
704
+ $mail = Mage::getModel('core/email_template')->setTemplateSubject($mailSubject)->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
705
+ $translate->setTranslateInLine(true);
706
+ Mage::helper('ebizmarts_abandonedcart')->saveMail('visitedproducts', $email, $name, "", $storeId);
707
 
708
+ }
709
  /**
710
  * Process and send all notifications of Back To Stock
711
  * @param $storeId
app/code/community/Ebizmarts/Autoresponder/Model/EventObserver.php CHANGED
@@ -23,33 +23,33 @@ class Ebizmarts_Autoresponder_Model_EventObserver
23
  }
24
  $store = is_null($o->getEvent()->getStore()) ? Mage::app()->getDefaultStoreView()->getCode() : $o->getEvent()->getStore();
25
  if (!Mage::helper('ebizmarts_mandrill')->useTransactionalService()) {
26
- $config = new Mage_Core_Model_Config();
27
  $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::GENERAL_ACTIVE, false, $scope, $store);
28
  Mage::getConfig()->cleanCache();
29
  }
30
  if (!Mage::helper('ebizmarts_mandrill')->useTransactionalService()) {
31
- $config = new Mage_Core_Model_Config();
32
  $config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ACTIVE, false, $scope, $store);
33
  $config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ENABLE_POPUP, false, $scope, $store);
34
  Mage::getConfig()->cleanCache();
35
  }
36
  if (!Mage::getStoreConfig('customer/address/dob_show')) {
37
- $config = new Mage_Core_Model_Config();
38
  $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::BIRTHDAY_ACTIVE, false, $scope, $store);
39
  Mage::getConfig()->cleanCache();
40
  }
41
  if (!Mage::getStoreConfig('customer/address/dob_show', $store)) {
42
- $config = new Mage_Core_Model_Config();
43
  $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::BIRTHDAY_ACTIVE, false, $scope, $store);
44
  Mage::getConfig()->cleanCache();
45
  }
46
  if (Mage::getStoreConfig('advanced/modules_disable_output/Mage_Wishlist', $store)) {
47
- $config = new Mage_Core_Model_Config();
48
  $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::WISHLIST_ACTIVE, false, $scope, $store);
49
  Mage::getConfig()->cleanCache();
50
  }
51
  if (Mage::getStoreConfig('advanced/modules_disable_output/Mage_Review', $store)) {
52
- $config = new Mage_Core_Model_Config();
53
  $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::REVIEW_ACTIVE, false, $scope, $store);
54
  Mage::getConfig()->cleanCache();
55
  }
@@ -226,30 +226,33 @@ class Ebizmarts_Autoresponder_Model_EventObserver
226
  public function orderSaved(Varien_Event_Observer $observer)
227
  {
228
  $storeId = $observer->getEvent()->getOrder()->getStoreId();
 
229
 
230
- $original_data = $observer->getEvent()->getData('data_object')->getOrigData();
231
- $new_data = $observer->getEvent()->getData('data_object')->getData();
232
 
233
- $order = $observer->getEvent()->getOrder();
 
234
 
235
- if (isset($new_data['status']) && isset($original_data['status']) && $original_data['status'] !== $new_data['status'] && $new_data['status'] == Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_ORDER_STATUS, $storeId)) {
236
- if (Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_ACTIVE, $storeId) && Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_TRIGGER, $storeId) == 1) {
237
- $tags = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_MANDRILL_TAG, $storeId) . "_$storeId";
238
- $mailSubject = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_SUBJECT, $storeId);
239
- $senderId = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::GENERAL_SENDER, $storeId);
240
- $sender = array('name' => Mage::getStoreConfig("trans_email/ident_$senderId/name", $storeId), 'email' => Mage::getStoreConfig("trans_email/ident_$senderId/email", $storeId));
241
- $templateId = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_TEMPLATE, $storeId);
242
 
243
- //Send email
244
- $translate = Mage::getSingleton('core/translate');
245
- $email = $order->getCustomerEmail();
246
- if (Mage::helper('ebizmarts_autoresponder')->isSubscribed($email, 'neworder', $storeId)) {
247
- $name = $order->getCustomerFirstname() . ' ' . $order->getCustomerLastname();
248
- $url = Mage::getModel('core/url')->setStore($storeId)->getUrl() . 'ebizautoresponder/autoresponder/unsubscribe?list=neworder&email=' . $email . '&store=' . $storeId;
249
- $vars = array('tags' => array($tags), 'url' => $url);
250
- $mail = Mage::getModel('core/email_template')->setTemplateSubject($mailSubject)->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
251
- $translate->setTranslateInLine(true);
252
- Mage::helper('ebizmarts_abandonedcart')->saveMail('new order', $email, $name, "", $storeId);
 
 
 
 
 
 
 
 
 
253
  }
254
  }
255
  }
23
  }
24
  $store = is_null($o->getEvent()->getStore()) ? Mage::app()->getDefaultStoreView()->getCode() : $o->getEvent()->getStore();
25
  if (!Mage::helper('ebizmarts_mandrill')->useTransactionalService()) {
26
+ $config = Mage::getModel('core/config');
27
  $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::GENERAL_ACTIVE, false, $scope, $store);
28
  Mage::getConfig()->cleanCache();
29
  }
30
  if (!Mage::helper('ebizmarts_mandrill')->useTransactionalService()) {
31
+ $config = Mage::getModel('core/config');
32
  $config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ACTIVE, false, $scope, $store);
33
  $config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ENABLE_POPUP, false, $scope, $store);
34
  Mage::getConfig()->cleanCache();
35
  }
36
  if (!Mage::getStoreConfig('customer/address/dob_show')) {
37
+ $config = Mage::getModel('core/config');
38
  $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::BIRTHDAY_ACTIVE, false, $scope, $store);
39
  Mage::getConfig()->cleanCache();
40
  }
41
  if (!Mage::getStoreConfig('customer/address/dob_show', $store)) {
42
+ $config = Mage::getModel('core/config');
43
  $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::BIRTHDAY_ACTIVE, false, $scope, $store);
44
  Mage::getConfig()->cleanCache();
45
  }
46
  if (Mage::getStoreConfig('advanced/modules_disable_output/Mage_Wishlist', $store)) {
47
+ $config = Mage::getModel('core/config');
48
  $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::WISHLIST_ACTIVE, false, $scope, $store);
49
  Mage::getConfig()->cleanCache();
50
  }
51
  if (Mage::getStoreConfig('advanced/modules_disable_output/Mage_Review', $store)) {
52
+ $config = Mage::getModel('core/config');
53
  $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::REVIEW_ACTIVE, false, $scope, $store);
54
  Mage::getConfig()->cleanCache();
55
  }
226
  public function orderSaved(Varien_Event_Observer $observer)
227
  {
228
  $storeId = $observer->getEvent()->getOrder()->getStoreId();
229
+ if(Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_ACTIVE, $storeId)) {
230
 
 
 
231
 
232
+ $original_data = $observer->getEvent()->getData('data_object')->getOrigData();
233
+ $new_data = $observer->getEvent()->getData('data_object')->getData();
234
 
235
+ $order = $observer->getEvent()->getOrder();
 
 
 
 
 
 
236
 
237
+ if (isset($new_data['status']) && isset($original_data['status']) && $original_data['status'] !== $new_data['status'] && $new_data['status'] == Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_ORDER_STATUS, $storeId)) {
238
+ if (Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_ACTIVE, $storeId) && Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_TRIGGER, $storeId) == 1) {
239
+ $tags = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_MANDRILL_TAG, $storeId) . "_$storeId";
240
+ $mailSubject = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_SUBJECT, $storeId);
241
+ $senderId = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::GENERAL_SENDER, $storeId);
242
+ $sender = array('name' => Mage::getStoreConfig("trans_email/ident_$senderId/name", $storeId), 'email' => Mage::getStoreConfig("trans_email/ident_$senderId/email", $storeId));
243
+ $templateId = Mage::getStoreConfig(Ebizmarts_Autoresponder_Model_Config::NEWORDER_TEMPLATE, $storeId);
244
+
245
+ //Send email
246
+ $translate = Mage::getSingleton('core/translate');
247
+ $email = $order->getCustomerEmail();
248
+ if (Mage::helper('ebizmarts_autoresponder')->isSubscribed($email, 'neworder', $storeId)) {
249
+ $name = $order->getCustomerFirstname() . ' ' . $order->getCustomerLastname();
250
+ $url = Mage::getModel('core/url')->setStore($storeId)->getUrl() . 'ebizautoresponder/autoresponder/unsubscribe?list=neworder&email=' . $email . '&store=' . $storeId;
251
+ $vars = array('tags' => array($tags), 'url' => $url);
252
+ $mail = Mage::getModel('core/email_template')->setTemplateSubject($mailSubject)->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
253
+ $translate->setTranslateInLine(true);
254
+ Mage::helper('ebizmarts_abandonedcart')->saveMail('new order', $email, $name, "", $storeId);
255
+ }
256
  }
257
  }
258
  }
app/code/community/Ebizmarts/Autoresponder/controllers/AutoresponderController.php CHANGED
@@ -111,8 +111,9 @@ class Ebizmarts_Autoresponder_AutoresponderController extends Mage_Core_Controll
111
  return;
112
  }
113
  if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
114
- if (isset($_COOKIE['email']) && $_COOKIE['email'] != 'none') {
115
- $email = str_replace(' ', '+', $_COOKIE['email']);
 
116
  } else {
117
  return;
118
  }
111
  return;
112
  }
113
  if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
114
+ if(Mage::getModel('core/cookie')->get('email')&&Mage::getModel('core/cookie')->get('email')!='none') {
115
+ // if (isset($_COOKIE['email']) && $_COOKIE['email'] != 'none') {
116
+ $email = str_replace(' ', '+', Mage::getModel('core/cookie')->get('email'));
117
  } else {
118
  return;
119
  }
app/code/community/Ebizmarts/Autoresponder/etc/config.xml CHANGED
@@ -10,7 +10,7 @@
10
  <config>
11
  <modules>
12
  <Ebizmarts_Autoresponder>
13
- <version>1.1.11</version>
14
  </Ebizmarts_Autoresponder>
15
  </modules>
16
  <global>
10
  <config>
11
  <modules>
12
  <Ebizmarts_Autoresponder>
13
+ <version>1.1.12</version>
14
  </Ebizmarts_Autoresponder>
15
  </modules>
16
  <global>
app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/Transactionalemail/Mandrill.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Transactional email Mandrill grid container
5
- *
6
- * @category Ebizmarts
7
- * @package Ebizmarts_MageMonkey
8
- * @author Ebizmarts Team <info@ebizmarts.com>
9
- * @license http://opensource.org/licenses/osl-3.0.php
10
- */
11
- class Ebizmarts_MageMonkey_Block_Adminhtml_Transactionalemail_Mandrill extends Mage_Adminhtml_Block_Widget_Grid_Container
12
- {
13
-
14
- public function __construct()
15
- {
16
- $this->_controller = 'adminhtml_transactionalemail_mandrill';
17
- $this->_blockGroup = 'monkey';
18
- $this->_headerText = Mage::helper('monkey')->__('Verified Email Addresses');
19
-
20
- parent::__construct();
21
- }
22
-
23
- public function getGridHtml()
24
- {
25
- return $this->getChildHtml('store_switcher') . $this->getChildHtml('grid');
26
- }
27
-
28
- public function getCreateUrl()
29
- {
30
- return $this->getUrl('*/*/new', array('service' => 'mandrill', 'store' => $this->getRequest()->getParam('store', 0)));
31
- }
32
-
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/Transactionalemail/Mandrill/Grid.php DELETED
@@ -1,103 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Transactional email Mandrill grid
5
- *
6
- * @category Ebizmarts
7
- * @package Ebizmarts_MageMonkey
8
- * @author Ebizmarts Team <info@ebizmarts.com>
9
- * @license http://opensource.org/licenses/osl-3.0.php
10
- */
11
- class Ebizmarts_MageMonkey_Block_Adminhtml_Transactionalemail_Mandrill_Grid extends Mage_Adminhtml_Block_Widget_Grid
12
- {
13
-
14
- public function __construct()
15
- {
16
- parent::__construct();
17
- $this->setId('mandrill_valid_emails');
18
- $this->setUseAjax(false);
19
- $this->setSaveParametersInSession(false);
20
- $this->setPagerVisibility(false);
21
- $this->setFilterVisibility(false);
22
- }
23
-
24
- protected function _prepareCollection()
25
- {
26
- $apiKey = Mage::helper('monkey')->getMandrillApiKey(0);
27
- $mail = Ebizmarts_MageMonkey_Model_TransactionalEmail_Adapter::factory('mandrill')
28
- ->setApiKey($apiKey);
29
- $emails = $mail->usersSenders();
30
-
31
- if ($emails !== FALSE) {
32
- $_emails = array();
33
- foreach ($emails as $email) {
34
- $_emails [] = array(
35
- 'email' => $email->address,
36
- 'created_at' => $email->created_at,
37
- 'enabled' => ($email->is_enabled === TRUE ? Mage::helper('monkey')->__('Yes') : Mage::helper('monkey')->__('No')),
38
- );
39
- }
40
- $collection = Mage::getModel('monkey/custom_collection', array($_emails));
41
- } else {
42
- $collection = Mage::getModel('monkey/custom_collection', array(array()));
43
- }
44
-
45
- $this->setCollection($collection);
46
- return parent::_prepareCollection();
47
- }
48
-
49
- protected function _prepareColumns()
50
- {
51
- $this->addColumn('email', array(
52
- 'header' => Mage::helper('monkey')->__('Email Address'),
53
- 'index' => 'email',
54
- 'filter' => false,
55
- 'sortable' => false
56
- ));
57
- $this->addColumn('enabled', array(
58
- 'header' => Mage::helper('monkey')->__('Enabled'),
59
- 'index' => 'enabled',
60
- 'filter' => false,
61
- 'sortable' => false
62
- ));
63
- $this->addColumn('created_at', array(
64
- 'header' => Mage::helper('monkey')->__('Created At'),
65
- 'index' => 'created_at',
66
- 'filter' => false,
67
- 'sortable' => false
68
- ));
69
-
70
- $this->addColumn('action',
71
- array(
72
- 'header' => Mage::helper('monkey')->__('Action'),
73
- 'width' => '50px',
74
- 'type' => 'action',
75
- 'getter' => 'getEmail',
76
- 'actions' => array(
77
- array(
78
- 'caption' => Mage::helper('monkey')->__('Disable'),
79
- 'confirm' => Mage::helper('monkey')->__('This action takes immediate effect, so use it with care.'),
80
- 'url' => array(
81
- 'base' => '*/*/mandrillDisable',
82
- 'params' => array('store' => $this->getRequest()->getParam('store')),
83
- ),
84
- 'field' => 'email'
85
- )
86
- ),
87
- 'filter' => false,
88
- 'sortable' => false,
89
- ));
90
-
91
- return parent::_prepareColumns();
92
- }
93
-
94
- public function getRowUrl($row)
95
- {
96
- return false;
97
- }
98
-
99
- public function getGridUrl()
100
- {
101
- return $this->getUrl('*/*/grid', array('_current' => true));
102
- }
103
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/Transactionalemail/Newemail.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Add valid email to Transactional email service
5
- *
6
- * @category Ebizmarts
7
- * @package Ebizmarts_MageMonkey
8
- * @author Ebizmarts Team <info@ebizmarts.com>
9
- * @license http://opensource.org/licenses/osl-3.0.php
10
- */
11
- class Ebizmarts_MageMonkey_Block_Adminhtml_Transactionalemail_Newemail extends Mage_Adminhtml_Block_Widget_Form_Container
12
- {
13
-
14
- public function __construct()
15
- {
16
- $this->_controller = 'adminhtml_transactionalemail';
17
- $this->_blockGroup = 'monkey';
18
- $this->_mode = 'newemail';
19
-
20
- parent::__construct();
21
-
22
- $this->_updateButton('save', 'label', Mage::helper('monkey')->__('Add'));
23
- }
24
-
25
- public function getHeaderText()
26
- {
27
- return Mage::helper('monkey')->__('Add valid email address');
28
- }
29
-
30
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/Transactionalemail/Newemail/Form.php DELETED
@@ -1,55 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Add new email to Transactional Email service FORM
5
- *
6
- * @category Ebizmarts
7
- * @package Ebizmarts_MageMonkey
8
- * @author Ebizmarts Team <info@ebizmarts.com>
9
- * @license http://opensource.org/licenses/osl-3.0.php
10
- */
11
- class Ebizmarts_MageMonkey_Block_Adminhtml_Transactionalemail_Newemail_Form extends Mage_Adminhtml_Block_Widget_Form
12
- {
13
-
14
- /**
15
- * Prepare form before rendering HTML
16
- *
17
- * @return Mage_Adminhtml_Block_Widget_Form
18
- */
19
- protected function _prepareForm()
20
- {
21
- $form = new Varien_Data_Form(array(
22
- 'id' => 'edit_form',
23
- 'action' => $this->getUrl('*/*/validateEmail'),
24
- 'method' => 'post'
25
- ));
26
-
27
- $fieldset = $form->addFieldset('newemail_data', array(
28
- 'legend' => Mage::helper('monkey')->__('New email')
29
- ));
30
-
31
- $fieldset->addField('email_address', 'text', array(
32
- 'label' => Mage::helper('monkey')->__('Email address'),
33
- 'title' => Mage::helper('monkey')->__('Email address'),
34
- 'name' => 'email_address',
35
- 'class' => 'validate-email',
36
- 'required' => true,
37
- ));
38
-
39
- $fieldset->addField('service', 'hidden', array(
40
- 'name' => 'service',
41
- 'value' => $this->getRequest()->getParam('service'),
42
- ));
43
- $fieldset->addField('store', 'hidden', array(
44
- 'name' => 'store',
45
- 'value' => $this->getRequest()->getParam('store', 0),
46
- ));
47
-
48
- $form->setUseContainer(true);
49
- $this->setForm($form);
50
-
51
- return parent::_prepareForm();
52
-
53
- }
54
-
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/Transactionalemail/Sts.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Transactional email STS grid container
5
- *
6
- * @category Ebizmarts
7
- * @package Ebizmarts_MageMonkey
8
- * @author Ebizmarts Team <info@ebizmarts.com>
9
- * @license http://opensource.org/licenses/osl-3.0.php
10
- */
11
- class Ebizmarts_MageMonkey_Block_Adminhtml_Transactionalemail_Sts extends Mage_Adminhtml_Block_Widget_Grid_Container
12
- {
13
-
14
- public function __construct()
15
- {
16
- $this->_controller = 'adminhtml_transactionalemail_sts';
17
- $this->_blockGroup = 'monkey';
18
- $this->_headerText = Mage::helper('monkey')->__('Verified Email Addresses');
19
-
20
- parent::__construct();
21
- }
22
-
23
- public function getGridHtml()
24
- {
25
- return $this->getChildHtml('store_switcher') . $this->getChildHtml('grid');
26
- }
27
-
28
- public function getCreateUrl()
29
- {
30
- return $this->getUrl('*/*/new', array('service' => 'sts', 'store' => $this->getRequest()->getParam('store', 0)));
31
- }
32
-
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/Transactionalemail/Sts/Grid.php DELETED
@@ -1,87 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Transactional email STS grid
5
- *
6
- * @category Ebizmarts
7
- * @package Ebizmarts_MageMonkey
8
- * @author Ebizmarts Team <info@ebizmarts.com>
9
- * @license http://opensource.org/licenses/osl-3.0.php
10
- */
11
- class Ebizmarts_MageMonkey_Block_Adminhtml_Transactionalemail_Sts_Grid extends Mage_Adminhtml_Block_Widget_Grid
12
- {
13
-
14
- public function __construct()
15
- {
16
- parent::__construct();
17
- $this->setId('sts_valid_emails');
18
- $this->setUseAjax(false);
19
- $this->setSaveParametersInSession(false);
20
- $this->setPagerVisibility(false);
21
- $this->setFilterVisibility(false);
22
- }
23
-
24
- protected function _prepareCollection()
25
- {
26
- $apiKey = Mage::helper('monkey')->getApiKey(0);
27
- $mail = Ebizmarts_MageMonkey_Model_TransactionalEmail_Adapter::factory('sts')
28
- ->setApiKey($apiKey);
29
- $emails = $mail->listVerifiedEmailAddresses();
30
-
31
- if ($emails !== FALSE) {
32
- $_emails = array();
33
- foreach ($emails->email_addresses as $email) {
34
- $_emails [] = array('email' => $email);
35
- }
36
- $collection = Mage::getModel('monkey/custom_collection', array($_emails));
37
- } else {
38
- $collection = Mage::getModel('monkey/custom_collection', array(array()));
39
- }
40
-
41
- $this->setCollection($collection);
42
- return parent::_prepareCollection();
43
- }
44
-
45
- protected function _prepareColumns()
46
- {
47
- $this->addColumn('email', array(
48
- 'header' => Mage::helper('monkey')->__('Email Address'),
49
- 'index' => 'email',
50
- 'filter' => false,
51
- 'sortable' => false
52
- ));
53
-
54
- $this->addColumn('action',
55
- array(
56
- 'header' => Mage::helper('monkey')->__('Action'),
57
- 'width' => '50px',
58
- 'type' => 'action',
59
- 'getter' => 'getEmail',
60
- 'actions' => array(
61
- array(
62
- 'caption' => Mage::helper('monkey')->__('Delete'),
63
- 'confirm' => Mage::helper('monkey')->__('This action takes immediate effect, so use it with care.'),
64
- 'url' => array(
65
- 'base' => '*/*/stsDelete',
66
- 'params' => array('store' => $this->getRequest()->getParam('store')),
67
- ),
68
- 'field' => 'email'
69
- )
70
- ),
71
- 'filter' => false,
72
- 'sortable' => false,
73
- ));
74
-
75
- return parent::_prepareColumns();
76
- }
77
-
78
- public function getRowUrl($row)
79
- {
80
- return false;
81
- }
82
-
83
- public function getGridUrl()
84
- {
85
- return $this->getUrl('*/*/grid', array('_current' => true));
86
- }
87
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Ebizmarts/MageMonkey/Block/Lists.php CHANGED
@@ -255,50 +255,7 @@ class Ebizmarts_MageMonkey_Block_Lists extends Mage_Core_Block_Template
255
  }
256
  }
257
  if (isset($groupings)) {
258
- foreach ($groupings as $_group) {
259
- if (!empty($_group['groups'])) {
260
- if ($fieldType == 'checkboxes') {
261
-
262
- $currentGroup = str_replace('\\,', '%C%', $_group['groups']);
263
- $currentGroupArray = explode(', ', $currentGroup);
264
-
265
- $myGroups[$_group['id']] = str_replace('%C%', ',', $currentGroupArray);
266
-
267
- } elseif ($fieldType == 'radio') {
268
-
269
- if (strpos($_group['groups'], ',')) {
270
- $currentGroup = str_replace('\\,', '%C%', $_group['groups']);
271
- $currentGroupArray = explode(', ', $currentGroup);
272
- $collapsed = str_replace('%C%', ',', $currentGroupArray);
273
-
274
- if (is_array($collapsed) && isset($collapsed[0])) {
275
- $myGroups[$_group['id']] = array($collapsed[0]);
276
- } else {
277
- $myGroups[$_group['id']] = array($collapsed);
278
- }
279
- } else {
280
- $myGroups[$_group['id']] = array($_group['groups']);
281
- }
282
-
283
- } else {
284
- if (strpos($_group['groups'], ',')) {
285
- $currentGroup = str_replace('\\,', '%C%', $_group['groups']);
286
- $currentGroupArray = explode(', ', $currentGroup);
287
- $collapsed = str_replace('%C%', ',', $currentGroupArray);
288
-
289
- if (is_array($collapsed) && isset($collapsed[0])) {
290
- $myGroups[$_group['id']] = array($collapsed[0]);
291
- } else {
292
- $myGroups[$_group['id']] = array($collapsed);
293
- }
294
- } else {
295
- $myGroups[$_group['id']] = array($_group['groups']);
296
- }
297
-
298
- }
299
-
300
- }
301
- }
302
  }
303
  }
304
  }
@@ -320,7 +277,80 @@ class Ebizmarts_MageMonkey_Block_Lists extends Mage_Core_Block_Template
320
  $class = 'Varien_Data_Form_Element_Text';
321
  break;
322
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
323
 
 
 
 
 
 
324
  $object = new $class;
325
  $object->setForm($this->getForm());
326
 
@@ -388,11 +418,55 @@ class Ebizmarts_MageMonkey_Block_Lists extends Mage_Core_Block_Template
388
  if ($fieldType != 'checkboxes') {
389
  $html = "<div class=\"groups-list\">{$html}</div>";
390
  }
391
-
392
  return $html;
393
-
394
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
395
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  /**
397
  * Return element id for group to be added to the post on checkout
398
  *
255
  }
256
  }
257
  if (isset($groupings)) {
258
+ $this->_setGrouping($groupings,$fieldType,$myGroups);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  }
260
  }
261
  }
277
  $class = 'Varien_Data_Form_Element_Text';
278
  break;
279
  }
280
+ $html = $this->_generateHtml($myGroups, $group, $checked, $list, $class, $fieldType);
281
+ // $object = new $class;
282
+ // $object->setForm($this->getForm());
283
+ //
284
+ // //Check/select values
285
+ // if (isset($myGroups[$group['id']]) && !$checked == 0 || $checked == 1) {
286
+ // $object->setValue($myGroups[$group['id']]);
287
+ // } else {
288
+ // $object->setValue(array());
289
+ // }
290
+ //
291
+ // if ($fieldType == 'checkboxes' || $fieldType == 'dropdown') {
292
+ //
293
+ // $options = array();
294
+ //
295
+ // if ($fieldType == 'dropdown') {
296
+ // $options[''] = '';
297
+ // }
298
+ //
299
+ // foreach ($group['groups'] as $g) {
300
+ // if ($this->helper('monkey')->config('list') == $list['id']) {
301
+ // if ($this->_groupAllowed($g['name'])) {
302
+ // $options [$g['name']] = $g['name'];
303
+ // }
304
+ // } else {
305
+ // $options [$g['name']] = $g['name'];
306
+ // }
307
+ // }
308
+ //
309
+ // if (method_exists('Varien_Data_Form_Element_Checkboxes', 'addElementValues')) {
310
+ // $object->addElementValues($options);
311
+ // } else {
312
+ // $object->setValues($options);
313
+ // }
314
+ //
315
+ // $object->setName($this->_htmlGroupName($list, $group, ($fieldType == 'checkboxes' ? TRUE : FALSE)));
316
+ // $object->setHtmlId('interest-group');
317
+ //
318
+ // $html = $object->getElementHtml();
319
+ //
320
+ // } elseif ($fieldType == 'radio' || $fieldType == 'hidden') {
321
+ //
322
+ // $options = array();
323
+ // foreach ($group['groups'] as $g) {
324
+ // if ($this->helper('monkey')->config('list') == $list['id']) {
325
+ // if ($this->_groupAllowed($g['name'])) {
326
+ // $options [] = new Varien_Object(array('value' => $g['name'], 'label' => $g['name']));
327
+ // }
328
+ // } else {
329
+ // $options [] = new Varien_Object(array('value' => $g['name'], 'label' => $g['name']));
330
+ // }
331
+ // }
332
+ //
333
+ // $object->setName($this->_htmlGroupName($list, $group));
334
+ // $object->setHtmlId('interest-group');
335
+ //
336
+ // if (method_exists('Varien_Data_Form_Element_Checkboxes', 'addElementValues')) {
337
+ // $object->addElementValues($options);
338
+ // } else {
339
+ // $object->setValues($options);
340
+ // }
341
+ //
342
+ // $html = $object->getElementHtml();
343
+ // }
344
+ //
345
+ // if ($fieldType != 'checkboxes') {
346
+ // $html = "<div class=\"groups-list\">{$html}</div>";
347
+ // }
348
 
349
+ return $html;
350
+
351
+ }
352
+ protected function _generateHtml($myGroups,$group,$checked,$list,$class,$fieldType)
353
+ {
354
  $object = new $class;
355
  $object->setForm($this->getForm());
356
 
418
  if ($fieldType != 'checkboxes') {
419
  $html = "<div class=\"groups-list\">{$html}</div>";
420
  }
 
421
  return $html;
 
422
  }
423
+ protected function _setGrouping($groupings,$fieldType,$myGroups)
424
+ {
425
+ foreach ($groupings as $_group) {
426
+ if (!empty($_group['groups'])) {
427
+ if ($fieldType == 'checkboxes') {
428
+
429
+ $currentGroup = str_replace('\\,', '%C%', $_group['groups']);
430
+ $currentGroupArray = explode(', ', $currentGroup);
431
+
432
+ $myGroups[$_group['id']] = str_replace('%C%', ',', $currentGroupArray);
433
+
434
+ } elseif ($fieldType == 'radio') {
435
+
436
+ if (strpos($_group['groups'], ',')) {
437
+ $currentGroup = str_replace('\\,', '%C%', $_group['groups']);
438
+ $currentGroupArray = explode(', ', $currentGroup);
439
+ $collapsed = str_replace('%C%', ',', $currentGroupArray);
440
 
441
+ if (is_array($collapsed) && isset($collapsed[0])) {
442
+ $myGroups[$_group['id']] = array($collapsed[0]);
443
+ } else {
444
+ $myGroups[$_group['id']] = array($collapsed);
445
+ }
446
+ } else {
447
+ $myGroups[$_group['id']] = array($_group['groups']);
448
+ }
449
+
450
+ } else {
451
+ if (strpos($_group['groups'], ',')) {
452
+ $currentGroup = str_replace('\\,', '%C%', $_group['groups']);
453
+ $currentGroupArray = explode(', ', $currentGroup);
454
+ $collapsed = str_replace('%C%', ',', $currentGroupArray);
455
+
456
+ if (is_array($collapsed) && isset($collapsed[0])) {
457
+ $myGroups[$_group['id']] = array($collapsed[0]);
458
+ } else {
459
+ $myGroups[$_group['id']] = array($collapsed);
460
+ }
461
+ } else {
462
+ $myGroups[$_group['id']] = array($_group['groups']);
463
+ }
464
+
465
+ }
466
+
467
+ }
468
+ }
469
+ }
470
  /**
471
  * Return element id for group to be added to the post on checkout
472
  *
app/code/community/Ebizmarts/MageMonkey/Helper/Data.php CHANGED
@@ -232,7 +232,7 @@ class Ebizmarts_MageMonkey_Helper_Data extends Mage_Core_Helper_Abstract
232
  $member = Mage::getSingleton('monkey/api')
233
  ->listMemberInfo($listId, $email);
234
 
235
- if (!is_string($member) && $member['success'] && ($member['data'][0]['status'] == 'subscribed' || $member['data'][0]['status'] == 'pending')) {
236
  $on = TRUE;
237
  }
238
  }
@@ -412,7 +412,70 @@ class Ebizmarts_MageMonkey_Helper_Data extends Mage_Core_Helper_Abstract
412
  ->toArray());
413
  }
414
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
  foreach ($maps as $map) {
 
416
 
417
  $customAtt = $map['magento'];
418
  $chimpTag = $map['mailchimp'];
@@ -438,36 +501,7 @@ class Ebizmarts_MageMonkey_Helper_Data extends Mage_Core_Helper_Abstract
438
  break;
439
  case 'billing_address':
440
  case 'shipping_address':
441
-
442
- $addr = explode('_', $customAtt);
443
- $address = $customer->{'getPrimary' . ucfirst($addr[0]) . 'Address'}();
444
- if (!$address) {
445
- if ($customer->{'getDefault' . ucfirst($addr[0])}()) {
446
- $address = Mage::getModel('customer/address')->load($customer->{'getDefault' . ucfirst($addr[0])}());
447
- }
448
- }
449
- if ($address) {
450
- $merge_vars[$key] = array(
451
- 'addr1' => $address->getStreet(1),
452
- 'addr2' => $address->getStreet(2),
453
- 'city' => $address->getCity(),
454
- 'state' => (!$address->getRegion() ? $address->getCity() : $address->getRegion()),
455
- 'zip' => $address->getPostcode(),
456
- 'country' => $address->getCountryId()
457
- );
458
- $telephone = $address->getTelephone();
459
- if ($telephone) {
460
- $merge_vars['TELEPHONE'] = $telephone;
461
- }
462
- $company = $address->getCompany();
463
- if ($company) {
464
- $merge_vars['COMPANY'] = $company;
465
- }
466
- $country = $address->getCountryId();
467
- if ($country) {
468
- $merge_vars['COUNTRY'] = $country;
469
- }
470
- }
471
 
472
  break;
473
  case 'date_of_purchase':
@@ -528,66 +562,39 @@ class Ebizmarts_MageMonkey_Helper_Data extends Mage_Core_Helper_Abstract
528
 
529
  }
530
  }
531
-
532
- //GUEST
533
- if (!$customer->getId() && !$request->getPost('firstname')) {
534
- $guestFirstName = $this->config('guest_name', $customer->getStoreId());
535
-
536
- if ($guestFirstName) {
537
- $merge_vars['FNAME'] = $guestFirstName;
 
538
  }
539
  }
540
- if (!$customer->getId() && !$request->getPost('lastname')) {
541
- $guestLastName = $this->config('guest_lastname', $customer->getStoreId());
542
-
543
- if ($guestLastName) {
544
- $merge_vars['LNAME'] = $guestLastName;
 
 
 
 
 
 
 
545
  }
546
- }
547
- //GUEST
548
-
549
- if ($includeEmail) {
550
- $merge_vars['EMAIL'] = $customer->getEmail();
551
- }
552
-
553
- $groups = $customer->getListGroups();
554
- $groupings = array();
555
-
556
- if (is_array($groups) && count($groups)) {
557
- foreach ($groups as $groupId => $grupoptions) {
558
- if (is_array($grupoptions)) {
559
- $grupOptionsEscaped = array();
560
- foreach ($grupoptions as $gopt) {
561
- $gopt = str_replace(",", "%C%", $gopt);
562
- $grupOptionsEscaped[] = $gopt;
563
- }
564
- $groupings[] = array(
565
- 'id' => $groupId,
566
- 'groups' => str_replace('%C%', '\\,', implode(', ', $grupOptionsEscaped))
567
- );
568
- } else {
569
- $groupings[] = array(
570
- 'id' => $groupId,
571
- 'groups' => str_replace(',', '\\,', $grupoptions)
572
- );
573
- }
574
  }
575
  }
576
-
577
- $merge_vars['GROUPINGS'] = $groupings;
578
-
579
- //magemonkey_mergevars_after
580
- $blank = new Varien_Object;
581
- Mage::dispatchEvent('magemonkey_mergevars_after',
582
- array('vars' => $merge_vars, 'customer' => $customer, 'newvars' => $blank));
583
- if ($blank->hasData()) {
584
- $merge_vars = array_merge($merge_vars, $blank->toArray());
585
- }
586
- //magemonkey_mergevars_after
587
-
588
- return $merge_vars;
589
  }
590
-
591
  /**
592
  * Get Mergevars
593
  *
@@ -638,6 +645,14 @@ class Ebizmarts_MageMonkey_Helper_Data extends Mage_Core_Helper_Abstract
638
  $post = unserialize($monkeyPost);
639
  }
640
  //if post exists && is not admin backend subscription && not footer subscription
 
 
 
 
 
 
 
 
641
  $adminSubscription = $request->getActionName() == 'save' && $request->getControllerName() == 'customer' && $request->getModuleName() == (string)Mage::getConfig()->getNode('admin/routers/adminhtml/args/frontName');
642
  $footerSubscription = $request->getActionName() == 'new' && $request->getControllerName() == 'subscriber' && $request->getModuleName() == 'newsletter';
643
  $customerSubscription = $request->getActionName() == 'saveadditional';
@@ -682,39 +697,36 @@ class Ebizmarts_MageMonkey_Helper_Data extends Mage_Core_Helper_Abstract
682
  }
683
 
684
  }
685
- }
686
- if (isset($subscribeGroups[0]['id']) && $subscribeGroups[0]['id'] != -1) {
687
- $mergeVars["GROUPINGS"] = $subscribeGroups;
688
- }
689
-
690
- $force = Mage::getStoreConfig('monkey/general/checkout_subscribe', $object->getStoreId());
691
- $map = Mage::getStoreConfig('monkey/general/markfield', $object->getStoreId());
692
- if (isset($post['magemonkey_subscribe']) && $map != "") {
693
- $listsChecked = explode(',', $post['magemonkey_subscribe']);
694
- $hasClicked = in_array($currentList, $listsChecked);
695
- if ($hasClicked && $force != 3) {
696
- $mergeVars[$map] = "Yes";
697
- } else {
698
- $mergeVars[$map] = "No";
699
  }
700
- } elseif (Mage::getSingleton('core/session')->getIsOneStepCheckout()) {
701
- $post2 = $request->getPost();
702
- if (isset($post['subscribe_newsletter']) || isset($post2['subscribe_newsletter'])) {
703
- $mergeVars[$map] = "Yes";
704
- } elseif (Mage::helper('monkey')->config('checkout_subscribe') > 2) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
705
  $mergeVars[$map] = "No";
706
  }
707
- } elseif ($request->getModuleName() == 'checkout') {
708
- $mergeVars[$map] = "No";
 
709
  }
710
- } else {
711
- $map = Mage::getStoreConfig('monkey/general/markfield', $object->getStoreId());
712
- $mergeVars[$map] = "Yes";
713
  }
714
-
715
- return $mergeVars;
716
  }
717
-
718
  /**
719
  * Register on Magento's registry GUEST customer data for MergeVars for on checkout subscribe
720
  *
@@ -812,7 +824,7 @@ class Ebizmarts_MageMonkey_Helper_Data extends Mage_Core_Helper_Abstract
812
  protected function _McAddressToMage(array $data, $type, $customer)
813
  {
814
  $addressData = $data["{$type}_address"];
815
- $address = explode(str_repeat(chr(32), 2), $addressData);
816
  list($addr1, $addr2, $city, $state, $zip, $country) = $address;
817
 
818
  $region = Mage::getModel('directory/region')->loadByName($state, $country);
@@ -928,7 +940,7 @@ class Ebizmarts_MageMonkey_Helper_Data extends Mage_Core_Helper_Abstract
928
  if (count($alreadyOnList) == 0) {
929
  $isConfirmNeed = FALSE;
930
  if (!Mage::helper('monkey')->isAdmin() &&
931
- (Mage::getStoreConfig(Mage_Newsletter_Model_Subscriber::XML_PATH_CONFIRMATION_FLAG, $object->getStoreId()) == 1 && !$forceSubscribe)
932
  ) {
933
  $isConfirmNeed = TRUE;
934
  }
@@ -993,7 +1005,28 @@ class Ebizmarts_MageMonkey_Helper_Data extends Mage_Core_Helper_Abstract
993
  {
994
  //<state> param is an html serialized field containing the default form state
995
  //before submission, we need to parse it as a request in order to save it to $odata and process it
996
- parse_str($request->getPost('state'), $odata);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
997
  $curlists = (TRUE === array_key_exists('list', $odata)) ? $odata['list'] : array();
998
  $lists = $request->getPost('list', array());
999
 
@@ -1030,7 +1063,7 @@ class Ebizmarts_MageMonkey_Helper_Data extends Mage_Core_Helper_Abstract
1030
  ->addFieldToFilter('email', $email)
1031
  ->addFieldToFilter('processed', 0);
1032
 
1033
- if (count($alreadyOnDb) > 0) {
1034
  foreach ($alreadyOnDb as $listToDelete) {
1035
  $toDelete = Mage::getModel('monkey/asyncsubscribers')->load($listToDelete->getId());
1036
  $toDelete->delete();
@@ -1087,13 +1120,11 @@ class Ebizmarts_MageMonkey_Helper_Data extends Mage_Core_Helper_Abstract
1087
  $subscriber->setListGroups($groupings);
1088
  $subscriber->setMcListId($listId);
1089
  $subscriber->setMcStoreId(Mage::app()->getStore()->getId());
1090
- $subscriber->setImportMode(TRUE);
1091
  $subscriber->subscribe($email);
1092
  } else {
1093
  $customer->setListGroups($groupings);
1094
  $customer->setMcListId($listId);
1095
  $subscriber = Mage::getModel('newsletter/subscriber')
1096
- ->setImportMode(TRUE)
1097
  ->setSubscriberEmail($email);
1098
  $this->subscribeToList($subscriber, 0, $listId);
1099
 
232
  $member = Mage::getSingleton('monkey/api')
233
  ->listMemberInfo($listId, $email);
234
 
235
+ if (!is_string($member) && $member['success'] && ($member['data'][0]['status'] == 'subscribed' )) {
236
  $on = TRUE;
237
  }
238
  }
412
  ->toArray());
413
  }
414
 
415
+ $this->_setMaps($maps,$customer,$merge_vars, $websiteId);
416
+
417
+ //GUEST
418
+ if (!$customer->getId() && !$request->getPost('firstname')) {
419
+ $guestFirstName = $this->config('guest_name', $customer->getStoreId());
420
+
421
+ if ($guestFirstName) {
422
+ $merge_vars['FNAME'] = $guestFirstName;
423
+ }
424
+ }
425
+ if (!$customer->getId() && !$request->getPost('lastname')) {
426
+ $guestLastName = $this->config('guest_lastname', $customer->getStoreId());
427
+
428
+ if ($guestLastName) {
429
+ $merge_vars['LNAME'] = $guestLastName;
430
+ }
431
+ }
432
+ //GUEST
433
+
434
+ if ($includeEmail) {
435
+ $merge_vars['EMAIL'] = $customer->getEmail();
436
+ }
437
+
438
+ $groups = $customer->getListGroups();
439
+ $groupings = array();
440
+
441
+ if (is_array($groups) && count($groups)) {
442
+ foreach ($groups as $groupId => $grupoptions) {
443
+ if (is_array($grupoptions)) {
444
+ $grupOptionsEscaped = array();
445
+ foreach ($grupoptions as $gopt) {
446
+ $gopt = str_replace(",", "%C%", $gopt);
447
+ $grupOptionsEscaped[] = $gopt;
448
+ }
449
+ $groupings[] = array(
450
+ 'id' => $groupId,
451
+ 'groups' => str_replace('%C%', '\\,', implode(', ', $grupOptionsEscaped))
452
+ );
453
+ } else {
454
+ $groupings[] = array(
455
+ 'id' => $groupId,
456
+ 'groups' => str_replace(',', '\\,', $grupoptions)
457
+ );
458
+ }
459
+ }
460
+ }
461
+
462
+ $merge_vars['GROUPINGS'] = $groupings;
463
+
464
+ //magemonkey_mergevars_after
465
+ $blank = new Varien_Object;
466
+ Mage::dispatchEvent('magemonkey_mergevars_after',
467
+ array('vars' => $merge_vars, 'customer' => $customer, 'newvars' => $blank));
468
+ if ($blank->hasData()) {
469
+ $merge_vars = array_merge($merge_vars, $blank->toArray());
470
+ }
471
+ //magemonkey_mergevars_after
472
+
473
+ return $merge_vars;
474
+ }
475
+ private function _setMaps($maps,$customer,$merge_vars, $websiteId)
476
+ {
477
  foreach ($maps as $map) {
478
+ $request = Mage::app()->getRequest();
479
 
480
  $customAtt = $map['magento'];
481
  $chimpTag = $map['mailchimp'];
501
  break;
502
  case 'billing_address':
503
  case 'shipping_address':
504
+ $this->_setAddress($customAtt,$merge_vars, $customer, $key);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
505
 
506
  break;
507
  case 'date_of_purchase':
562
 
563
  }
564
  }
565
+ }
566
+ protected function _setAddress($customAtt,$merge_vars, $customer, $key)
567
+ {
568
+ $addr = explode('_', $customAtt);
569
+ $address = $customer->{'getPrimary' . ucfirst($addr[0]) . 'Address'}();
570
+ if (!$address) {
571
+ if ($customer->{'getDefault' . ucfirst($addr[0])}()) {
572
+ $address = Mage::getModel('customer/address')->load($customer->{'getDefault' . ucfirst($addr[0])}());
573
  }
574
  }
575
+ if ($address) {
576
+ $merge_vars[$key] = array(
577
+ 'addr1' => $address->getStreet(1),
578
+ 'addr2' => $address->getStreet(2),
579
+ 'city' => $address->getCity(),
580
+ 'state' => (!$address->getRegion() ? $address->getCity() : $address->getRegion()),
581
+ 'zip' => $address->getPostcode(),
582
+ 'country' => $address->getCountryId()
583
+ );
584
+ $telephone = $address->getTelephone();
585
+ if ($telephone) {
586
+ $merge_vars['TELEPHONE'] = $telephone;
587
  }
588
+ $company = $address->getCompany();
589
+ if ($company) {
590
+ $merge_vars['COMPANY'] = $company;
591
+ }
592
+ $country = $address->getCountryId();
593
+ if ($country) {
594
+ $merge_vars['COUNTRY'] = $country;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
595
  }
596
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
597
  }
 
598
  /**
599
  * Get Mergevars
600
  *
645
  $post = unserialize($monkeyPost);
646
  }
647
  //if post exists && is not admin backend subscription && not footer subscription
648
+ $this->_checkGrouping($mergeVars,$post,$currentList, $object);
649
+
650
+
651
+ return $mergeVars;
652
+ }
653
+ private function _checkGrouping($merge_vars,$post,$currentList, $object)
654
+ {
655
+ $request = Mage::app()->getRequest();
656
  $adminSubscription = $request->getActionName() == 'save' && $request->getControllerName() == 'customer' && $request->getModuleName() == (string)Mage::getConfig()->getNode('admin/routers/adminhtml/args/frontName');
657
  $footerSubscription = $request->getActionName() == 'new' && $request->getControllerName() == 'subscriber' && $request->getModuleName() == 'newsletter';
658
  $customerSubscription = $request->getActionName() == 'saveadditional';
697
  }
698
 
699
  }
700
+ if (isset($subscribeGroups[0]['id']) && $subscribeGroups[0]['id'] != -1) {
701
+ $mergeVars["GROUPINGS"] = $subscribeGroups;
 
 
 
 
 
 
 
 
 
 
 
 
702
  }
703
+
704
+ $force = Mage::getStoreConfig('monkey/general/checkout_subscribe', $object->getStoreId());
705
+ $map = Mage::getStoreConfig('monkey/general/markfield', $object->getStoreId());
706
+ if (isset($post['magemonkey_subscribe']) && $map != "") {
707
+ $listsChecked = explode(',', $post['magemonkey_subscribe']);
708
+ $hasClicked = in_array($currentList, $listsChecked);
709
+ if ($hasClicked && $force != 3) {
710
+ $mergeVars[$map] = "Yes";
711
+ } else {
712
+ $mergeVars[$map] = "No";
713
+ }
714
+ } elseif (Mage::getSingleton('core/session')->getIsOneStepCheckout()) {
715
+ $post2 = $request->getPost();
716
+ if (isset($post['subscribe_newsletter']) || isset($post2['subscribe_newsletter'])) {
717
+ $mergeVars[$map] = "Yes";
718
+ } elseif (Mage::helper('monkey')->config('checkout_subscribe') > 2) {
719
+ $mergeVars[$map] = "No";
720
+ }
721
+ } elseif ($request->getModuleName() == 'checkout') {
722
  $mergeVars[$map] = "No";
723
  }
724
+ } else {
725
+ $map = Mage::getStoreConfig('monkey/general/markfield', $object->getStoreId());
726
+ $mergeVars[$map] = "Yes";
727
  }
 
 
 
728
  }
 
 
729
  }
 
730
  /**
731
  * Register on Magento's registry GUEST customer data for MergeVars for on checkout subscribe
732
  *
824
  protected function _McAddressToMage(array $data, $type, $customer)
825
  {
826
  $addressData = $data["{$type}_address"];
827
+ $address = explode(str_repeat(' ', 2), $addressData);
828
  list($addr1, $addr2, $city, $state, $zip, $country) = $address;
829
 
830
  $region = Mage::getModel('directory/region')->loadByName($state, $country);
940
  if (count($alreadyOnList) == 0) {
941
  $isConfirmNeed = FALSE;
942
  if (!Mage::helper('monkey')->isAdmin() &&
943
+ (Mage::getStoreConfig(Mage_Newsletter_Model_Subscriber::XML_PATH_CONFIRMATION_FLAG, $object->getStoreId()) == 1 && !$forceSubscribe && !Mage::getStoreConfig(Ebizmarts_MageMonkey_Model_Config::GENERAL_CONFIRMATION_EMAIL, $object->getStoreId()))
944
  ) {
945
  $isConfirmNeed = TRUE;
946
  }
1005
  {
1006
  //<state> param is an html serialized field containing the default form state
1007
  //before submission, we need to parse it as a request in order to save it to $odata and process it
1008
+ // parse_str($request->getPost('state'), $odata);
1009
+ $m = explode('&',$request->getPost('state'));
1010
+ $odata = array();
1011
+ $list = array();
1012
+ foreach($m as $v) {
1013
+
1014
+ $g = explode('=',$v);
1015
+ $u = explode('%5B',$v);
1016
+ if($u[0] == 'list') {
1017
+ $suffixListId = $u[1];
1018
+ $listId = substr($u[1], 0, (strlen($suffixListId)-3));
1019
+ $list[$listId] = array();
1020
+ $listIdArray = $list[$listId];
1021
+ $tail = explode('%5D',$u[2]);
1022
+ $subscribed = $tail[0];
1023
+ $listIdArray[$subscribed] = $g[1];
1024
+ $list[$listId] = $listIdArray;
1025
+ $odata['list'] = $list;
1026
+ }else {
1027
+ $odata[$g[0]] = $g[1];
1028
+ }
1029
+ }
1030
  $curlists = (TRUE === array_key_exists('list', $odata)) ? $odata['list'] : array();
1031
  $lists = $request->getPost('list', array());
1032
 
1063
  ->addFieldToFilter('email', $email)
1064
  ->addFieldToFilter('processed', 0);
1065
 
1066
+ if(count($alreadyOnDb) > 0) {
1067
  foreach ($alreadyOnDb as $listToDelete) {
1068
  $toDelete = Mage::getModel('monkey/asyncsubscribers')->load($listToDelete->getId());
1069
  $toDelete->delete();
1120
  $subscriber->setListGroups($groupings);
1121
  $subscriber->setMcListId($listId);
1122
  $subscriber->setMcStoreId(Mage::app()->getStore()->getId());
 
1123
  $subscriber->subscribe($email);
1124
  } else {
1125
  $customer->setListGroups($groupings);
1126
  $customer->setMcListId($listId);
1127
  $subscriber = Mage::getModel('newsletter/subscriber')
 
1128
  ->setSubscriberEmail($email);
1129
  $this->subscribeToList($subscriber, 0, $listId);
1130
 
app/code/community/Ebizmarts/MageMonkey/Model/Cron.php CHANGED
@@ -266,7 +266,7 @@ class Ebizmarts_MageMonkey_Model_Cron
266
 
267
  $processedCount = 0;
268
  foreach ($collection as $item) {
269
- $processedCount += 1;
270
  $isOnMailChimp = Mage::helper('monkey')->subscribedToList($item->getEmail(), $listId);
271
  if ($isOnMailChimp) {
272
  $api->listUpdateMember($listId, $item->getEmail(), $this->_helper()->getMergeVars($item));
@@ -292,24 +292,6 @@ class Ebizmarts_MageMonkey_Model_Cron
292
  ->setUpdatedAt($this->_dbDate())
293
  ->save();
294
 
295
- } else {
296
-
297
- //TODO: Do something to handle errors
298
-
299
- /*echo "Batch Subscribe failed!\n";
300
- echo "code:".$api->errorCode."\n";
301
- echo "msg :".$api->errorMessage."\n";
302
- die;*/
303
- /*echo "added: ".$vals['add_count']."\n";
304
- echo "updated: ".$vals['update_count']."\n";
305
- echo "errors: ".$vals['error_count']."\n";
306
- foreach($vals['errors'] as $val){
307
- echo $val['email_address']. " failed\n";
308
- echo "code:".$val['code']."\n";
309
- echo "msg :".$val['message']."\n";
310
- }
311
- die;*/
312
-
313
  }
314
 
315
  } else {
266
 
267
  $processedCount = 0;
268
  foreach ($collection as $item) {
269
+ $processedCount++;
270
  $isOnMailChimp = Mage::helper('monkey')->subscribedToList($item->getEmail(), $listId);
271
  if ($isOnMailChimp) {
272
  $api->listUpdateMember($listId, $item->getEmail(), $this->_helper()->getMergeVars($item));
292
  ->setUpdatedAt($this->_dbDate())
293
  ->save();
294
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  }
296
 
297
  } else {
app/code/community/Ebizmarts/MageMonkey/Model/MCAPI.php CHANGED
@@ -8,6 +8,9 @@
8
  * @author Ebizmarts Team <info@ebizmarts.com>
9
  * @license http://opensource.org/licenses/osl-3.0.php
10
  */
 
 
 
11
  class Ebizmarts_MageMonkey_Model_MCAPI
12
  {
13
  var $version = "1.3";
@@ -2590,3 +2593,4 @@ class Ebizmarts_MageMonkey_Model_MCAPI
2590
  }
2591
 
2592
  }
 
8
  * @author Ebizmarts Team <info@ebizmarts.com>
9
  * @license http://opensource.org/licenses/osl-3.0.php
10
  */
11
+
12
+ // @codingStandardsIgnoreStart
13
+
14
  class Ebizmarts_MageMonkey_Model_MCAPI
15
  {
16
  var $version = "1.3";
2593
  }
2594
 
2595
  }
2596
+ // @codingStandardsIgnoreEnd
app/code/community/Ebizmarts/MageMonkey/Model/MCEXPORTAPI.php CHANGED
@@ -8,6 +8,9 @@
8
  * @author Ebizmarts Team <info@ebizmarts.com>
9
  * @license http://opensource.org/licenses/osl-3.0.php
10
  */
 
 
 
11
  class Ebizmarts_MageMonkey_Model_MCEXPORTAPI extends Ebizmarts_MageMonkey_Model_MCAPI
12
  {
13
  var $version = "1.0";
@@ -21,7 +24,7 @@ class Ebizmarts_MageMonkey_Model_MCEXPORTAPI extends Ebizmarts_MageMonkey_Model_
21
  function __construct($apikey, $secure = false)
22
  {
23
  $this->secure = $secure;
24
- $this->apiUrl = parse_url("http://api.mailchimp.com/export/" . $this->version . "/");
25
  $this->api_key = $apikey;
26
  }
27
 
@@ -129,4 +132,5 @@ class Ebizmarts_MageMonkey_Model_MCEXPORTAPI extends Ebizmarts_MageMonkey_Model_
129
  return $response;
130
  }
131
 
132
- }
 
8
  * @author Ebizmarts Team <info@ebizmarts.com>
9
  * @license http://opensource.org/licenses/osl-3.0.php
10
  */
11
+
12
+ // @codingStandardsIgnoreStart
13
+
14
  class Ebizmarts_MageMonkey_Model_MCEXPORTAPI extends Ebizmarts_MageMonkey_Model_MCAPI
15
  {
16
  var $version = "1.0";
24
  function __construct($apikey, $secure = false)
25
  {
26
  $this->secure = $secure;
27
+ $this->apiUrl = Mage::getSingleton('core/url')->parseUrl("http://api.mailchimp.com/export/" . $this->version . "/" ); //parse_url("http://api.mailchimp.com/export/" . $this->version . "/");
28
  $this->api_key = $apikey;
29
  }
30
 
132
  return $response;
133
  }
134
 
135
+ }
136
+ // @codingStandardsIgnoreEnd
app/code/community/Ebizmarts/MageMonkey/Model/Monkey.php CHANGED
@@ -232,19 +232,6 @@ class Ebizmarts_MageMonkey_Model_Monkey
232
  $toUpdate = $subscriber;
233
  }
234
 
235
- $this->_mapFieldsToMagento($data, $toUpdate, $storeId);
236
-
237
- }
238
-
239
- protected function _mapFieldsToMagento($data, $toUpdate, $storeId)
240
- {
241
- $mapMerges = Mage::getStoreConfig(Ebizmarts_MageMonkey_Model_Config::GENERAL_MAP_FIELDS, $storeId);
242
-
243
- foreach ($data['merges'] as $merge) {
244
- if (in_array($merge, $mapMerges['mailchimp'])) {
245
-
246
- }
247
- }
248
 
249
  }
250
 
232
  $toUpdate = $subscriber;
233
  }
234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
 
236
  }
237
 
app/code/community/Ebizmarts/MageMonkey/Model/Observer.php CHANGED
@@ -32,7 +32,7 @@ class Ebizmarts_MageMonkey_Model_Observer
32
  Mage::getSingleton('monkey/api')->listUnsubscribe($defaultList, $subscriber->getSubscriberEmail());
33
  }
34
  if (!Mage::helper('monkey')->isAdmin() &&
35
- (Mage::getStoreConfig(Mage_Newsletter_Model_Subscriber::XML_PATH_CONFIRMATION_FLAG, $subscriber->getStoreId()) == 1 && Mage::helper('monkey')->subscribedToList($defaultList, $subscriber->getSubscriberEmail()))
36
  ) {
37
  $subscriber->setStatus(Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED);
38
  } elseif (Mage::helper('monkey')->isAdmin() && $subscriber->getOrigData('subscriber_status') == Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED && $subscriber->getStatus() != Mage_Newsletter_Model_Subscriber::STATUS_UNSUBSCRIBED) {
@@ -139,7 +139,7 @@ class Ebizmarts_MageMonkey_Model_Observer
139
  $request = Mage::app()->getRequest();
140
 
141
  if (!Mage::getStoreConfig(Ebizmarts_MageMonkey_Model_Config::GENERAL_ACTIVE, $store)) {
142
- $config = new Mage_Core_Model_Config();
143
  $config->saveConfig(Ebizmarts_MageMonkey_Model_Config::ECOMMERCE360_ACTIVE, false, $scope, $store);
144
  Mage::getConfig()->cleanCache();
145
  }
@@ -217,6 +217,66 @@ class Ebizmarts_MageMonkey_Model_Observer
217
 
218
  $lists = $api->lists();
219
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  foreach ($lists['data'] as $list) {
221
 
222
  if (in_array($list['id'], $selectedLists)) {
@@ -272,9 +332,7 @@ class Ebizmarts_MageMonkey_Model_Observer
272
  }
273
 
274
  }
275
-
276
  }
277
-
278
  /**
279
  * Update customer after_save event observer
280
  *
32
  Mage::getSingleton('monkey/api')->listUnsubscribe($defaultList, $subscriber->getSubscriberEmail());
33
  }
34
  if (!Mage::helper('monkey')->isAdmin() &&
35
+ (Mage::getStoreConfig(Mage_Newsletter_Model_Subscriber::XML_PATH_CONFIRMATION_FLAG, $subscriber->getStoreId()) == 1 && Mage::helper('monkey')->subscribedToList($subscriber->getSubscriberEmail(), $defaultList))
36
  ) {
37
  $subscriber->setStatus(Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED);
38
  } elseif (Mage::helper('monkey')->isAdmin() && $subscriber->getOrigData('subscriber_status') == Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED && $subscriber->getStatus() != Mage_Newsletter_Model_Subscriber::STATUS_UNSUBSCRIBED) {
139
  $request = Mage::app()->getRequest();
140
 
141
  if (!Mage::getStoreConfig(Ebizmarts_MageMonkey_Model_Config::GENERAL_ACTIVE, $store)) {
142
+ $config = Mage::getModel('core/config');
143
  $config->saveConfig(Ebizmarts_MageMonkey_Model_Config::ECOMMERCE360_ACTIVE, false, $scope, $store);
144
  Mage::getConfig()->cleanCache();
145
  }
217
 
218
  $lists = $api->lists();
219
 
220
+ $this->_saveCustomerGroups($lists,$api,$selectedLists,$hookUrl);
221
+ // foreach ($lists['data'] as $list) {
222
+ //
223
+ // if (in_array($list['id'], $selectedLists)) {
224
+ //
225
+ // /**
226
+ // * Customer Group - Interest Grouping
227
+ // */
228
+ // $magentoGroups = Mage::helper('customer')->getGroups()->toOptionHash();
229
+ // array_push($magentoGroups, "NOT LOGGED IN");
230
+ // $customerGroup = array('field_type' => 'dropdown', 'choices' => $magentoGroups);
231
+ // $mergeVars = $api->listMergeVars($list['id']);
232
+ // $mergeExist = false;
233
+ // foreach ($mergeVars as $vars) {
234
+ // if ($vars['tag'] == 'CGROUP') {
235
+ // $mergeExist = true;
236
+ // if ($magentoGroups === $vars['choices']) {
237
+ // $update = false;
238
+ // } else {
239
+ // $update = true;
240
+ // }
241
+ // }
242
+ // }
243
+ // if ($mergeExist) {
244
+ // if ($update) {
245
+ // $newValue = array('choices' => $magentoGroups);
246
+ // $api->listMergeVarUpdate($list['id'], 'CGROUP', $newValue);
247
+ // }
248
+ // } else {
249
+ // $api->listMergeVarAdd($list['id'], 'CGROUP', 'Customer Groups', $customerGroup);
250
+ // }
251
+ // /**
252
+ // * Customer Group - Interest Grouping
253
+ // */
254
+ //
255
+ // /**
256
+ // * Adding Webhooks
257
+ // */
258
+ // $api->listWebhookAdd($list['id'], $hookUrl);
259
+ //
260
+ // //If webhook was not added, add a message on Admin panel
261
+ // if ($api->errorCode && Mage::helper('monkey')->isAdmin()) {
262
+ //
263
+ // //Don't show an error if webhook already in, otherwise, show error message and code
264
+ // if ($api->errorMessage !== "Setting up multiple WebHooks for one URL is not allowed.") {
265
+ // $message = Mage::helper('monkey')->__('Could not add Webhook "%s" for list "%s", error code %s, %s', $hookUrl, $list['name'], $api->errorCode, $api->errorMessage);
266
+ // Mage::getSingleton('adminhtml/session')->addError($message);
267
+ // }
268
+ //
269
+ // }
270
+ // /**
271
+ // * Adding Webhooks
272
+ // */
273
+ // }
274
+ //
275
+ // }
276
+
277
+ }
278
+ protected function _saveCustomerGroups($lists,$api,$selectedLists,$hookUrl)
279
+ {
280
  foreach ($lists['data'] as $list) {
281
 
282
  if (in_array($list['id'], $selectedLists)) {
332
  }
333
 
334
  }
 
335
  }
 
336
  /**
337
  * Update customer after_save event observer
338
  *
app/code/community/Ebizmarts/MageMonkey/Model/TransactionalEmail/Adapter.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Transactional Email Adapter
5
- *
6
- * @category Ebizmarts
7
- * @package Ebizmarts_MageMonkey
8
- * @author Ebizmarts Team <info@ebizmarts.com>
9
- * @license http://opensource.org/licenses/osl-3.0.php
10
- */
11
- class Ebizmarts_MageMonkey_Model_TransactionalEmail_Adapter
12
- {
13
- const ADAPTER_STS = 'sts';
14
- const ADAPTER_MANDRILL = 'mandrill';
15
-
16
- public static function factory($adapter)
17
- {
18
- switch ($adapter) {
19
- case self::ADAPTER_STS:
20
- return new Ebizmarts_MageMonkey_Model_TransactionalEmail_STS();
21
- break;
22
- case self::ADAPTER_MANDRILL:
23
- return new Ebizmarts_MageMonkey_Model_TransactionalEmail_MANDRILL();
24
- break;
25
- default:
26
- throw new Exception('Invalid Transactional Email service selected.');
27
- break;
28
- }
29
- }
30
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Ebizmarts/MageMonkey/Model/TransactionalEmail/MANDRILL.php DELETED
@@ -1,355 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * MailChimp MANDRILL API wrapper
5
- *
6
- * @category Ebizmarts
7
- * @package Ebizmarts_MageMonkey
8
- * @author Ebizmarts Team <info@ebizmarts.com>
9
- * @license http://opensource.org/licenses/osl-3.0.php
10
- */
11
- class Ebizmarts_MageMonkey_Model_TransactionalEmail_MANDRILL
12
- {
13
-
14
- /**
15
- * API version number
16
- *
17
- * @var string
18
- */
19
- public $version = '1.0';
20
-
21
- /**
22
- * Error Message storage
23
- *
24
- * @var string
25
- */
26
- public $errorMessage;
27
-
28
- /**
29
- * Error Code storage
30
- *
31
- * @var integer
32
- */
33
- public $errorCode;
34
-
35
- /**
36
- * Cache the user api_key so we only have to log in once per client instantiation
37
- *
38
- * @var string MailChimp API key
39
- */
40
- public $api_key;
41
-
42
- /**
43
- * STS API URL
44
- *
45
- * @var string
46
- */
47
- public $apiUrl;
48
-
49
- /**
50
- * Request output format
51
- *
52
- * @var string
53
- */
54
- protected $_output = 'json';
55
-
56
- /**
57
- * Setup data
58
- *
59
- * @param string $apikey Your MailChimp apikey
60
- * @param string $secure Whether or not this should use a secure connection
61
- */
62
- function __construct($apikey = null)
63
- {
64
- if ($apikey) {
65
- $this->setApiKey($apikey);
66
- }
67
- }
68
-
69
- /**
70
- * Api key setter
71
- *
72
- * @param string $key API Key
73
- * @return Ebizmarts_MageMonkey_Model_TransactionalEmail_MANDRILL
74
- */
75
- public function setApiKey($key)
76
- {
77
- $this->api_key = $key;
78
-
79
- $this->apiUrl = "http://mandrillapp.com/api/{$this->version}/";
80
-
81
- return $this;
82
- }
83
-
84
- /**
85
- * ===== Users 유 Calls =====
86
- */
87
-
88
- /**
89
- * Validate an API key and respond to a ping
90
- *
91
- */
92
- public function usersPing()
93
- {
94
- return $this->_callServer("users/ping");
95
- }
96
-
97
- /**
98
- * Return the information about the API-connected user
99
- *
100
- */
101
- public function usersInfo()
102
- {
103
- return $this->_callServer("users/info");
104
- }
105
-
106
- /**
107
- * Return the senders that have tried to use this account, both verified and unverified
108
- *
109
- */
110
- public function usersSenders()
111
- {
112
- return $this->_callServer("users/senders");
113
- }
114
-
115
- /**
116
- * Disable a sender from being able to send
117
- *
118
- * @param string $email
119
- */
120
- public function usersDisableSender($email)
121
- {
122
- $params = array();
123
- $params["email"] = $email;
124
-
125
- return $this->_callServer("users/disable-sender", $params);
126
- }
127
-
128
- /**
129
- * Send an email to the given address to verify that it is an accepted sender for your Mandrill account.
130
- *
131
- * @param string $email
132
- */
133
- public function usersVerifySender($email)
134
- {
135
- $params = array();
136
- $params["email"] = $email;
137
-
138
- return $this->_callServer("users/verify-sender", $params);
139
- }
140
-
141
- public function verifyEmailAddress($email)
142
- {
143
- return $this->usersVerifySender($email);
144
- }
145
-
146
- /**
147
- *
148
- * ===== Users 유 Calls =====
149
- */
150
-
151
-
152
- /**
153
- * ===== Messages ✐ Calls =====
154
- */
155
-
156
- /**
157
- * Send a new transactional message through Mandrill
158
- *
159
- * @param array $message The message data with the following keys:
160
- * string html the full HTML content to be sent
161
- * string text optional full text content to be sent
162
- * string subject the message subject
163
- * string from_email the sender email address. If this address has not been verified, the message will be queued and not sent until it is verified
164
- * string from_name optional from name to be used
165
- * array to an array of email addresses to use as recipients. Each item in the array should be a struct with two keys - email: the email address of the recipient, and name: the optional display name to use for the recipient
166
- * struct headers optional extra headers to add to the message (currently only Reply-To and X-* headers are allowed)
167
- * boolean track_opens whether or not to turn on open tracking for the message
168
- * boolean track_clicks whether or not to turn on click tracking for the message
169
- * array tags an array of string to tag the message with. Stats are accumulated using tags, though we only store the first 100 we see, so this should not be unique or change frequently. Tags should be 50 characters or less. Any tags starting with an understore are reserved for internal use and will cause errors.
170
- */
171
- public function messagesSend($message)
172
- {
173
-
174
- $to = array();
175
-
176
- foreach ($message['to_email'] as $pos => $email) {
177
- $to [] = array(
178
- 'email' => $email,
179
- 'name' => $message['to_name'][$pos]
180
- );
181
- }
182
-
183
- $message['to'] = $to;
184
- unset($message['to_email'], $message['to_name']);
185
-
186
- $params = array();
187
- $params["message"] = $message;
188
-
189
- return $this->_callServer("messages/send", $params);
190
- }
191
-
192
- public function sendEmail($message)
193
- {
194
- return $this->messagesSend($message);
195
- }
196
-
197
- /**
198
- * ===== Messages ✐ Calls =====
199
- */
200
-
201
-
202
- /**
203
- * ===== Tags ✰ Calls =====
204
- */
205
-
206
- /**
207
- * Return all of the user-defined tag information
208
- *
209
- */
210
- public function tagsList()
211
- {
212
- return $this->_callServer("tags/list");
213
- }
214
-
215
- /**
216
- * Return the recent history (hourly stats for the last 30 days) for a tag
217
- *
218
- * @param string $tag
219
- */
220
- public function tagsTimeSeries($tag)
221
- {
222
- $params = array();
223
- $params["tag"] = $tag;
224
-
225
- return $this->_callServer("tags/time-series", $params);
226
- }
227
-
228
- /**
229
- * Return the recent history (hourly stats for the last 30 days) for all tags
230
- *
231
- */
232
- public function tagsAllTimeSeries()
233
- {
234
- return $this->_callServer("tags/all-time-series");
235
- }
236
-
237
- /**
238
- * ===== Tags ✰ Calls =====
239
- */
240
-
241
-
242
- /**
243
- * ===== Urls ≎ Calls =====
244
- */
245
-
246
- /**
247
- * Get the 100 most clicked URLs
248
- *
249
- */
250
- public function urlsList()
251
- {
252
- return $this->_callServer("urls/list");
253
- }
254
-
255
- /**
256
- * Return the 100 most clicked URLs that match the search query given
257
- *
258
- * @param string $query
259
- */
260
- public function urlsSearch($query)
261
- {
262
- $params = array();
263
- $params["q"] = $query;
264
-
265
- return $this->_callServer("urls/search", $params);
266
- }
267
-
268
- /**
269
- * Return the recent history (hourly stats for the last 30 days) for a url
270
- *
271
- * @param string $url
272
- */
273
- public function urlsTimeSeries($url)
274
- {
275
- $params = array();
276
- $params["url"] = $url;
277
-
278
- return $this->_callServer("urls/time-series", $params);
279
- }
280
-
281
- /**
282
- * ===== Urls ≎ Calls =====
283
- */
284
-
285
-
286
- /**
287
- * Actually connect to the server and call the requested methods, parsing the result
288
- *
289
- * @param string $method
290
- * @param array OPTIONAL $params
291
- * @return object|false
292
- */
293
- protected function _callServer($method, $params = array())
294
- {
295
-
296
- $this->errorMessage = null;
297
- $this->errorCode = null;
298
-
299
- $params['key'] = $this->api_key;
300
-
301
- $url = $this->apiUrl . $method . '.' . $this->_output;
302
-
303
- Mage::helper('monkey')->log($url, 'MageMonkey_ApiCall.log');
304
- Mage::helper('monkey')->log($params, 'MageMonkey_ApiCall.log');
305
-
306
- $curlSession = curl_init();
307
-
308
- curl_setopt($curlSession, CURLOPT_USERAGENT, Mage::helper('monkey')->getUserAgent());
309
- curl_setopt($curlSession, CURLOPT_URL, $url);
310
- curl_setopt($curlSession, CURLOPT_HEADER, 0);
311
- curl_setopt($curlSession, CURLOPT_POST, TRUE);
312
- curl_setopt($curlSession, CURLOPT_POSTFIELDS, http_build_query($params));
313
- curl_setopt($curlSession, CURLOPT_RETURNTRANSFER, TRUE);
314
- //curl_setopt($curlSession, CURLOPT_SSL_VERIFYPEER, FALSE);
315
- //curl_setopt($curlSession, CURLOPT_SSL_VERIFYHOST, 1);
316
-
317
- $result = curl_exec($curlSession);
318
- if (!$result) {
319
-
320
- $errstr = curl_error($curlSession);
321
- $errno = curl_errno($curlSession);
322
-
323
- $this->errorMessage = "Could not connect (ERR $errno: $errstr)";
324
- $this->errorCode = "-99";
325
- return false;
326
- }
327
-
328
- // Check that a connection was made
329
- if (curl_error($curlSession)) {
330
- $this->errorMessage = curl_error($curlSession);
331
- $this->errorCode = "-99";
332
- return false;
333
- }
334
-
335
- $httpCode = curl_getinfo($curlSession, CURLINFO_HTTP_CODE);
336
-
337
- curl_close($curlSession);
338
-
339
- $resultObject = json_decode($result);
340
-
341
- Mage::helper('monkey')->log($resultObject, 'MageMonkey_ApiCall.log');
342
-
343
- //You can consider any non-200 HTTP response code an error
344
- //the returned data will contain more detailed information
345
- if ($httpCode != 200) {
346
- $this->errorMessage = $resultObject->message;
347
- $this->errorCode = "-99";
348
- return false;
349
- }
350
-
351
- return $resultObject;
352
-
353
- }
354
-
355
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Ebizmarts/MageMonkey/Model/TransactionalEmail/STS.php DELETED
@@ -1,243 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * MailChimp STS (Amazon Simple Email Service) API wrapper
5
- *
6
- * @category Ebizmarts
7
- * @package Ebizmarts_MageMonkey
8
- * @author Ebizmarts Team <info@ebizmarts.com>
9
- * @license http://opensource.org/licenses/osl-3.0.php
10
- */
11
- class Ebizmarts_MageMonkey_Model_TransactionalEmail_STS
12
- {
13
- /**
14
- * API version number
15
- *
16
- * @var string
17
- */
18
- public $version = '1.0';
19
-
20
- /**
21
- * Error Message storage
22
- *
23
- * @var string
24
- */
25
- public $errorMessage;
26
-
27
- /**
28
- * Error Code storage
29
- *
30
- * @var integer
31
- */
32
- public $errorCode;
33
-
34
- /**
35
- * Cache the user api_key so we only have to log in once per client instantiation
36
- *
37
- * @var string MailChimp API key
38
- */
39
- public $api_key;
40
-
41
- /**
42
- * Use Secure connection or not
43
- *
44
- * @var bool
45
- */
46
- public $secure = false;
47
-
48
- /**
49
- * STS API URL
50
- *
51
- * @var string
52
- */
53
- public $apiUrl;
54
-
55
- /**
56
- * Setup data
57
- *
58
- * @param string $apikey Your MailChimp apikey
59
- * @param string $secure Whether or not this should use a secure connection
60
- */
61
- function __construct($apikey = null, $secure = false)
62
- {
63
- $this->secure = $secure;
64
-
65
- if ($apikey) {
66
- $this->setApiKey($apikey);
67
- }
68
- }
69
-
70
- /**
71
- * Api key setter
72
- *
73
- * @param string $key API Key
74
- * @return Ebizmarts_MageMonkey_Model_TransactionalEmail_STS
75
- */
76
- public function setApiKey($key)
77
- {
78
- $this->api_key = $key;
79
-
80
- $dc = "us1";
81
- if (strstr($this->api_key, "-")) {
82
- list($key, $dc) = explode("-", $this->api_key, 2);
83
- if (!$dc) {
84
- $dc = "us1";
85
- }
86
- }
87
- $this->apiUrl = "http://{$dc}.sts.mailchimp.com/{$this->version}/";
88
-
89
- return $this;
90
- }
91
-
92
- /**
93
- * Composes an email message based on input data, and then immediately queues the message for sending.
94
- * We manage requeuing for you, so if a message gets rejected for a queueing issue, you've completely blown out your Amazon sending limits.
95
- * You are encourage to always make this call with a POST request.
96
- *
97
- * <Important: If you have not yet requested production access to Amazon SES, then you will only be able to send email to and from verified email addresses.>
98
- *
99
- *
100
- * @param array $message The message data with the following keys:
101
- * string html the full HTML content to be sent
102
- * string text optional - the full Text content to be sent
103
- * string subject the message subject
104
- * string from_name the from name to be used
105
- * string from_email a verified email address from ListVerifiedEmailAddresses
106
- * array reply_to option the email address(es) that should be set as reply-to email addresses.
107
- * array to_email an array containing up to 50 email addresses to receive this email
108
- * array to_name optional - an array of To names to be used. Theses will be processed in order with to_email, so every to_email should have a to_name, even if it is blank.
109
- * array cc_email optional - an array containing up to 50 email addresses to receive this email as CC recipients
110
- * array cc_name optional - an array of CC names to be used. Theses will be processed in order with to_email, so every to_email should have a to_name, even if it is blank.
111
- * array bcc_email optional - an array containing up to 50 email addresses to receive this email as BCC recipients
112
- * array bcc_name optional - an array of BCC names to be used. Theses will be processed in order with to_email, so every to_email should have a to_name, even if it is blank.
113
- * bool autogen_html optional - if an html section is not passed in, generate it from the text. For historical reasons, this defaults to true.
114
- * @param bool $track_opens whether or not to turn on MailChimp-specific opens tracking
115
- * @param bool $track_clicks whether or not to turn on MailChimp-specific click tracking
116
- * @param array $tags an array of strings to tag the message with. Stats can be accumulated using tags, though we only store the first 100 we see, so this should not be unique or change frequently. Tags should be 50 characters or less - any starting with an underscore are reserved and will cause errors.
117
- * @return JSON object containing the "status" as either "sent" or "queued" along with extra info on what happened.
118
- */
119
- public function sendEmail($message, $track_opens = FALSE, $track_clicks = FALSE, $tags = array())
120
- {
121
-
122
- $params = array();
123
- $params["message"] = $message;
124
- $params["track_opens"] = $track_opens;
125
- $params["track_clicks"] = $track_clicks;
126
- $params["tags"] = $tags;
127
-
128
- return $this->_callServer("SendEmail", $params);
129
-
130
- }
131
-
132
- /**
133
- * Returns a list containing all of the email addresses that have been verified.
134
- *
135
- * @return array
136
- */
137
- public function listVerifiedEmailAddresses()
138
- {
139
- return $this->_callServer("ListVerifiedEmailAddresses");
140
- }
141
-
142
- /**
143
- * Verifies an email address.
144
- * This action causes a confirmation email message to be sent to the specified address.
145
- *
146
- * @param string $email Email address to be verified
147
- * @return array
148
- */
149
- public function verifyEmailAddress($email)
150
- {
151
- $params = array();
152
- $params["email"] = $email;
153
-
154
- return $this->_callServer("VerifyEmailAddress", $params);
155
- }
156
-
157
- /**
158
- * Deletes a verified email address.
159
- * This action takes immediate effect, so use it with care.
160
- *
161
- * @param string $email Email address to be deleted
162
- * @return array
163
- */
164
- public function deleteVerifiedEmailAddress($email)
165
- {
166
- $params = array();
167
- $params["email"] = $email;
168
-
169
- return $this->_callServer("DeleteVerifiedEmailAddress", $params);
170
- }
171
-
172
- /**
173
- * Actually connect to the server and call the requested methods, parsing the result
174
- *
175
- * @param string $method
176
- * @param array OPTIONAL $params
177
- * @return object|false
178
- */
179
- protected function _callServer($method, $params = array())
180
- {
181
-
182
- $this->errorMessage = null;
183
- $this->errorCode = null;
184
-
185
- $params['apikey'] = $this->api_key;
186
-
187
- $url = $this->apiUrl . $method;
188
-
189
- Mage::helper('monkey')->log($url, 'MageMonkey_ApiCall.log');
190
- Mage::helper('monkey')->log($params, 'MageMonkey_ApiCall.log');
191
-
192
- $curlSession = curl_init();
193
-
194
- curl_setopt($curlSession, CURLOPT_USERAGENT, Mage::helper('monkey')->getUserAgent());
195
- curl_setopt($curlSession, CURLOPT_URL, $url);
196
- curl_setopt($curlSession, CURLOPT_HEADER, 0);
197
- curl_setopt($curlSession, CURLOPT_POST, TRUE);
198
- curl_setopt($curlSession, CURLOPT_POSTFIELDS, http_build_query($params));
199
- curl_setopt($curlSession, CURLOPT_RETURNTRANSFER, TRUE);
200
-
201
- if (TRUE === $this->secure) {
202
- //TODO
203
- //curl_setopt($curlSession, CURLOPT_SSL_VERIFYPEER, TRUE);
204
- //curl_setopt($curlSession, CURLOPT_SSL_VERIFYHOST, TRUE);
205
- }
206
-
207
- $result = curl_exec($curlSession);
208
- if (!$result) {
209
-
210
- $errstr = curl_error($curlSession);
211
- $errno = curl_errno($curlSession);
212
-
213
- $this->errorMessage = "Could not connect (ERR $errno: $errstr)";
214
- $this->errorCode = "-99";
215
- return false;
216
- }
217
-
218
- // Check that a connection was made
219
- if (curl_error($curlSession)) {
220
- $this->errorMessage = curl_error($curlSession);
221
- $this->errorCode = "-99";
222
- return false;
223
- }
224
-
225
- $httpCode = curl_getinfo($curlSession, CURLINFO_HTTP_CODE);
226
-
227
- curl_close($curlSession);
228
-
229
- $resultObject = json_decode($result);
230
-
231
- Mage::helper('monkey')->log($resultObject, 'MageMonkey_ApiCall.log');
232
-
233
- if ($httpCode != 200) {
234
- $this->errorMessage = $resultObject->message;
235
- $this->errorCode = "-99";
236
- return false;
237
- }
238
-
239
- return $resultObject;
240
-
241
- }
242
-
243
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Ebizmarts/MageMonkey/controllers/Adminhtml/ConfigController.php CHANGED
@@ -39,8 +39,6 @@ class Ebizmarts_MageMonkey_Adminhtml_ConfigController extends Mage_Adminhtml_Con
39
  }
40
  $this->getResponse()->setHeader('Content-type', 'application/json');
41
  $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($rc));
42
- return;
43
-
44
  }
45
 
46
  protected function _getStoreByCode($storeCode)
39
  }
40
  $this->getResponse()->setHeader('Content-type', 'application/json');
41
  $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($rc));
 
 
42
  }
43
 
44
  protected function _getStoreByCode($storeCode)
app/code/community/Ebizmarts/MageMonkey/controllers/Adminhtml/TransactionalemailController.php DELETED
@@ -1,134 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Transactional Email Service manager controller
5
- *
6
- * @category Ebizmarts
7
- * @package Ebizmarts_MageMonkey
8
- * @author Ebizmarts Team <info@ebizmarts.com>
9
- * @license http://opensource.org/licenses/osl-3.0.php
10
- */
11
- class Ebizmarts_MageMonkey_Adminhtml_TransactionalemailController extends Mage_Adminhtml_Controller_Action
12
- {
13
-
14
- /**
15
- * Initialize action
16
- *
17
- * @return Mage_Adminhtml_Controller_Action
18
- */
19
- protected function _initAction()
20
- {
21
- $this->_title($this->__('Newsletter'))
22
- ->_title($this->__('MailChimp'));
23
-
24
- $this->loadLayout();
25
- $this->_setActiveMenu('newsletter/magemonkey');
26
- return $this;
27
- }
28
-
29
- /**
30
- * Mandrill verified emails grid
31
- */
32
- public function mandrillAction()
33
- {
34
- $this->_initAction();
35
- $this->_title($this->__('Mandrill'));
36
- $this->renderLayout();
37
- }
38
-
39
- /**
40
- * STS verified emails grid
41
- */
42
- public function stsAction()
43
- {
44
- $this->_initAction();
45
- $this->_title($this->__('Amazon Simple Email Service'));
46
- $this->renderLayout();
47
- }
48
-
49
- /**
50
- * Delete valid email address from Amazon SES
51
- */
52
- public function newAction()
53
- {
54
- $this->_initAction();
55
- $this->_title($this->__('Validate Email'));
56
- $this->renderLayout();
57
- }
58
-
59
- public function validateEmailAction()
60
- {
61
- $service = $this->getRequest()->getPost('service', 'sts');
62
-
63
- if ($this->getRequest()->isPost() && $service) {
64
-
65
- $store = $this->getRequest()->getPost('store');
66
-
67
- $apiKey = Mage::helper('monkey')->getApiKey($store);
68
- if ($service == 'mandrill') {
69
- $apiKey = Mage::helper('monkey')->getMandrillApiKey($store);
70
- }
71
-
72
- $mail = Ebizmarts_MageMonkey_Model_TransactionalEmail_Adapter::factory($service)
73
- ->setApiKey($apiKey);
74
-
75
- $mail->verifyEmailAddress($this->getRequest()->getPost('email_address'));
76
- if ($mail->errorCode) {
77
- $this->_getSession()->addError($this->__($mail->errorMessage));
78
- } else {
79
- $this->_getSession()->addSuccess($this->__('Email address verified.'));
80
- }
81
- }
82
-
83
- $this->_redirect('monkey/adminhtml_transactionalemail/' . $service);
84
- }
85
-
86
- /**
87
- * Delete valid email address from Mandrill
88
- */
89
- public function mandrillDisableAction()
90
- {
91
- $email = $this->getRequest()->getParam('email');
92
- $store = $this->getRequest()->getParam('store', 0);
93
-
94
- if ($email) {
95
- $apiKey = Mage::helper('monkey')->getMandrillApiKey($store);
96
- $mail = Ebizmarts_MageMonkey_Model_TransactionalEmail_Adapter::factory('mandrill')
97
- ->setApiKey($apiKey);
98
-
99
- $mail->usersDisableSender($email);
100
- if ($mail->errorCode) {
101
- $this->_getSession()->addError($this->__($mail->errorMessage));
102
- } else {
103
- $this->_getSession()->addSuccess($this->__('Email address was disabled.'));
104
- }
105
- }
106
-
107
- $this->_redirect('monkey/adminhtml_transactionalemail/mandrill');
108
- }
109
-
110
- /**
111
- * Delete valid email address from Amazon SES
112
- */
113
- public function stsDeleteAction()
114
- {
115
- $email = $this->getRequest()->getParam('email');
116
- $store = $this->getRequest()->getParam('store', 0);
117
-
118
- if ($email) {
119
- $apiKey = Mage::helper('monkey')->getApiKey($store);
120
- $mail = Ebizmarts_MageMonkey_Model_TransactionalEmail_Adapter::factory('sts')
121
- ->setApiKey($apiKey);
122
-
123
- $mail->deleteVerifiedEmailAddress($email);
124
- if ($mail->errorCode) {
125
- $this->_getSession()->addError($this->__($mail->errorMessage));
126
- } else {
127
- $this->_getSession()->addSuccess($this->__('Email address deleted.'));
128
- }
129
- }
130
-
131
- $this->_redirect('monkey/adminhtml_transactionalemail/sts');
132
- }
133
-
134
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Ebizmarts/MageMonkey/controllers/WebhookController.php CHANGED
@@ -26,7 +26,7 @@ class Ebizmarts_MageMonkey_WebhookController extends Mage_Core_Controller_Front_
26
  ->sendResponse();
27
  return $this;
28
  }
29
- Mage::helper('monkey')->log(print_r($this->getRequest()->getPost(), true));
30
 
31
  Mage::app()->setCurrentStore(Mage::app()->getDefaultStoreView());
32
 
26
  ->sendResponse();
27
  return $this;
28
  }
29
+ Mage::helper('monkey')->log(var_export($this->getRequest()->getPost(), true));
30
 
31
  Mage::app()->setCurrentStore(Mage::app()->getDefaultStoreView());
32
 
app/code/community/Ebizmarts/MageMonkey/etc/config.xml CHANGED
@@ -10,7 +10,7 @@
10
  <config>
11
  <modules>
12
  <Ebizmarts_MageMonkey>
13
- <version>1.1.32</version>
14
  </Ebizmarts_MageMonkey>
15
  </modules>
16
  <global>
10
  <config>
11
  <modules>
12
  <Ebizmarts_MageMonkey>
13
+ <version>1.1.33</version>
14
  </Ebizmarts_MageMonkey>
15
  </modules>
16
  <global>
app/code/community/Ebizmarts/Mandrill/Model/Email/Template.php CHANGED
@@ -46,8 +46,8 @@ class Ebizmarts_Mandrill_Model_Email_Template extends Mage_Core_Model_Email_Temp
46
  $email = array('subject' => $this->getProcessedTemplateSubject($variables), 'to' => array());
47
 
48
  $mail = $this->getMail();
49
-
50
- for ($i = 0; $i < count($emails); $i++) {
51
  if (isset($names[$i])) {
52
  $email['to'][] = array(
53
  'email' => $emails[$i],
46
  $email = array('subject' => $this->getProcessedTemplateSubject($variables), 'to' => array());
47
 
48
  $mail = $this->getMail();
49
+ $max = count($emails);
50
+ for ($i = 0; $i < $max; $i++) {
51
  if (isset($names[$i])) {
52
  $email['to'][] = array(
53
  'email' => $emails[$i],
app/code/community/Ebizmarts/Mandrill/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Ebizmarts_Mandrill>
5
- <version>2.0.4</version>
6
  </Ebizmarts_Mandrill>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Ebizmarts_Mandrill>
5
+ <version>2.0.5</version>
6
  </Ebizmarts_Mandrill>
7
  </modules>
8
  <global>
app/code/community/Ebizmarts/SweetMonkey/Model/Observer.php CHANGED
@@ -20,7 +20,7 @@ class Ebizmarts_SweetMonkey_Model_Observer
20
  }
21
 
22
  $store = is_null($observer->getEvent()->getStore()) ? Mage::app()->getDefaultStoreView()->getCode() : $observer->getEvent()->getStore();
23
- $config = new Mage_Core_Model_Config();
24
  $config->saveConfig('sweetmonkey/general/active', false, $scope, $store);
25
  Mage::getConfig()->cleanCache();
26
  $message = Mage::helper('sweetmonkey')->__('To activate Sweet Monkey you need to have <a href=https://www.sweettoothrewards.com/features/magento/>Sweet Tooth Rewards</a> enabled');
@@ -124,19 +124,7 @@ class Ebizmarts_SweetMonkey_Model_Observer
124
  $spent = $earn = null;
125
 
126
  if ($lastTransfers->getSize()) {
127
- foreach ($lastTransfers as $transfer) {
128
-
129
- if (is_null($earn) && $transfer->getQuantity() > 0) {
130
- $earn = date_format(date_create_from_format('Y-m-d H:i:s', $transfer->getEffectiveStart()), 'Y-m-d');
131
- } else if (is_null($spent) && $transfer->getQuantity() < 0) {
132
- $spent = date_format(date_create_from_format('Y-m-d H:i:s', $transfer->getEffectiveStart()), 'Y-m-d');
133
- }
134
-
135
- if (!is_null($spent) && !is_null($earn)) {
136
- break;
137
- }
138
-
139
- }
140
  }
141
 
142
  if ($existEarn && $earn) {
@@ -149,20 +137,21 @@ class Ebizmarts_SweetMonkey_Model_Observer
149
 
150
  }
151
 
152
- //Expiration Points
153
- if (array_key_exists('PTSEXP', $tbtVars)) {
154
- $val = Mage::getSingleton('rewards/expiry')
155
- ->getExpiryDate($tbtCustomer);
156
- if ($val) {
157
- $val = date_format(date_create_from_format('d/m/Y', $val), 'Y-m-d');
158
- $tbtVars['PTSEXP'] = $val;
159
- }
160
- }
161
- foreach ($tbtVars as $key => $var) {
162
- $aux = str_replace('points', '', strtolower($var));
163
- $tbtVars[$key] = str_replace('no', 0, $aux);
164
-
165
- }
 
166
 
167
  $tbtVars = array_filter($tbtVars);
168
  //Add data to MailChimp merge vars
@@ -172,7 +161,42 @@ class Ebizmarts_SweetMonkey_Model_Observer
172
  }
173
  return $this;
174
  }
 
 
 
 
175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  /**
177
  * Gets a date in format YYYY-MM-DD HH:m:s and returns MM/DD/YYYY
178
  *
20
  }
21
 
22
  $store = is_null($observer->getEvent()->getStore()) ? Mage::app()->getDefaultStoreView()->getCode() : $observer->getEvent()->getStore();
23
+ $config = Mage::getModel('core/config');
24
  $config->saveConfig('sweetmonkey/general/active', false, $scope, $store);
25
  Mage::getConfig()->cleanCache();
26
  $message = Mage::helper('sweetmonkey')->__('To activate Sweet Monkey you need to have <a href=https://www.sweettoothrewards.com/features/magento/>Sweet Tooth Rewards</a> enabled');
124
  $spent = $earn = null;
125
 
126
  if ($lastTransfers->getSize()) {
127
+ list($spent,$earn) = $this->spentAndErn($lastTransfers);
 
 
 
 
 
 
 
 
 
 
 
 
128
  }
129
 
130
  if ($existEarn && $earn) {
137
 
138
  }
139
 
140
+ $tbtVars = $this->expirationPoints($tbtVars,$tbtCustomer);
141
+ // //Expiration Points
142
+ // if (array_key_exists('PTSEXP', $tbtVars)) {
143
+ // $val = Mage::getSingleton('rewards/expiry')
144
+ // ->getExpiryDate($tbtCustomer);
145
+ // if ($val) {
146
+ // $val = date_format(date_create_from_format('d/m/Y', $val), 'Y-m-d');
147
+ // $tbtVars['PTSEXP'] = $val;
148
+ // }
149
+ // }
150
+ // foreach ($tbtVars as $key => $var) {
151
+ // $aux = str_replace('points', '', strtolower($var));
152
+ // $tbtVars[$key] = str_replace('no', 0, $aux);
153
+ //
154
+ // }
155
 
156
  $tbtVars = array_filter($tbtVars);
157
  //Add data to MailChimp merge vars
161
  }
162
  return $this;
163
  }
164
+ private function spentAndErn($lastTransfers)
165
+ {
166
+ $spent = $earn = null;
167
+ foreach ($lastTransfers as $transfer) {
168
 
169
+ if (is_null($earn) && $transfer->getQuantity() > 0) {
170
+ $earn = date_format(date_create_from_format('Y-m-d H:i:s', $transfer->getEffectiveStart()), 'Y-m-d');
171
+ } else if (is_null($spent) && $transfer->getQuantity() < 0) {
172
+ $spent = date_format(date_create_from_format('Y-m-d H:i:s', $transfer->getEffectiveStart()), 'Y-m-d');
173
+ }
174
+
175
+ if (!is_null($spent) && !is_null($earn)) {
176
+ break;
177
+ }
178
+
179
+ }
180
+ return array($spent,$earn);
181
+ }
182
+
183
+ private function expirationPoints($tbtVars,$tbtCustomer)
184
+ {
185
+ if (array_key_exists('PTSEXP', $tbtVars)) {
186
+ $val = Mage::getSingleton('rewards/expiry')
187
+ ->getExpiryDate($tbtCustomer);
188
+ if ($val) {
189
+ $val = date_format(date_create_from_format('d/m/Y', $val), 'Y-m-d');
190
+ $tbtVars['PTSEXP'] = $val;
191
+ }
192
+ }
193
+ foreach ($tbtVars as $key => $var) {
194
+ $aux = str_replace('points', '', strtolower($var));
195
+ $tbtVars[$key] = str_replace('no', 0, $aux);
196
+
197
+ }
198
+ return $tbtVars;
199
+ }
200
  /**
201
  * Gets a date in format YYYY-MM-DD HH:m:s and returns MM/DD/YYYY
202
  *
app/code/community/Ebizmarts/SweetMonkey/controllers/Adminhtml/MageMonkeyController.php CHANGED
@@ -24,7 +24,6 @@ class Ebizmarts_SweetMonkey_Adminhtml_MageMonkeyController extends Mage_Adminhtm
24
  }
25
 
26
  $this->getResponse()->setBody(Zend_Json::encode($mergeVars));
27
- return;
28
  }
29
 
30
  /**
@@ -38,7 +37,12 @@ class Ebizmarts_SweetMonkey_Adminhtml_MageMonkeyController extends Mage_Adminhtm
38
  if ($listId) {
39
 
40
  $api = Mage::getModel('monkey/api');
41
- parse_str($this->getRequest()->getPost('merge_vars'), $mergeVars);
 
 
 
 
 
42
 
43
  $options = array();
44
  foreach ($mergeVars as $tag => $name) {
@@ -64,7 +68,6 @@ class Ebizmarts_SweetMonkey_Adminhtml_MageMonkeyController extends Mage_Adminhtm
64
  }
65
 
66
  $this->getResponse()->setBody(Zend_Json::encode(array()));
67
- return;
68
  }
69
 
70
  }
24
  }
25
 
26
  $this->getResponse()->setBody(Zend_Json::encode($mergeVars));
 
27
  }
28
 
29
  /**
37
  if ($listId) {
38
 
39
  $api = Mage::getModel('monkey/api');
40
+ $e =explode('&',$this->getRequest()->getPost('merge_vars'));
41
+ $mergeVars = array();
42
+ foreach($e as $val) {
43
+ $m = explode('=',$val);
44
+ $mergeVars[$m[0]]=$m[1];
45
+ }
46
 
47
  $options = array();
48
  foreach ($mergeVars as $tag => $name) {
68
  }
69
 
70
  $this->getResponse()->setBody(Zend_Json::encode(array()));
 
71
  }
72
 
73
  }
app/code/community/Ebizmarts/SweetMonkey/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Ebizmarts_SweetMonkey>
5
- <version>1.1.9</version>
6
  </Ebizmarts_SweetMonkey>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Ebizmarts_SweetMonkey>
5
+ <version>1.1.10</version>
6
  </Ebizmarts_SweetMonkey>
7
  </modules>
8
  <global>
package.xml CHANGED
@@ -1,20 +1,22 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ebizmarts_MageMonkey</name>
4
- <version>1.1.32</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>MailChimp integration for Magento by Ebizmarts</summary>
10
  <description>Full MailChimp integration, automatic webhooks, multiple lists, interest groups</description>
11
- <notes>1.1.32&#xD;
12
  --------&#xD;
13
- Fix xml format.</notes>
 
 
14
  <authors><author><name>Ebizmarts Development Team</name><user>auto-converted</user><email>info@ebizmarts.com</email></author></authors>
15
- <date>2015-04-28</date>
16
- <time>17:26:41</time>
17
- <contents><target name="magecommunity"><dir name="Ebizmarts"><dir name="MageMonkey"><dir name="Block"><dir name="Adminhtml"><dir name="Bulksync"><dir name="Export"><file name="Form.php" hash="ae560b94bb9e440d660be69f5165b69f"/></dir><dir name="Import"><file name="Form.php" hash="0421281b9cfbc446329d7482c24c2c11"/></dir><dir name="Queue"><file name="Grid.php" hash="23b3edec3bc13fae8aee5b7292c4d4d1"/></dir><dir name="QueueExport"><file name="Grid.php" hash="68ec401dc23cddf8a1362c53aaab69b2"/></dir><dir name="QueueImport"><file name="Grid.php" hash="a695371e46328137d025b0fdf09944fe"/></dir><file name="Export.php" hash="62714f95580e489105914270b889a142"/><file name="Import.php" hash="d573582da25766aecba918d299c02586"/><file name="Queue.php" hash="c3cea1da02e0a09d7876958058ee091e"/><file name="QueueExport.php" hash="69536eee264346535f1c786d61b3cf84"/><file name="QueueImport.php" hash="d9fbc0d22f94df54f71116d0d484d1a3"/></dir><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Memberactivity.php" hash="55fbb4519c6d862948dc4d8bf4416cfb"/></dir></dir></dir><dir name="Ecommerce"><file name="Grid.php" hash="b1ad37ffe9fe0752356d29a6548b0434"/></dir><dir name="Ecommerceapi"><dir name="Renderer"><file name="Items.php" hash="d72cfedf0cafc938becf9bd52801ba3a"/></dir><file name="Grid.php" hash="ee1be42cb6c893e3c59cac784df67fb3"/></dir><dir name="Memberactivity"><file name="Grid.php" hash="f4b341dd60b361098394618cf3382620"/></dir><dir name="Renderer"><file name="Date.php" hash="6e4e52403ec55df3aa2183fd4b51b095"/><file name="Importypes.php" hash="87c7a222e403781fcd8ee08cf0b489ba"/><file name="Lists.php" hash="15f5b5e087b49396a6f844e0f1bfb6b1"/><file name="Progress.php" hash="31eaaa5a7e99b21a4ed705971fe1001d"/><file name="Yesno.php" hash="c3173a8e8ea2d5f03531e7d996bbd259"/></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="31bf492c4e6137312c55bc437bf226cf"/></dir><dir name="Form"><dir name="Field"><file name="Mapfields.php" hash="8f2a10ca1a1d239b3b231ca2cee5f96e"/></dir></dir><file name="Account.php" hash="fccf1faac2682d754655631e6451c026"/><file name="Date.php" hash="455120f4f2e8d7801f3c220e231b6789"/><file name="OauthWizard.php" hash="bd79f8b43d71137337e732fbeb415ffb"/><file name="ResetLocalEcommerce.php" hash="e17208b58da80e06276ca1910c622715"/><file name="ResetRemoteEcommerce.php" hash="47e2f24d108e16721ac26279431815bb"/></dir></dir><dir name="Transactionalemail"><dir name="Mandrill"><file name="Grid.php" hash="c36b98022da2fb5e88b534834f926518"/></dir><dir name="Newemail"><file name="Form.php" hash="05a121f805fd5fee70f48dc6d7d1af24"/></dir><dir name="Sts"><file name="Grid.php" hash="4000e0373c028d0c68c58283e06fb9e9"/></dir><file name="Mandrill.php" hash="3811d7cde9d41c8920990b37424411cc"/><file name="Newemail.php" hash="768248c4d275c6dcc4ed975b4e19b4b1"/><file name="Sts.php" hash="273c2dbea87d0f23433d69d9d2523e31"/></dir><file name="Ecommerce.php" hash="48c237e8cc1223ad26a88d2409679fec"/><file name="Ecommerceapi.php" hash="a9f659502d96bcd1a69a88d15fcab4f9"/></dir><dir name="Checkout"><file name="Subscribe.php" hash="14de0075005dafe3363716e3ffd10d20"/></dir><dir name="Customer"><dir name="Account"><file name="Lists.php" hash="64f0e5a8360750f6b19d8b5db0fcac23"/></dir></dir><file name="Lists.php" hash="8f1de28547a4718113e849b7a5fa0fea"/><file name="Signup.php" hash="93b0e787e63a90a5fb4bacba1e03bd05"/></dir><dir name="Helper"><file name="Cache.php" hash="4e6cd9724c2788056aacacd37f5699cc"/><file name="Data.php" hash="3be1ac7c19a66a5171080e4bc9138754"/><file name="Export.php" hash="91f24805e9cbbe124f0c99cb8f1f1272"/><file name="Oauth2.php" hash="684a7b71d97b438081ebf332057ec8ea"/></dir><dir name="Model"><dir name="Custom"><file name="Collection.php" hash="304d372c1b8bd8d8d09dd743e03cdf66"/></dir><dir name="Email"><file name="Template.php" hash="81c9f040cf931dfb9e2a2484d9cc0b09"/></dir><dir name="Feed"><file name="Updates.php" hash="fb08049c3c1afb24da2b4834bbb3443b"/></dir><dir name="Mysql4"><dir name="Apidebug"><file name="Collection.php" hash="7cc3fe74a46da1a4770b49eb7ac47f97"/></dir><dir name="Asyncorders"><file name="Collection.php" hash="e7b17fac028f7116c762e120b0f3f0a8"/></dir><dir name="Asyncsubscribers"><file name="Collection.php" hash="3458134c9a1ced7359db40f7b79a133f"/></dir><dir name="Bulksync"><dir name="Export"><file name="Collection.php" hash="ac64bc652233136189c504f678062374"/></dir><dir name="Import"><file name="Collection.php" hash="6cb3e09a817488f9bfa50f877a5c2b0b"/></dir><file name="Export.php" hash="eedc5a3549b3815f0d290eca3e0579df"/><file name="Import.php" hash="487fc6c0335ebf352081185d9afe3f88"/></dir><dir name="Ecommerce"><file name="Collection.php" hash="80319b6c991c510f1569800c80d384f1"/></dir><file name="Apidebug.php" hash="2699eec825e8fb88b1d572728c10b7bc"/><file name="Asyncorders.php" hash="3eb64d883705854ce7899fd891101c63"/><file name="Asyncsubscribers.php" hash="a067c1e951ce61558e00f3aa8e5d15ef"/><file name="Ecommerce.php" hash="b3290a6170c8c8f275dcd4300840ea26"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Account.php" hash="5bbf12b572234101af3e753ba74bcd41"/><file name="Attributes.php" hash="4ac1c98f3b3b84b2c93ddfcc3df5d817"/><file name="BulksyncDatasource.php" hash="36331ac3ecd034f914666a49e4d75cbc"/><file name="BulksyncStatus.php" hash="658f1f9d1ee7177d5dc094862bce155a"/><file name="Checkoutsubscribe.php" hash="28c8641a8fa4c336487af2227e152136"/><file name="CronProcessLimit.php" hash="3ca3a61f07b7aa84479eddda35efdde4"/><file name="CustomerGroup.php" hash="299b8514de098e02efe5393ebe7bdf65"/><file name="Ecommerce360.php" hash="24906da389cbf6b4a97c3edab5c7f020"/><file name="List.php" hash="bd9ef222e15d69b5c5038a98723d18c6"/><file name="OrderProcessLimit.php" hash="bc3add48e125caa904774cb6b669ba0c"/><file name="OrderStatus.php" hash="d3eeeee5d614e8fa83e258ce53cbed79"/><file name="Status.php" hash="e1e5cf6252241f39d0ceaff6f94d3afb"/><file name="TransactionalEmails.php" hash="b2f0d564a59372cba59d3aac7e4fe9e0"/><file name="WebhookDelete.php" hash="c90bbf8b0cf2a546c0f72193f8c605cf"/></dir></dir></dir><dir name="TransactionalEmail"><file name="Adapter.php" hash="5bd21b918a498119335ff50314e2b77c"/><file name="MANDRILL.php" hash="d652f3492c8c216f61cc5a00c4040f7a"/><file name="STS.php" hash="9270136789ad46dbd32e1961111d7287"/></dir><file name="Api.php" hash="ea7c720767bc58cb740d2f70100f699b"/><file name="Asyncorders.php" hash="3f60d1a1c1885268ae7e2ddfb1772feb"/><file name="Asyncsubscribers.php" hash="b79a42df357267205d7e74bb7c220755"/><file name="BulksyncExport.php" hash="71af9a6134b415a324dc9c937a5b2f8e"/><file name="BulksyncImport.php" hash="fb3716e235bc22cf91c4c17edf10ec23"/><file name="Cache.php" hash="89ac2fac903a566e6f6a3c0951bf274d"/><file name="Config.php" hash="276026d2d6ac8af349b7f2f82dc17668"/><file name="Cron.php" hash="6e7b16e3254dee366faf0bd7d6c7f278"/><file name="Ecommerce.php" hash="f4581befe128963df3e3d062b1bc4d55"/><file name="Ecommerce360.php" hash="71a18ee0bd84a087f06188bdb86f0801"/><file name="MCAPI.php" hash="6bfd33e4ee79f851df5631a7147ce897"/><file name="MCEXPORTAPI.php" hash="3f71435ffee2691df8ff4144ac69ea57"/><file name="Monkey.php" hash="a68f0c7c24a8cbac743bfdc011a7cdb2"/><file name="Observer.php" hash="3f54df1c83f443fa9da50834061ef7fb"/><file name="Subscriber.php" hash="70423d00c03e9fb7436921f93052c75d"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BulksyncController.php" hash="429d5cc4c53c9e6ffc2a74c7e810a519"/><file name="ConfigController.php" hash="88b6ba0888f6c5d468ebe0e30be56004"/><file name="EcommerceController.php" hash="8b1aed71ece9ab04f9a3c0d3b7f2f754"/><file name="TransactionalemailController.php" hash="728b259bb96370c9d0e13bf0ce2c3519"/></dir><dir name="Customer"><file name="AccountController.php" hash="14479dffeacd3c2421ce5822f7d7f190"/></dir><file name="SignupController.php" hash="e379f52f8ee0191a4c7289cd2afcd19d"/><file name="WebhookController.php" hash="020570c85501f2eac5d0558a36fbb664"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2ca3d47af5d16f1d5e0efb71346d3fe4"/><file name="config.xml" hash="207bdcbc6e56f8ac1b9793b83632f294"/><file name="system.xml" hash="9dd307a54fc966aade4676055e36f5b6"/></dir><dir name="sql"><dir name="monkey_setup"><file name="mysql4-install-0.0.1.php" hash="4df34769f4d5a8ceca90fd582500e3a9"/><file name="mysql4-upgrade-0.0.1-0.0.2.php" hash="d81147dab407bc55c59cddb5a764c53e"/><file name="mysql4-upgrade-0.0.2-0.0.3.php" hash="ce1925ff2ab03aa9fd6cbe43283ea37d"/><file name="mysql4-upgrade-0.0.3-0.0.4.php" hash="7f1e38bcf030e6346a9fd8321f1a4362"/><file name="mysql4-upgrade-0.0.4-0.0.5.php" hash="bbe6b895320effca77cc2c23431f043f"/><file name="mysql4-upgrade-0.0.5-0.0.6.php" hash="98b72d9ef4ec8078c09a1f641fc35a39"/><file name="mysql4-upgrade-0.0.6-0.0.7.php" hash="ea15755fc072e7c82b78063589360779"/><file name="mysql4-upgrade-1.0.10-1.0.11.php" hash="b2ec497921eb2bd9a97a318554fd980b"/><file name="mysql4-upgrade-1.1.21-1.1.22.php" hash="738e3d3e33c1a3a02bb101b89743cc5c"/><file name="mysql4-upgrade-1.1.23-1.1.24.php" hash="5a1bfdc8014edbc8b8c728954405a9f5"/><file name="mysql4-upgrade-1.1.5-1.1.6.php" hash="14750274ece5816d6c1ab490f7d610ab"/></dir></dir></dir><dir name="Mandrill"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="6ca5fb9bf9254323e1f2b4447203b562"/></dir><file name="Userinfo.php" hash="7cd34efc0231424c9e2f5e662154c41c"/></dir></dir><dir name="Templates"><dir name="Templates"><file name="Grid.php" hash="1ecdb6b04fbd16043de908f261353b8d"/></dir><file name="Templates.php" hash="1682fe6d39605a9839bf3cdb3c1185b7"/></dir><dir name="Users"><dir name="Senders"><file name="Grid.php" hash="292097a493de241540d3e3aea463241f"/></dir><file name="Senders.php" hash="4a4449652c495a9d4c12966ab007e7a4"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="86fcaa6a66a5a628ded7215172448daf"/></dir><dir name="Model"><dir name="Email"><file name="Template.php" hash="36b50b71357eca34537a56a3bfdefbe6"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Userinfo.php" hash="12a9c9c27c985efd021a4e6c7fdfcf5e"/></dir></dir><file name="Config.php" hash="2219d951bf6b2553ec0284b65d8d92a2"/></dir><file name="Customcollection.php" hash="9b5766c0393a54b4356254725b4d78b2"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Mandrill"><file name="UsersController.php" hash="e00f5ce8cea5f9ce47f71f270a31c021"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="8c0b7fda27820f53b3064f18a524c930"/><file name="config.xml" hash="d6a32581dd70bd0af40bc09d6fddfc48"/><file name="system.xml" hash="d05b90ca129297b6ffda52a4ba1fd26a"/></dir></dir><dir name="AbandonedCart"><dir name="Block"><dir name="Adminhtml"><dir name="Abandonedmails"><file name="Grid.php" hash="f2813a7ec47e20b78874a0dbb1461b3e"/></dir><dir name="Abandonedorder"><file name="Grid.php" hash="5ab9e3884d3306d78e78133f09e22614"/></dir><dir name="Dashboard"><file name="Sales.php" hash="b0d6fce3a5f4ef5a891c8578eb36ef97"/><file name="Totals.php" hash="4cd3c1e0d8d357c79ec6e7a2ed98c6a0"/></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="6358bc58857011c08dedcbab885b461f"/></dir><file name="Date.php" hash="323a49af281f06dfa72c1d3512257e04"/></dir></dir><file name="Abandonedmails.php" hash="c2714b5a6cb534c91564ebc340fe3f26"/><file name="Abandonedorder.php" hash="1a14da87647612a8773f34f70bc05dea"/><file name="Dashboard.php" hash="31037ac255eb804f55569e66231b06df"/></dir><dir name="Email"><dir name="Order"><file name="Items.php" hash="5c4be14f72d2cfe0a25058246d016d25"/></dir></dir><dir name="Popup"><file name="Emailcatcher.php" hash="7924007f7cd6dcd39e236408ef0c2c96"/></dir></dir><dir name="Helper"><file name="Data.php" hash="2464dec670f6e9b7d03fd61c38a872cf"/></dir><dir name="Model"><dir name="Resource"><dir name="Abtesting"><file name="Collection.php" hash="f96fe4be550bef6daabc5d211c86aca0"/></dir><dir name="Mailssent"><file name="Collection.php" hash="dc1e2c44eb53381d57d10a6bc08ad497"/></dir><dir name="Order"><file name="Collection.php" hash="a079410c43e1afbb428b7163d1537482"/></dir><dir name="Popup"><file name="Collection.php" hash="af37502f9802c7574318ab28a8fb1b16"/></dir><file name="Abtesting.php" hash="46e70f8507676e157ddec44f66094e59"/><file name="Mailssent.php" hash="80f0b4e3f29d10951362f07eb45a3ece"/><file name="Popup.php" hash="446921e9b1da1973c83665e8f749bbbb"/></dir><dir name="System"><dir name="Config"><file name="Automatic.php" hash="a4f5e052810187fb824933e76ea8a1cf"/><file name="Cmspage.php" hash="89bfcbe90a7b2f396a56b3f1fe72dbd2"/><file name="Customergroup.php" hash="74af027c3fb6745d0e45938f83394489"/><file name="Discounttype.php" hash="55c251fafbd10821d6c18c381c307888"/><file name="Maxemails.php" hash="63b860ace056552d159ada056eebfbd7"/><file name="Unit.php" hash="07fa0c25182538e08479cc4f91c7ca16"/><file name="Yesnovariation.php" hash="20aef15f9f6f616d59506dca75759203"/></dir></dir><file name="Abtesting.php" hash="fdf9df78b6656c898fd74fbcb3ec51e1"/><file name="Config.php" hash="3ad3355a37d3f7fde55121c525e1ee27"/><file name="Cron.php" hash="7d925dd6f9972db390a3541d88e5c9a0"/><file name="EventObserver.php" hash="bf5328b1b16d3e7e23a3cfcd92764b8f"/><file name="Mailssent.php" hash="e238f4116cb473cdcfb3a909d08adaa4"/><file name="Popup.php" hash="d2a4922acc0c5c3994cbc0b2114658b8"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="AbandonedmailsController.php" hash="71bacda4a15cff1752dfdd4c387b2923"/><file name="AbandonedorderController.php" hash="9544dc18469f02964c52639bad98842a"/></dir><file name="AbandonedController.php" hash="70aa47c1c680760e849e8fc032bfab08"/></dir><dir name="etc"><file name="adminhtml.xml" hash="64d9bdc34a543da52a8dafa7d6b33401"/><file name="config.xml" hash="1d74109c99c872f6123be4a93fd7dd24"/><file name="system.xml" hash="453d2557cd5c0996fa34ad4cca158b07"/></dir><dir name="sql"><dir name="ebizmarts_abandonedcart_setup"><file name="mysql4-install-0.1.0.php" hash="0e1a8c0391654c480773b78a50db5a83"/><file name="mysql4-upgrade-0.1.12-0.1.13.php" hash="4835436b744f8cbff61a66c2e345976f"/><file name="mysql4-upgrade-0.1.18-0.1.19.php" hash="e51b332cb70c81ee472b586fda4e8a7e"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="2e87d09a5008ac2f2432a25e08474c87"/><file name="mysql4-upgrade-0.1.20-0.1.21.php" hash="c461ba10961b4ee4e9385173d4264617"/><file name="mysql4-upgrade-0.1.29-0.1.30.php" hash="e9fdf4551cf19b488ed68ca0dd55ab67"/><file name="mysql4-upgrade-0.1.30-0.1.31.php" hash="2889ca071f7b974f2cd85a6b9405e541"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="60daa0d70a1af929a39d6e20ee52ee9c"/></dir></dir></dir><dir name="Autoresponder"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backtostock"><dir name="Fieldset"><file name="Hint.php" hash="196c96e0bdfb853c42510d8cef4bf69a"/></dir></dir><dir name="Birthday"><dir name="Fieldset"><file name="Hint.php" hash="bff790a4ecf1f7ed7ac5d966cb8d516f"/></dir></dir><dir name="Fieldset"><file name="Hint.php" hash="eea231bb3f99b0f3708c2d43144e0f44"/></dir><dir name="Review"><dir name="Fieldset"><file name="Hint.php" hash="d9906e111824893ef363926dd2b485eb"/></dir></dir><dir name="Wishlist"><dir name="Fieldset"><file name="Hint.php" hash="75a66f64700f02eebfa391f953bc42d0"/></dir></dir></dir></dir></dir><dir name="Backtostock"><file name="Notice.php" hash="30efc30519a1ecb31d39a5fe59a6ae90"/></dir><dir name="Customer"><dir name="Account"><file name="List.php" hash="755d6d07d113450617bc31e8bc039df0"/></dir></dir><dir name="Email"><dir name="Backtostock"><file name="Item.php" hash="178b97ceae8c488bf49cb44b6f5f5d11"/></dir><dir name="Related"><file name="Items.php" hash="831fda241af415c53d47274ecc395299"/></dir><dir name="Review"><file name="Items.php" hash="de3dd88f0a2399314c746b08cbe4ab82"/></dir><dir name="Wishlist"><file name="Items.php" hash="5c712e43bca1a83bf7592e082acca863"/></dir></dir><dir name="Review"><file name="Form.php" hash="cb10cbe1702bc6261874ed68eec47a00"/></dir><file name="Unsubscribe.php" hash="bb945f9a63f38ca0b6cdd2a0daed5416"/></dir><dir name="Helper"><file name="Data.php" hash="a2a16f441955f7ae5b9403355eddf986"/></dir><dir name="Model"><dir name="Resource"><dir name="Backtostock"><file name="Collection.php" hash="95a70c48dce1bac7fcb86447bb899057"/></dir><dir name="Backtostockalert"><file name="Collection.php" hash="c0c5d87c559d2e4011697b1a0ccf4846"/></dir><dir name="Review"><file name="Collection.php" hash="098061d250555679c9f609d2087ef9d4"/></dir><dir name="Unsubscribe"><file name="Collection.php" hash="11048027437c0a5bc1478e4f2cdcc51d"/></dir><dir name="Visited"><file name="Collection.php" hash="b09c0ce08ac30cc30f974e5c744eabf1"/></dir><file name="Backtostock.php" hash="85c29c73ba30f2fdf819fc88f5e03098"/><file name="Backtostockalert.php" hash="148ae085ef93a7cf6e52cdd60f1ca9a2"/><file name="Review.php" hash="cf78994db6e262e42a589b6538a45a32"/><file name="Unsubscribe.php" hash="3b9e4d09dbb7ba483a5d16b6312050e6"/><file name="Visited.php" hash="55f2d0c1f90b41e852ecbf964925dc10"/></dir><dir name="System"><dir name="Config"><file name="Automatic.php" hash="4de4d5c373fa1ea373751cbd5ed7efbc"/><file name="Couponcounter.php" hash="18049531633e26b8970935e6b9c73823"/><file name="Customergroup.php" hash="aa31f980b1d28248f137fe2a06b3ba2c"/><file name="Discounttype.php" hash="1228055f8abc3bffba6020f4bb4210e0"/><file name="Generaltype.php" hash="463210c06e00794b79df38a61dfa56c2"/><file name="Hours.php" hash="db8c055c1fc0628f5fad84fc15c6d389"/><file name="Newordertrigger.php" hash="757bcc13562d4a5b905d57920906411f"/><file name="Time.php" hash="4b491667d8ea9816b07f584e84556556"/></dir></dir><file name="Backtostock.php" hash="fa62a4685c70474a2ce3da394e68c597"/><file name="Backtostockalert.php" hash="eabe65c559ee1d93bc8b67dc0bb32a40"/><file name="Config.php" hash="4fe97a3b93bf7bc5eb0e5c1d9e99aada"/><file name="Cron.php" hash="6473f459efc10ec57cbb532ef7289b81"/><file name="EventObserver.php" hash="1c67aacde444cfc7c857d35e724c006f"/><file name="Review.php" hash="c14806dfb106363262b9911e8d06f628"/><file name="Unsubscribe.php" hash="cb20baf948256b9b70a13ed52ab91bab"/><file name="Visited.php" hash="2e9f119fc630cefc50f5a2a21546ebfc"/></dir><dir name="controllers"><file name="AutoresponderController.php" hash="5011f751a39a6bba50273f55fe13f9a0"/><file name="BacktostockController.php" hash="34b99cc172104773070d9d39cb290534"/></dir><dir name="etc"><file name="adminhtml.xml" hash="59a240f12b496566f1a2b1de5f053e96"/><file name="config.xml" hash="582dabe1778d0f993eeedc1626d93867"/><file name="system.xml" hash="56b7546b2afe366d2ef1cf52480d4f5f"/></dir><dir name="sql"><dir name="ebizmarts_autoresponder_setup"><file name="mysql4-install-0.1.0.php" hash="d2152df00146562b30910ebe36c9b4e8"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="2ab92d2cf0f5fa7ccf7b61d9ab142a01"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="af5c814496fe07a20aac583cd68cb0b7"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="378accc07eb80b16029db84f56bed683"/><file name="mysql4-upgrade-0.1.9-0.1.10.php" hash="53cc6beed11e8631c11a008c5fd78ce1"/></dir></dir></dir><dir name="SweetMonkey"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="a1d28320ed21eaa6c20aa98c0b4e3492"/></dir><dir name="Form"><dir name="Field"><file name="Mapfields.php" hash="a0dfcfa3e1e22bdb33005a999cb0867b"/></dir></dir><file name="Autovars.php" hash="fc3ebb5ffe5344ef74a294547614c28f"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="83c32ef3e5433e701a10ef9cc5370d04"/></dir><dir name="Model"><file name="Cron.php" hash="a253d6bdbb03ca2d1fa87fde52c934ee"/><file name="Observer.php" hash="6bacb0785fe1d439ff6225597feb4675"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MageMonkeyController.php" hash="eee768753e4454f74a5b3b08f68f721f"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="8a81e6639cd53c96717a6b993d5fcd93"/><file name="config.xml" hash="250de9b7b12b4c908275fd8056eae68e"/><file name="system.xml" hash="93e8f26427a0df9183f6680441ce23f6"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ebizmarts_MageMonkey.xml" hash="951aa15bc51345726e05080bd5fc084b"/><file name="Ebizmarts_Mandrill.xml" hash="ea4b352b5a0233330ecde76a0f9113dd"/><file name="Ebizmarts_AbandonedCart.xml" hash="48c4cfe8246d5a995e2836c43ab38d74"/><file name="Ebizmarts_Autoresponder.xml" hash="97302f94f5893147db18c4034d135256"/><file name="Ebizmarts_SweetMonkey.xml" hash="05d9393c17c76a589fd7681ed668d53f"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="ebizmarts"><file name="abandonedcart.xml" hash="14282d8f8739578d51c57def5df1227a"/><file name="autoresponder.xml" hash="d8dfb68cfd7c838cf29e9281a9a76c36"/></dir><file name="magemonkey.xml" hash="8eef43f9d728e252a5f7d7b6cea93a19"/></dir><dir name="template"><dir name="magemonkey"><dir name="checkout"><file name="subscribe.phtml" hash="41916fd7fccc22a83380dd5642b6a8cc"/></dir><file name="lists.phtml" hash="17f70d4e4bff4e14104381f927d80538"/></dir><dir name="ebizmarts_abandonedcart"><dir name="email"><dir name="order"><dir name="items"><dir name="order"><file name="default.phtml" hash="c078d029b2065e8b1938c3cfb24e8219"/></dir></dir><file name="items.phtml" hash="7be104a21130974fd4aae1f8727d5e7d"/></dir></dir><dir name="popup"><file name="emailcatcher.phtml" hash="47c12ed73112bfe4a528ef515e4560a9"/></dir></dir><dir name="ebizmarts"><dir name="autoresponder"><dir name="backtostock"><dir name="catalog"><dir name="product"><file name="form.phtml" hash="2682fda0d10238764db344fcc0b743dc"/><file name="notice.phtml" hash="ba7963278c9ed51066c736cdc0b73978"/></dir></dir><file name="item.phtml" hash="55f82ee9207c9e5a2d6fbd77ffc9921f"/></dir><dir name="customer"><file name="list.phtml" hash="21d2f116e2f509943175c43bc5863582"/></dir><dir name="related"><file name="items.phtml" hash="7de2510a4dcfc9627a0dc514360bf423"/></dir><dir name="review"><file name="items.phtml" hash="d409b68a2bc8cbe6779f11cc2784d022"/></dir><dir name="wishlist"><file name="items.phtml" hash="73a0cf8ee106d4cff7a77c9c4a69e363"/></dir><file name="unsubscribe.phtml" hash="ca8ed1c5810e07f1cdc91edb64420417"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="ebizmarts"><file name="mandrill.xml" hash="ba93e973a9019841c7d914ecd729983c"/><file name="abandonedcart.xml" hash="9ed91dab216911a13a2669bd81734180"/></dir><file name="magemonkey.xml" hash="4a2ba63a9d3002774b622e76339e6fbb"/></dir><dir name="template"><dir name="magemonkey"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="2fc348d98ca7fbc41fb2a13e6cfb78de"/></dir><file name="oauth_wizard.phtml" hash="91b3472b4e9a5bc26851b76bfcea59c5"/><file name="resetlocal360.phtml" hash="ee9a0fa8f8b09323b9f0d7786f645c8f"/><file name="resetremote360.phtml" hash="7194a90ec514df7d078bb4313a25c30b"/></dir></dir></dir><dir name="ebizmarts"><dir name="mandrill"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="3d00dbc6b6141e8e0b639ac92ac95da5"/></dir></dir></dir></dir><dir name="abandonedcart"><dir name="dashboard"><file name="index.phtml" hash="31a02b6aa63614bb2a52044195568f15"/><file name="salebar.phtml" hash="7a8c978ff415853550f9b1a3cbabfd1c"/><file name="totalbar.phtml" hash="95cb90a952f5548481c180004e39b7f1"/></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="e5bbebab8f645b423530764b4c844e47"/></dir></dir></dir></dir><dir name="autoresponder"><dir name="system"><dir name="config"><dir name="backtostock"><dir name="fieldset"><file name="hint.phtml" hash="623380a9c486eae57da00de6bd8b843d"/></dir></dir><dir name="birthday"><dir name="fieldset"><file name="hint.phtml" hash="d7f944a685769a46cb709f89c6e56f3b"/></dir></dir><dir name="fieldset"><file name="hint.phtml" hash="83cd4fef418fdcda52b3bb5e534fda85"/></dir><dir name="review"><dir name="fieldset"><file name="hint.phtml" hash="205b3fac2bc9682cdbdc9e3a8ec688df"/></dir></dir><dir name="wishlist"><dir name="fieldset"><file name="hint.phtml" hash="563ece5feca65f3ff728b89929cb2339"/></dir></dir></dir></dir></dir></dir><dir name="sweetmonkey"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="16d8c86502ff2a2a01c7e7e8a421bfcb"/></dir><file name="autovars.phtml" hash="53da8402573546ecdcbe2f5e9b3ab57a"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="ebizmarts"><dir name="abandonedcart"><file name="abandoned_cart_mail_1.html" hash="36ceaf0e511ecb2c785fb482c634ed2c"/><file name="abandoned_cart_mail_2.html" hash="ab628f7bf4f82d44d8d9a5b39c838e00"/><file name="abandoned_cart_mail_3.html" hash="c46eef13c346494f26f2e01ff7de9de2"/><file name="abandoned_cart_mail_generic.html" hash="c87513fa9e7fc18035c9b4421c51478e"/><file name="popup_coupon_template.html" hash="7411805f6751997e3de8a4f11196c14e"/></dir><dir name="autoresponder"><file name="backtostock.html" hash="f909f0edf431e2da29281904612bd902"/><file name="birthday.html" hash="716502b8dd97b4b485264c18e7c75317"/><file name="neworder.html" hash="14db5244b8bb8e7b33ad32991ea8060f"/><file name="noactivity.html" hash="ca5ba93441cf80ccf0ea79aef039fc77"/><file name="relatedproducts.html" hash="9cd19f74d0c42967526d54a197453945"/><file name="review.html" hash="0d9d872e4a0d0290cea079ccec3658c5"/><file name="reviewcoupon.html" hash="925152cf7f223b6caf92f0a502233e03"/><file name="visitedproducts.html" hash="fc89e6fd3007ca57a6359553f389a656"/><file name="wishlist.html" hash="804468d3e1f758988c633d3b8eb547ea"/></dir></dir></dir></dir><file name="Ebizmarts_MageMonkey.csv" hash="181e91ed91dfea5fe7dab66af5719af8"/><file name="Ebizmarts_Mandrill.csv" hash="3dac3af57664fd34f5eda8abf4098ee0"/><file name="Ebizmarts_AbandonedCart.csv" hash="214bcd0e8cd6153c48fab236dcfdba1b"/><file name="Ebizmarts_Autoresponder.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="Ebizmarts_SweetMonkey.csv" hash="f0cdb51ba2052ce7f7ec1c9885ee5d3c"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="magemonkey"><file name="magemonkey.css" hash="2072357ef844855f7a4607245b1e9a17"/><file name="magemonkey.js" hash="1a515d6697d533ee012754dd20e60345"/><file name="mailchimp-connected-ebizmarts-title.png" hash="c6bcb1aa606ecd3b0a9753bb48ddeb58"/><file name="mailchimp-ico.png" hash="14978ec398cede4060bc9b00365bb6c5"/><file name="mailchimp-section-background.png" hash="d4536261c6a3534fbb855428c0cca62c"/><file name="mailchimp-tab.png" hash="61972b4e063364071e81d8c9e10d8feb"/></dir><dir name="abandonedcart"><file name="abandonedcart.css" hash="bd6049fa8b17a1060e8a63fa29aefd94"/></dir><dir name="ebizmarts"><dir name="mandrill"><file name="mandrill-tab.png" hash="d7eaf9deef355e4b8b55a96070b90ffe"/><file name="mandrill.css" hash="d93f1f52db38195a4f85d20de519151e"/></dir><file name="ebizmarts-tab.png" hash="6dfa08c5cd4329d1df6e7b71fb1f925a"/><file name="ebizmarts.css" hash="a579734639953c1970ec26f56dda5837"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="magemonkey"><file name="magemonkey.css" hash="8f25ca79fc6901215f713f0e048c4a9f"/><file name="monkey.js" hash="5984cd563aee48b7ba648066f733113a"/></dir></dir></dir></dir></target><target name="mage"><dir name="lib"><dir name="Mandrill"><dir name="Mandrill"><file name="Exceptions.php" hash="54d952267c004cddeedd8d9be07698c8"/><file name="Exports.php" hash="3ed368771a7174af0e01287e3a3e030f"/><file name="Inbound.php" hash="32378db89f2f47fe158577c256837896"/><file name="Internal.php" hash="fa680d47c780922a111078827cad1505"/><file name="Ips.php" hash="c70c08b34454d2e7aebc31101cfdca81"/><file name="Messages.php" hash="f1f3c20b6c872c72dcc33790d6a3adf4"/><file name="Metadata.php" hash="57820ae2032206334fb6e6d9b12f4df2"/><file name="Rejects.php" hash="f40f9ef016c338c6ae9d161c3112eea6"/><file name="Senders.php" hash="875ddbeff3f920397c73c2c2797f3eea"/><file name="Subaccounts.php" hash="9b6b61a8e0364c9f917952deffe0320c"/><file name="Tags.php" hash="ee2f9e328d4d49aa8b0289978f7375b0"/><file name="Templates.php" hash="9920cf5d10bdcb5416193435c425f123"/><file name="Urls.php" hash="184c17ebb031f1f6e6dad687a4bf767d"/><file name="Users.php" hash="826dac98663eefce2f5ccc4a5b0d38e9"/><file name="Webhooks.php" hash="37ea24a982630aa321444b85392f3397"/><file name="Whitelists.php" hash="d132144d50c3b713c98ad699984e4e38"/></dir><file name="Mandrill.php" hash="cb6620ee6d4767e9b4edb1d574fe5dbe"/><file name="Message.php" hash="784920e095d8d9f0269b46f00071fcc9"/></dir></dir><dir name="js"><dir name="ebizmarts"><dir name="abandonedcart"><file name="popup.css" hash="1dd95b72b4a6dc211f09e60114605af5"/></dir><dir name="autoresponders"><file name="visitedproducts.js" hash="61ef8d19642d349a19a43d018888f205"/><file name="visitedproductsstorecodes.js" hash="2cea5956611572cae6140db11c6d4672"/></dir><dir name="magemonkey"><file name="campaignCatcher.js" hash="094f0706dc7cb652f6473d7549d975ac"/></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ebizmarts_MageMonkey</name>
4
+ <version>1.1.33</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>MailChimp integration for Magento by Ebizmarts</summary>
10
  <description>Full MailChimp integration, automatic webhooks, multiple lists, interest groups</description>
11
+ <notes>1.1.33&#xD;
12
  --------&#xD;
13
+ Improvement on the code display to fit Magento new standards.&#xD;
14
+ &#xD;
15
+ Removed filter to resend subscription confirmation email.</notes>
16
  <authors><author><name>Ebizmarts Development Team</name><user>auto-converted</user><email>info@ebizmarts.com</email></author></authors>
17
+ <date>2015-05-11</date>
18
+ <time>17:41:13</time>
19
+ <contents><target name="magecommunity"><dir name="Ebizmarts"><dir name="MageMonkey"><dir name="Block"><dir name="Adminhtml"><dir name="Bulksync"><dir name="Export"><file name="Form.php" hash="ae560b94bb9e440d660be69f5165b69f"/></dir><dir name="Import"><file name="Form.php" hash="0421281b9cfbc446329d7482c24c2c11"/></dir><dir name="Queue"><file name="Grid.php" hash="23b3edec3bc13fae8aee5b7292c4d4d1"/></dir><dir name="QueueExport"><file name="Grid.php" hash="68ec401dc23cddf8a1362c53aaab69b2"/></dir><dir name="QueueImport"><file name="Grid.php" hash="a695371e46328137d025b0fdf09944fe"/></dir><file name="Export.php" hash="62714f95580e489105914270b889a142"/><file name="Import.php" hash="d573582da25766aecba918d299c02586"/><file name="Queue.php" hash="c3cea1da02e0a09d7876958058ee091e"/><file name="QueueExport.php" hash="69536eee264346535f1c786d61b3cf84"/><file name="QueueImport.php" hash="d9fbc0d22f94df54f71116d0d484d1a3"/></dir><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Memberactivity.php" hash="55fbb4519c6d862948dc4d8bf4416cfb"/></dir></dir></dir><dir name="Ecommerce"><file name="Grid.php" hash="b1ad37ffe9fe0752356d29a6548b0434"/></dir><dir name="Ecommerceapi"><dir name="Renderer"><file name="Items.php" hash="d72cfedf0cafc938becf9bd52801ba3a"/></dir><file name="Grid.php" hash="ee1be42cb6c893e3c59cac784df67fb3"/></dir><dir name="Memberactivity"><file name="Grid.php" hash="f4b341dd60b361098394618cf3382620"/></dir><dir name="Renderer"><file name="Date.php" hash="6e4e52403ec55df3aa2183fd4b51b095"/><file name="Importypes.php" hash="87c7a222e403781fcd8ee08cf0b489ba"/><file name="Lists.php" hash="15f5b5e087b49396a6f844e0f1bfb6b1"/><file name="Progress.php" hash="31eaaa5a7e99b21a4ed705971fe1001d"/><file name="Yesno.php" hash="c3173a8e8ea2d5f03531e7d996bbd259"/></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="31bf492c4e6137312c55bc437bf226cf"/></dir><dir name="Form"><dir name="Field"><file name="Mapfields.php" hash="8f2a10ca1a1d239b3b231ca2cee5f96e"/></dir></dir><file name="Account.php" hash="fccf1faac2682d754655631e6451c026"/><file name="Date.php" hash="455120f4f2e8d7801f3c220e231b6789"/><file name="OauthWizard.php" hash="bd79f8b43d71137337e732fbeb415ffb"/><file name="ResetLocalEcommerce.php" hash="e17208b58da80e06276ca1910c622715"/><file name="ResetRemoteEcommerce.php" hash="47e2f24d108e16721ac26279431815bb"/></dir></dir><file name="Ecommerce.php" hash="48c237e8cc1223ad26a88d2409679fec"/><file name="Ecommerceapi.php" hash="a9f659502d96bcd1a69a88d15fcab4f9"/></dir><dir name="Checkout"><file name="Subscribe.php" hash="14de0075005dafe3363716e3ffd10d20"/></dir><dir name="Customer"><dir name="Account"><file name="Lists.php" hash="64f0e5a8360750f6b19d8b5db0fcac23"/></dir></dir><file name="Lists.php" hash="af037bb911e5b69b4817b068e84b9509"/><file name="Signup.php" hash="93b0e787e63a90a5fb4bacba1e03bd05"/></dir><dir name="Helper"><file name="Cache.php" hash="4e6cd9724c2788056aacacd37f5699cc"/><file name="Data.php" hash="c8907e05617f50f82b8d56bd6b9b1426"/><file name="Export.php" hash="91f24805e9cbbe124f0c99cb8f1f1272"/><file name="Oauth2.php" hash="684a7b71d97b438081ebf332057ec8ea"/></dir><dir name="Model"><dir name="Custom"><file name="Collection.php" hash="304d372c1b8bd8d8d09dd743e03cdf66"/></dir><dir name="Email"><file name="Template.php" hash="81c9f040cf931dfb9e2a2484d9cc0b09"/></dir><dir name="Feed"><file name="Updates.php" hash="fb08049c3c1afb24da2b4834bbb3443b"/></dir><dir name="Mysql4"><dir name="Apidebug"><file name="Collection.php" hash="7cc3fe74a46da1a4770b49eb7ac47f97"/></dir><dir name="Asyncorders"><file name="Collection.php" hash="e7b17fac028f7116c762e120b0f3f0a8"/></dir><dir name="Asyncsubscribers"><file name="Collection.php" hash="3458134c9a1ced7359db40f7b79a133f"/></dir><dir name="Bulksync"><dir name="Export"><file name="Collection.php" hash="ac64bc652233136189c504f678062374"/></dir><dir name="Import"><file name="Collection.php" hash="6cb3e09a817488f9bfa50f877a5c2b0b"/></dir><file name="Export.php" hash="eedc5a3549b3815f0d290eca3e0579df"/><file name="Import.php" hash="487fc6c0335ebf352081185d9afe3f88"/></dir><dir name="Ecommerce"><file name="Collection.php" hash="80319b6c991c510f1569800c80d384f1"/></dir><file name="Apidebug.php" hash="2699eec825e8fb88b1d572728c10b7bc"/><file name="Asyncorders.php" hash="3eb64d883705854ce7899fd891101c63"/><file name="Asyncsubscribers.php" hash="a067c1e951ce61558e00f3aa8e5d15ef"/><file name="Ecommerce.php" hash="b3290a6170c8c8f275dcd4300840ea26"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Account.php" hash="5bbf12b572234101af3e753ba74bcd41"/><file name="Attributes.php" hash="4ac1c98f3b3b84b2c93ddfcc3df5d817"/><file name="BulksyncDatasource.php" hash="36331ac3ecd034f914666a49e4d75cbc"/><file name="BulksyncStatus.php" hash="658f1f9d1ee7177d5dc094862bce155a"/><file name="Checkoutsubscribe.php" hash="28c8641a8fa4c336487af2227e152136"/><file name="CronProcessLimit.php" hash="3ca3a61f07b7aa84479eddda35efdde4"/><file name="CustomerGroup.php" hash="299b8514de098e02efe5393ebe7bdf65"/><file name="Ecommerce360.php" hash="24906da389cbf6b4a97c3edab5c7f020"/><file name="List.php" hash="bd9ef222e15d69b5c5038a98723d18c6"/><file name="OrderProcessLimit.php" hash="bc3add48e125caa904774cb6b669ba0c"/><file name="OrderStatus.php" hash="d3eeeee5d614e8fa83e258ce53cbed79"/><file name="Status.php" hash="e1e5cf6252241f39d0ceaff6f94d3afb"/><file name="TransactionalEmails.php" hash="b2f0d564a59372cba59d3aac7e4fe9e0"/><file name="WebhookDelete.php" hash="c90bbf8b0cf2a546c0f72193f8c605cf"/></dir></dir></dir><file name="Api.php" hash="ea7c720767bc58cb740d2f70100f699b"/><file name="Asyncorders.php" hash="3f60d1a1c1885268ae7e2ddfb1772feb"/><file name="Asyncsubscribers.php" hash="b79a42df357267205d7e74bb7c220755"/><file name="BulksyncExport.php" hash="71af9a6134b415a324dc9c937a5b2f8e"/><file name="BulksyncImport.php" hash="fb3716e235bc22cf91c4c17edf10ec23"/><file name="Cache.php" hash="89ac2fac903a566e6f6a3c0951bf274d"/><file name="Config.php" hash="276026d2d6ac8af349b7f2f82dc17668"/><file name="Cron.php" hash="3d0160a020ac8fd3b95251d40452d0b1"/><file name="Ecommerce.php" hash="f4581befe128963df3e3d062b1bc4d55"/><file name="Ecommerce360.php" hash="71a18ee0bd84a087f06188bdb86f0801"/><file name="MCAPI.php" hash="c86a58e5a40b709aefecd05c813ee7be"/><file name="MCEXPORTAPI.php" hash="810b1c7b0f6daf93e11c7fbbc90980a3"/><file name="Monkey.php" hash="fe7cfdd6ef4207d8a279908265d2bc0f"/><file name="Observer.php" hash="1c1a586fbc7517cab08868c5ec5288bf"/><file name="Subscriber.php" hash="70423d00c03e9fb7436921f93052c75d"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BulksyncController.php" hash="429d5cc4c53c9e6ffc2a74c7e810a519"/><file name="ConfigController.php" hash="1a2072d337166ba723625b40fd5e924b"/><file name="EcommerceController.php" hash="8b1aed71ece9ab04f9a3c0d3b7f2f754"/></dir><dir name="Customer"><file name="AccountController.php" hash="14479dffeacd3c2421ce5822f7d7f190"/></dir><file name="SignupController.php" hash="e379f52f8ee0191a4c7289cd2afcd19d"/><file name="WebhookController.php" hash="319878266b5463d5d8591b6a4fb5e096"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2ca3d47af5d16f1d5e0efb71346d3fe4"/><file name="config.xml" hash="23f35882575a2ef68f70b13f923e6635"/><file name="system.xml" hash="9dd307a54fc966aade4676055e36f5b6"/></dir><dir name="sql"><dir name="monkey_setup"><file name="mysql4-install-0.0.1.php" hash="4df34769f4d5a8ceca90fd582500e3a9"/><file name="mysql4-upgrade-0.0.1-0.0.2.php" hash="d81147dab407bc55c59cddb5a764c53e"/><file name="mysql4-upgrade-0.0.2-0.0.3.php" hash="ce1925ff2ab03aa9fd6cbe43283ea37d"/><file name="mysql4-upgrade-0.0.3-0.0.4.php" hash="7f1e38bcf030e6346a9fd8321f1a4362"/><file name="mysql4-upgrade-0.0.4-0.0.5.php" hash="bbe6b895320effca77cc2c23431f043f"/><file name="mysql4-upgrade-0.0.5-0.0.6.php" hash="98b72d9ef4ec8078c09a1f641fc35a39"/><file name="mysql4-upgrade-0.0.6-0.0.7.php" hash="ea15755fc072e7c82b78063589360779"/><file name="mysql4-upgrade-1.0.10-1.0.11.php" hash="b2ec497921eb2bd9a97a318554fd980b"/><file name="mysql4-upgrade-1.1.21-1.1.22.php" hash="738e3d3e33c1a3a02bb101b89743cc5c"/><file name="mysql4-upgrade-1.1.23-1.1.24.php" hash="5a1bfdc8014edbc8b8c728954405a9f5"/><file name="mysql4-upgrade-1.1.5-1.1.6.php" hash="14750274ece5816d6c1ab490f7d610ab"/></dir></dir></dir><dir name="Mandrill"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="6ca5fb9bf9254323e1f2b4447203b562"/></dir><file name="Userinfo.php" hash="7cd34efc0231424c9e2f5e662154c41c"/></dir></dir><dir name="Templates"><dir name="Templates"><file name="Grid.php" hash="1ecdb6b04fbd16043de908f261353b8d"/></dir><file name="Templates.php" hash="1682fe6d39605a9839bf3cdb3c1185b7"/></dir><dir name="Users"><dir name="Senders"><file name="Grid.php" hash="292097a493de241540d3e3aea463241f"/></dir><file name="Senders.php" hash="4a4449652c495a9d4c12966ab007e7a4"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="86fcaa6a66a5a628ded7215172448daf"/></dir><dir name="Model"><dir name="Email"><file name="Template.php" hash="b19533f9d67828bb56e1cec4d36c2c85"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Userinfo.php" hash="12a9c9c27c985efd021a4e6c7fdfcf5e"/></dir></dir><file name="Config.php" hash="2219d951bf6b2553ec0284b65d8d92a2"/></dir><file name="Customcollection.php" hash="9b5766c0393a54b4356254725b4d78b2"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Mandrill"><file name="UsersController.php" hash="e00f5ce8cea5f9ce47f71f270a31c021"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="8c0b7fda27820f53b3064f18a524c930"/><file name="config.xml" hash="86f2eb83f23e7998b2d23ba9af86cbb8"/><file name="system.xml" hash="d05b90ca129297b6ffda52a4ba1fd26a"/></dir></dir><dir name="AbandonedCart"><dir name="Block"><dir name="Adminhtml"><dir name="Abandonedmails"><file name="Grid.php" hash="f2813a7ec47e20b78874a0dbb1461b3e"/></dir><dir name="Abandonedorder"><file name="Grid.php" hash="5ab9e3884d3306d78e78133f09e22614"/></dir><dir name="Dashboard"><file name="Sales.php" hash="b0d6fce3a5f4ef5a891c8578eb36ef97"/><file name="Totals.php" hash="4cd3c1e0d8d357c79ec6e7a2ed98c6a0"/></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="6358bc58857011c08dedcbab885b461f"/></dir><file name="Date.php" hash="323a49af281f06dfa72c1d3512257e04"/></dir></dir><file name="Abandonedmails.php" hash="c2714b5a6cb534c91564ebc340fe3f26"/><file name="Abandonedorder.php" hash="1a14da87647612a8773f34f70bc05dea"/><file name="Dashboard.php" hash="c27d5ec29455176fff7e2fac86fcce21"/></dir><dir name="Email"><dir name="Order"><file name="Items.php" hash="5c4be14f72d2cfe0a25058246d016d25"/></dir></dir><dir name="Popup"><file name="Emailcatcher.php" hash="7924007f7cd6dcd39e236408ef0c2c96"/></dir></dir><dir name="Helper"><file name="Data.php" hash="2464dec670f6e9b7d03fd61c38a872cf"/></dir><dir name="Model"><dir name="Resource"><dir name="Abtesting"><file name="Collection.php" hash="f96fe4be550bef6daabc5d211c86aca0"/></dir><dir name="Mailssent"><file name="Collection.php" hash="dc1e2c44eb53381d57d10a6bc08ad497"/></dir><dir name="Order"><file name="Collection.php" hash="a079410c43e1afbb428b7163d1537482"/></dir><dir name="Popup"><file name="Collection.php" hash="af37502f9802c7574318ab28a8fb1b16"/></dir><file name="Abtesting.php" hash="46e70f8507676e157ddec44f66094e59"/><file name="Mailssent.php" hash="80f0b4e3f29d10951362f07eb45a3ece"/><file name="Popup.php" hash="446921e9b1da1973c83665e8f749bbbb"/></dir><dir name="System"><dir name="Config"><file name="Automatic.php" hash="a4f5e052810187fb824933e76ea8a1cf"/><file name="Cmspage.php" hash="89bfcbe90a7b2f396a56b3f1fe72dbd2"/><file name="Customergroup.php" hash="74af027c3fb6745d0e45938f83394489"/><file name="Discounttype.php" hash="55c251fafbd10821d6c18c381c307888"/><file name="Maxemails.php" hash="63b860ace056552d159ada056eebfbd7"/><file name="Unit.php" hash="07fa0c25182538e08479cc4f91c7ca16"/><file name="Yesnovariation.php" hash="20aef15f9f6f616d59506dca75759203"/></dir></dir><file name="Abtesting.php" hash="fdf9df78b6656c898fd74fbcb3ec51e1"/><file name="Config.php" hash="3ad3355a37d3f7fde55121c525e1ee27"/><file name="Cron.php" hash="ab1b5fbf46a12b8ed3b2c1608338d43c"/><file name="EventObserver.php" hash="aea4d7cd9f79be176b2f800686910080"/><file name="Mailssent.php" hash="e238f4116cb473cdcfb3a909d08adaa4"/><file name="Popup.php" hash="d2a4922acc0c5c3994cbc0b2114658b8"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="AbandonedmailsController.php" hash="71bacda4a15cff1752dfdd4c387b2923"/><file name="AbandonedorderController.php" hash="9544dc18469f02964c52639bad98842a"/></dir><file name="AbandonedController.php" hash="70aa47c1c680760e849e8fc032bfab08"/></dir><dir name="etc"><file name="adminhtml.xml" hash="64d9bdc34a543da52a8dafa7d6b33401"/><file name="config.xml" hash="b1947a0ab0ed4d3dbbb455ec9c1a3174"/><file name="system.xml" hash="453d2557cd5c0996fa34ad4cca158b07"/></dir><dir name="sql"><dir name="ebizmarts_abandonedcart_setup"><file name="mysql4-install-0.1.0.php" hash="0e1a8c0391654c480773b78a50db5a83"/><file name="mysql4-upgrade-0.1.12-0.1.13.php" hash="4835436b744f8cbff61a66c2e345976f"/><file name="mysql4-upgrade-0.1.18-0.1.19.php" hash="e51b332cb70c81ee472b586fda4e8a7e"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="2e87d09a5008ac2f2432a25e08474c87"/><file name="mysql4-upgrade-0.1.20-0.1.21.php" hash="c461ba10961b4ee4e9385173d4264617"/><file name="mysql4-upgrade-0.1.29-0.1.30.php" hash="e9fdf4551cf19b488ed68ca0dd55ab67"/><file name="mysql4-upgrade-0.1.30-0.1.31.php" hash="2889ca071f7b974f2cd85a6b9405e541"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="60daa0d70a1af929a39d6e20ee52ee9c"/></dir></dir></dir><dir name="Autoresponder"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backtostock"><dir name="Fieldset"><file name="Hint.php" hash="196c96e0bdfb853c42510d8cef4bf69a"/></dir></dir><dir name="Birthday"><dir name="Fieldset"><file name="Hint.php" hash="bff790a4ecf1f7ed7ac5d966cb8d516f"/></dir></dir><dir name="Fieldset"><file name="Hint.php" hash="eea231bb3f99b0f3708c2d43144e0f44"/></dir><dir name="Review"><dir name="Fieldset"><file name="Hint.php" hash="d9906e111824893ef363926dd2b485eb"/></dir></dir><dir name="Wishlist"><dir name="Fieldset"><file name="Hint.php" hash="75a66f64700f02eebfa391f953bc42d0"/></dir></dir></dir></dir></dir><dir name="Backtostock"><file name="Notice.php" hash="30efc30519a1ecb31d39a5fe59a6ae90"/></dir><dir name="Customer"><dir name="Account"><file name="List.php" hash="755d6d07d113450617bc31e8bc039df0"/></dir></dir><dir name="Email"><dir name="Backtostock"><file name="Item.php" hash="178b97ceae8c488bf49cb44b6f5f5d11"/></dir><dir name="Related"><file name="Items.php" hash="831fda241af415c53d47274ecc395299"/></dir><dir name="Review"><file name="Items.php" hash="de3dd88f0a2399314c746b08cbe4ab82"/></dir><dir name="Wishlist"><file name="Items.php" hash="5c712e43bca1a83bf7592e082acca863"/></dir></dir><dir name="Review"><file name="Form.php" hash="cb10cbe1702bc6261874ed68eec47a00"/></dir><file name="Unsubscribe.php" hash="bb945f9a63f38ca0b6cdd2a0daed5416"/></dir><dir name="Helper"><file name="Data.php" hash="a2a16f441955f7ae5b9403355eddf986"/></dir><dir name="Model"><dir name="Resource"><dir name="Backtostock"><file name="Collection.php" hash="95a70c48dce1bac7fcb86447bb899057"/></dir><dir name="Backtostockalert"><file name="Collection.php" hash="c0c5d87c559d2e4011697b1a0ccf4846"/></dir><dir name="Review"><file name="Collection.php" hash="098061d250555679c9f609d2087ef9d4"/></dir><dir name="Unsubscribe"><file name="Collection.php" hash="11048027437c0a5bc1478e4f2cdcc51d"/></dir><dir name="Visited"><file name="Collection.php" hash="b09c0ce08ac30cc30f974e5c744eabf1"/></dir><file name="Backtostock.php" hash="85c29c73ba30f2fdf819fc88f5e03098"/><file name="Backtostockalert.php" hash="148ae085ef93a7cf6e52cdd60f1ca9a2"/><file name="Review.php" hash="cf78994db6e262e42a589b6538a45a32"/><file name="Unsubscribe.php" hash="3b9e4d09dbb7ba483a5d16b6312050e6"/><file name="Visited.php" hash="55f2d0c1f90b41e852ecbf964925dc10"/></dir><dir name="System"><dir name="Config"><file name="Automatic.php" hash="4de4d5c373fa1ea373751cbd5ed7efbc"/><file name="Couponcounter.php" hash="18049531633e26b8970935e6b9c73823"/><file name="Customergroup.php" hash="aa31f980b1d28248f137fe2a06b3ba2c"/><file name="Discounttype.php" hash="1228055f8abc3bffba6020f4bb4210e0"/><file name="Generaltype.php" hash="463210c06e00794b79df38a61dfa56c2"/><file name="Hours.php" hash="db8c055c1fc0628f5fad84fc15c6d389"/><file name="Newordertrigger.php" hash="757bcc13562d4a5b905d57920906411f"/><file name="Time.php" hash="4b491667d8ea9816b07f584e84556556"/></dir></dir><file name="Backtostock.php" hash="fa62a4685c70474a2ce3da394e68c597"/><file name="Backtostockalert.php" hash="eabe65c559ee1d93bc8b67dc0bb32a40"/><file name="Config.php" hash="4fe97a3b93bf7bc5eb0e5c1d9e99aada"/><file name="Cron.php" hash="64c5495683f830ae0c1e42d888d1d4d8"/><file name="EventObserver.php" hash="16d9293f4fec047ad75e2f3adc99a44a"/><file name="Review.php" hash="c14806dfb106363262b9911e8d06f628"/><file name="Unsubscribe.php" hash="cb20baf948256b9b70a13ed52ab91bab"/><file name="Visited.php" hash="2e9f119fc630cefc50f5a2a21546ebfc"/></dir><dir name="controllers"><file name="AutoresponderController.php" hash="60f7a997438b80a76a7c5c08db8d11d5"/><file name="BacktostockController.php" hash="34b99cc172104773070d9d39cb290534"/></dir><dir name="etc"><file name="adminhtml.xml" hash="59a240f12b496566f1a2b1de5f053e96"/><file name="config.xml" hash="1fd74912d3623f85c91f7a5c3203f082"/><file name="system.xml" hash="56b7546b2afe366d2ef1cf52480d4f5f"/></dir><dir name="sql"><dir name="ebizmarts_autoresponder_setup"><file name="mysql4-install-0.1.0.php" hash="d2152df00146562b30910ebe36c9b4e8"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="2ab92d2cf0f5fa7ccf7b61d9ab142a01"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="af5c814496fe07a20aac583cd68cb0b7"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="378accc07eb80b16029db84f56bed683"/><file name="mysql4-upgrade-0.1.9-0.1.10.php" hash="53cc6beed11e8631c11a008c5fd78ce1"/></dir></dir></dir><dir name="SweetMonkey"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="a1d28320ed21eaa6c20aa98c0b4e3492"/></dir><dir name="Form"><dir name="Field"><file name="Mapfields.php" hash="a0dfcfa3e1e22bdb33005a999cb0867b"/></dir></dir><file name="Autovars.php" hash="fc3ebb5ffe5344ef74a294547614c28f"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="83c32ef3e5433e701a10ef9cc5370d04"/></dir><dir name="Model"><file name="Cron.php" hash="a253d6bdbb03ca2d1fa87fde52c934ee"/><file name="Observer.php" hash="09d158514078fa5046283755eed4726a"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MageMonkeyController.php" hash="d773f63176410f5b3970faf16b402a1d"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="8a81e6639cd53c96717a6b993d5fcd93"/><file name="config.xml" hash="fdd28267f29ce6ad0109f9b756a08979"/><file name="system.xml" hash="93e8f26427a0df9183f6680441ce23f6"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ebizmarts_MageMonkey.xml" hash="951aa15bc51345726e05080bd5fc084b"/><file name="Ebizmarts_Mandrill.xml" hash="ea4b352b5a0233330ecde76a0f9113dd"/><file name="Ebizmarts_AbandonedCart.xml" hash="48c4cfe8246d5a995e2836c43ab38d74"/><file name="Ebizmarts_Autoresponder.xml" hash="97302f94f5893147db18c4034d135256"/><file name="Ebizmarts_SweetMonkey.xml" hash="05d9393c17c76a589fd7681ed668d53f"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="ebizmarts"><file name="abandonedcart.xml" hash="14282d8f8739578d51c57def5df1227a"/><file name="autoresponder.xml" hash="d8dfb68cfd7c838cf29e9281a9a76c36"/></dir><file name="magemonkey.xml" hash="8eef43f9d728e252a5f7d7b6cea93a19"/></dir><dir name="template"><dir name="magemonkey"><dir name="checkout"><file name="subscribe.phtml" hash="41916fd7fccc22a83380dd5642b6a8cc"/></dir><file name="lists.phtml" hash="17f70d4e4bff4e14104381f927d80538"/></dir><dir name="ebizmarts_abandonedcart"><dir name="email"><dir name="order"><dir name="items"><dir name="order"><file name="default.phtml" hash="c078d029b2065e8b1938c3cfb24e8219"/></dir></dir><file name="items.phtml" hash="7be104a21130974fd4aae1f8727d5e7d"/></dir></dir><dir name="popup"><file name="emailcatcher.phtml" hash="47c12ed73112bfe4a528ef515e4560a9"/></dir></dir><dir name="ebizmarts"><dir name="autoresponder"><dir name="backtostock"><dir name="catalog"><dir name="product"><file name="form.phtml" hash="2682fda0d10238764db344fcc0b743dc"/><file name="notice.phtml" hash="ba7963278c9ed51066c736cdc0b73978"/></dir></dir><file name="item.phtml" hash="55f82ee9207c9e5a2d6fbd77ffc9921f"/></dir><dir name="customer"><file name="list.phtml" hash="21d2f116e2f509943175c43bc5863582"/></dir><dir name="related"><file name="items.phtml" hash="7de2510a4dcfc9627a0dc514360bf423"/></dir><dir name="review"><file name="items.phtml" hash="d409b68a2bc8cbe6779f11cc2784d022"/></dir><dir name="wishlist"><file name="items.phtml" hash="73a0cf8ee106d4cff7a77c9c4a69e363"/></dir><file name="unsubscribe.phtml" hash="ca8ed1c5810e07f1cdc91edb64420417"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="ebizmarts"><file name="mandrill.xml" hash="ba93e973a9019841c7d914ecd729983c"/><file name="abandonedcart.xml" hash="9ed91dab216911a13a2669bd81734180"/></dir><file name="magemonkey.xml" hash="4a2ba63a9d3002774b622e76339e6fbb"/></dir><dir name="template"><dir name="magemonkey"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="2fc348d98ca7fbc41fb2a13e6cfb78de"/></dir><file name="oauth_wizard.phtml" hash="91b3472b4e9a5bc26851b76bfcea59c5"/><file name="resetlocal360.phtml" hash="ee9a0fa8f8b09323b9f0d7786f645c8f"/><file name="resetremote360.phtml" hash="7194a90ec514df7d078bb4313a25c30b"/></dir></dir></dir><dir name="ebizmarts"><dir name="mandrill"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="3d00dbc6b6141e8e0b639ac92ac95da5"/></dir></dir></dir></dir><dir name="abandonedcart"><dir name="dashboard"><file name="index.phtml" hash="31a02b6aa63614bb2a52044195568f15"/><file name="salebar.phtml" hash="7a8c978ff415853550f9b1a3cbabfd1c"/><file name="totalbar.phtml" hash="95cb90a952f5548481c180004e39b7f1"/></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="e5bbebab8f645b423530764b4c844e47"/></dir></dir></dir></dir><dir name="autoresponder"><dir name="system"><dir name="config"><dir name="backtostock"><dir name="fieldset"><file name="hint.phtml" hash="623380a9c486eae57da00de6bd8b843d"/></dir></dir><dir name="birthday"><dir name="fieldset"><file name="hint.phtml" hash="d7f944a685769a46cb709f89c6e56f3b"/></dir></dir><dir name="fieldset"><file name="hint.phtml" hash="83cd4fef418fdcda52b3bb5e534fda85"/></dir><dir name="review"><dir name="fieldset"><file name="hint.phtml" hash="205b3fac2bc9682cdbdc9e3a8ec688df"/></dir></dir><dir name="wishlist"><dir name="fieldset"><file name="hint.phtml" hash="563ece5feca65f3ff728b89929cb2339"/></dir></dir></dir></dir></dir></dir><dir name="sweetmonkey"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="16d8c86502ff2a2a01c7e7e8a421bfcb"/></dir><file name="autovars.phtml" hash="53da8402573546ecdcbe2f5e9b3ab57a"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="ebizmarts"><dir name="abandonedcart"><file name="abandoned_cart_mail_1.html" hash="36ceaf0e511ecb2c785fb482c634ed2c"/><file name="abandoned_cart_mail_2.html" hash="ab628f7bf4f82d44d8d9a5b39c838e00"/><file name="abandoned_cart_mail_3.html" hash="c46eef13c346494f26f2e01ff7de9de2"/><file name="abandoned_cart_mail_generic.html" hash="c87513fa9e7fc18035c9b4421c51478e"/><file name="popup_coupon_template.html" hash="7411805f6751997e3de8a4f11196c14e"/></dir><dir name="autoresponder"><file name="backtostock.html" hash="f909f0edf431e2da29281904612bd902"/><file name="birthday.html" hash="716502b8dd97b4b485264c18e7c75317"/><file name="neworder.html" hash="14db5244b8bb8e7b33ad32991ea8060f"/><file name="noactivity.html" hash="ca5ba93441cf80ccf0ea79aef039fc77"/><file name="relatedproducts.html" hash="9cd19f74d0c42967526d54a197453945"/><file name="review.html" hash="0d9d872e4a0d0290cea079ccec3658c5"/><file name="reviewcoupon.html" hash="925152cf7f223b6caf92f0a502233e03"/><file name="visitedproducts.html" hash="fc89e6fd3007ca57a6359553f389a656"/><file name="wishlist.html" hash="804468d3e1f758988c633d3b8eb547ea"/></dir></dir></dir></dir><file name="Ebizmarts_MageMonkey.csv" hash="181e91ed91dfea5fe7dab66af5719af8"/><file name="Ebizmarts_Mandrill.csv" hash="3dac3af57664fd34f5eda8abf4098ee0"/><file name="Ebizmarts_AbandonedCart.csv" hash="214bcd0e8cd6153c48fab236dcfdba1b"/><file name="Ebizmarts_Autoresponder.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="Ebizmarts_SweetMonkey.csv" hash="f0cdb51ba2052ce7f7ec1c9885ee5d3c"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="magemonkey"><file name="magemonkey.css" hash="2072357ef844855f7a4607245b1e9a17"/><file name="magemonkey.js" hash="1a515d6697d533ee012754dd20e60345"/><file name="mailchimp-connected-ebizmarts-title.png" hash="c6bcb1aa606ecd3b0a9753bb48ddeb58"/><file name="mailchimp-ico.png" hash="14978ec398cede4060bc9b00365bb6c5"/><file name="mailchimp-section-background.png" hash="d4536261c6a3534fbb855428c0cca62c"/><file name="mailchimp-tab.png" hash="61972b4e063364071e81d8c9e10d8feb"/></dir><dir name="abandonedcart"><file name="abandonedcart.css" hash="bd6049fa8b17a1060e8a63fa29aefd94"/></dir><dir name="ebizmarts"><dir name="mandrill"><file name="mandrill-tab.png" hash="d7eaf9deef355e4b8b55a96070b90ffe"/><file name="mandrill.css" hash="d93f1f52db38195a4f85d20de519151e"/></dir><file name="ebizmarts-tab.png" hash="6dfa08c5cd4329d1df6e7b71fb1f925a"/><file name="ebizmarts.css" hash="a579734639953c1970ec26f56dda5837"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="magemonkey"><file name="magemonkey.css" hash="8f25ca79fc6901215f713f0e048c4a9f"/><file name="monkey.js" hash="5984cd563aee48b7ba648066f733113a"/></dir></dir></dir></dir></target><target name="mage"><dir name="lib"><dir name="Mandrill"><dir name="Mandrill"><file name="Exceptions.php" hash="54d952267c004cddeedd8d9be07698c8"/><file name="Exports.php" hash="3ed368771a7174af0e01287e3a3e030f"/><file name="Inbound.php" hash="32378db89f2f47fe158577c256837896"/><file name="Internal.php" hash="fa680d47c780922a111078827cad1505"/><file name="Ips.php" hash="c70c08b34454d2e7aebc31101cfdca81"/><file name="Messages.php" hash="f1f3c20b6c872c72dcc33790d6a3adf4"/><file name="Metadata.php" hash="57820ae2032206334fb6e6d9b12f4df2"/><file name="Rejects.php" hash="f40f9ef016c338c6ae9d161c3112eea6"/><file name="Senders.php" hash="875ddbeff3f920397c73c2c2797f3eea"/><file name="Subaccounts.php" hash="9b6b61a8e0364c9f917952deffe0320c"/><file name="Tags.php" hash="ee2f9e328d4d49aa8b0289978f7375b0"/><file name="Templates.php" hash="9920cf5d10bdcb5416193435c425f123"/><file name="Urls.php" hash="184c17ebb031f1f6e6dad687a4bf767d"/><file name="Users.php" hash="826dac98663eefce2f5ccc4a5b0d38e9"/><file name="Webhooks.php" hash="37ea24a982630aa321444b85392f3397"/><file name="Whitelists.php" hash="d132144d50c3b713c98ad699984e4e38"/></dir><file name="Mandrill.php" hash="cb6620ee6d4767e9b4edb1d574fe5dbe"/><file name="Message.php" hash="784920e095d8d9f0269b46f00071fcc9"/></dir></dir><dir name="js"><dir name="ebizmarts"><dir name="abandonedcart"><file name="popup.css" hash="1dd95b72b4a6dc211f09e60114605af5"/></dir><dir name="autoresponders"><file name="visitedproducts.js" hash="61ef8d19642d349a19a43d018888f205"/><file name="visitedproductsstorecodes.js" hash="2cea5956611572cae6140db11c6d4672"/></dir><dir name="magemonkey"><file name="campaignCatcher.js" hash="094f0706dc7cb652f6473d7549d975ac"/></dir></dir></dir></target></contents>
20
  <compatible/>
21
  <dependencies/>
22
  </package>