Professio_BudgetMailer - Version 1.0.3

Version Notes

1.0.3 - Various bug fixes, and simplifications
1.0.2 - PHP bug fix: using empty() in write context
1.0.1 - Repacking for Magento Connect
1.0.0 - Initial version

Download this release

Release Info

Developer J.S. Diertens
Extension Professio_BudgetMailer
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

Files changed (25) hide show
  1. app/code/community/Professio/BudgetMailer/Block/Adminhtml/Contact.php +21 -0
  2. app/code/community/Professio/BudgetMailer/Block/Adminhtml/Contact/Edit/Tab/Form.php +20 -20
  3. app/code/community/Professio/BudgetMailer/Block/Adminhtml/Contact/Grid.php +18 -20
  4. app/code/community/Professio/BudgetMailer/Block/CheckoutAgreements.php +84 -0
  5. app/code/community/Professio/BudgetMailer/Block/Subscribe/Mini.php +21 -0
  6. app/code/community/Professio/BudgetMailer/Helper/Config.php +8 -19
  7. app/code/community/Professio/BudgetMailer/Helper/Mapper.php +38 -7
  8. app/code/community/Professio/BudgetMailer/Model/Client.php +111 -24
  9. app/code/community/Professio/BudgetMailer/Model/Config/Source/Account.php +69 -0
  10. app/code/community/Professio/BudgetMailer/Model/Config/Source/Address.php +1 -1
  11. app/code/community/Professio/BudgetMailer/Model/Contact.php +4 -0
  12. app/code/community/Professio/BudgetMailer/Model/Exporter.php +143 -166
  13. app/code/community/Professio/BudgetMailer/Model/Importer.php +25 -0
  14. app/code/community/Professio/BudgetMailer/Model/Observer.php +19 -104
  15. app/code/community/Professio/BudgetMailer/controllers/Adminhtml/Budgetmailer/ContactController.php +172 -159
  16. app/code/community/Professio/BudgetMailer/controllers/Adminhtml/BudgetmailerController.php +101 -1
  17. app/code/community/Professio/BudgetMailer/etc/config.xml +6 -21
  18. app/code/community/Professio/BudgetMailer/etc/system.xml +12 -12
  19. app/design/frontend/base/default/template/budgetmailer/onepage-agreements.phtml +63 -0
  20. app/design/frontend/base/default/template/budgetmailer/subscribe/mini.phtml +10 -3
  21. app/design/frontend/rwd/default/template/budgetmailer/onepage-agreements.phtml +63 -0
  22. app/design/frontend/rwd/default/template/budgetmailer/subscribe/mini.phtml +10 -3
  23. app/locale/en_US/Professio_BudgetMailer.csv +86 -103
  24. app/locale/nl_NL/Professio_BudgetMailer.csv +86 -105
  25. package.xml +5 -6
app/code/community/Professio/BudgetMailer/Block/Adminhtml/Contact.php CHANGED
@@ -71,6 +71,17 @@ extends Mage_Adminhtml_Block_Widget_Grid_Container
71
  )
72
  );
73
 
 
 
 
 
 
 
 
 
 
 
 
74
  $this->_addButton(
75
  'import_budgetmailer',
76
  array(
@@ -121,4 +132,14 @@ extends Mage_Adminhtml_Block_Widget_Grid_Container
121
  {
122
  return $this->getUrl('*/budgetmailer/exportsubscribers');
123
  }
 
 
 
 
 
 
 
 
 
 
124
  }
71
  )
72
  );
73
 
74
+ $this->_addButton(
75
+ 'export_unregistered',
76
+ array(
77
+ 'label' => Mage::helper('budgetmailer')
78
+ ->__('Export unregistered Customers'),
79
+ 'onclick' => 'setLocation(\''
80
+ . $this->getUnregisteredExportUrl() .'\')',
81
+ 'class' => '',
82
+ )
83
+ );
84
+
85
  $this->_addButton(
86
  'import_budgetmailer',
87
  array(
132
  {
133
  return $this->getUrl('*/budgetmailer/exportsubscribers');
134
  }
135
+
136
+ /**
137
+ * Get unregistered customers export url
138
+ *
139
+ * @return string
140
+ */
141
+ protected function getUnregisteredExportUrl()
142
+ {
143
+ return $this->getUrl('*/budgetmailer/exportunregistered');
144
+ }
145
  }
app/code/community/Professio/BudgetMailer/Block/Adminhtml/Contact/Edit/Tab/Form.php CHANGED
@@ -180,26 +180,26 @@ extends Mage_Adminhtml_Block_Widget_Form
180
  'required' => false,
181
  )
182
  ),
183
- array(
184
- 'unsubscribed',
185
- 'select',
186
- array(
187
- 'label' => 'Unsubscribed',
188
- 'name' => 'unsubscribed',
189
- 'readonly' => true,
190
- 'required' => false,
191
- 'values'=> array(
192
- array(
193
- 'value' => 1,
194
- 'label' => 'Yes',
195
- ),
196
- array(
197
- 'value' => 0,
198
- 'label' => 'No',
199
- ),
200
- ),
201
- )
202
- )
203
  );
204
 
205
  /**
180
  'required' => false,
181
  )
182
  ),
183
+ // array(
184
+ // 'unsubscribed',
185
+ // 'select',
186
+ // array(
187
+ // 'label' => 'Unsubscribed',
188
+ // 'name' => 'unsubscribed',
189
+ // 'readonly' => true,
190
+ // 'required' => false,
191
+ // 'values'=> array(
192
+ // array(
193
+ // 'value' => 1,
194
+ // 'label' => 'Yes',
195
+ // ),
196
+ // array(
197
+ // 'value' => 0,
198
+ // 'label' => 'No',
199
+ // ),
200
+ // ),
201
+ // )
202
+ // )
203
  );
204
 
205
  /**
app/code/community/Professio/BudgetMailer/Block/Adminhtml/Contact/Grid.php CHANGED
@@ -204,34 +204,32 @@ extends Mage_Adminhtml_Block_Widget_Grid
204
  $this->setMassactionIdField('entity_id');
205
  $this->getMassactionBlock()->setFormFieldName('contact');
206
 
 
 
207
  $this->getMassactionBlock()->addItem(
208
  'delete',
209
  array(
210
- 'label' => Mage::helper('budgetmailer')->__('Delete'),
211
- 'url' => $this->getUrl('*/*/massDelete'),
212
- 'confirm' => Mage::helper('budgetmailer')->__('Are you sure?')
213
  )
214
  );
215
 
216
  $this->getMassactionBlock()->addItem(
217
- 'unsubscribed', array(
218
- 'label' => Mage::helper('budgetmailer')->__('Change Unsubscribed'),
219
- 'url' => $this->getUrl(
220
- '*/*/massUnsubscribed',
221
- array('_current' => true)
222
- ),
223
- 'additional' => array(
224
- 'flag_unsubscribed' => array(
225
- 'name' => 'flag_unsubscribed',
226
- 'type' => 'select',
227
- 'class' => 'required-entry',
228
- 'label' => Mage::helper('budgetmailer')->__('Unsubscribed'),
229
- 'values' => array(
230
- '1' => Mage::helper('budgetmailer')->__('Yes'),
231
- '0' => Mage::helper('budgetmailer')->__('No'),
232
- )
233
- )
234
  )
 
 
 
 
 
 
 
 
235
  )
236
  );
237
 
204
  $this->setMassactionIdField('entity_id');
205
  $this->getMassactionBlock()->setFormFieldName('contact');
206
 
207
+ // delete, unsubscribe, unsubscribe and delete
208
+
209
  $this->getMassactionBlock()->addItem(
210
  'delete',
211
  array(
212
+ 'label'=> Mage::helper('budgetmailer')->__('Delete from BudgetMailer'),
213
+ 'url' => $this->getUrl('*/*/massDelete'),
214
+ 'confirm' => Mage::helper('budgetmailer')->__('Are you sure?')
215
  )
216
  );
217
 
218
  $this->getMassactionBlock()->addItem(
219
+ 'unsubscribe',
220
+ array(
221
+ 'label'=> Mage::helper('budgetmailer')->__('Unsubscribe from BudgetMailer'),
222
+ 'url' => $this->getUrl('*/*/massUnsubscribe'),
223
+ 'confirm' => Mage::helper('budgetmailer')->__('Are you sure?')
 
 
 
 
 
 
 
 
 
 
 
 
224
  )
225
+ );
226
+
227
+ $this->getMassactionBlock()->addItem(
228
+ 'deleteunsubscribe',
229
+ array(
230
+ 'label'=> Mage::helper('budgetmailer')->__('Delete and Unsubscribe from BudgetMailer'),
231
+ 'url' => $this->getUrl('*/*/massDeleteUnsubscribe'),
232
+ 'confirm' => Mage::helper('budgetmailer')->__('Are you sure?')
233
  )
234
  );
235
 
app/code/community/Professio/BudgetMailer/Block/CheckoutAgreements.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Professio_BudgetMailer extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Professio
13
+ * @package Professio_BudgetMailer
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+
18
+ /**
19
+ * Override of checkout agreements allowing newsletter sign-up for onepage checkout.
20
+ *
21
+ * @category Professio
22
+ * @package Professio_BudgetMailer
23
+ */
24
+ class Professio_BudgetMailer_Block_CheckoutAgreements extends Mage_Checkout_Block_Agreements
25
+ {
26
+ /**
27
+ * Override block template
28
+ *
29
+ * @return string
30
+ */
31
+ protected function _toHtml()
32
+ {
33
+ if (substr_count($_SERVER['REQUEST_URI'], 'onepage')) {
34
+ $this->setTemplate('budgetmailer/onepage-agreements.phtml');
35
+ }
36
+ return parent::_toHtml();
37
+ }
38
+
39
+ /**
40
+ * Check if customer is signed up
41
+ * @return bool
42
+ */
43
+ public function isCurrentCustomerSignedUp() {
44
+ if(Mage::getSingleton('customer/session')->isLoggedIn()) {
45
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
46
+ $contact = Mage::getModel('budgetmailer/contact');
47
+ $contact->loadByCustomer($customer);
48
+
49
+ return $contact->getId() > 0;
50
+ }
51
+
52
+ return false;
53
+ }
54
+
55
+ /**
56
+ * Check if sign-up is hidden
57
+ * @return bool
58
+ */
59
+ public function isSignupHidden() {
60
+ return Professio_BudgetMailer_Model_Config_Source_Account::HIDDENCHECKED
61
+ == Mage::helper('budgetmailer/config')->getAdvancedCreateAccount();
62
+ }
63
+
64
+ /**
65
+ * Check if sign-up is checked
66
+ * @return bool
67
+ */
68
+ public function isSignupChecked() {
69
+ $v = Mage::helper('budgetmailer/config')->getAdvancedCreateAccount();
70
+
71
+ return
72
+ Professio_BudgetMailer_Model_Config_Source_Account::HIDDENCHECKED == $v
73
+ || Professio_BudgetMailer_Model_Config_Source_Account::CHECKED == $v;
74
+ }
75
+
76
+ /**
77
+ * Get config helper
78
+ * @return Professio_BudgetMailer_Helper_Config
79
+ */
80
+ public function getConfigHelper()
81
+ {
82
+ return Mage::helper('budgetmailer/config');
83
+ }
84
+ }
app/code/community/Professio/BudgetMailer/Block/Subscribe/Mini.php CHANGED
@@ -41,4 +41,25 @@ extends Mage_Core_Block_Template
41
  {
42
  return new Varien_Object;
43
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
41
  {
42
  return new Varien_Object;
43
  }
44
+
45
+ /**
46
+ * Check if sign-up is hidden
47
+ * @return bool
48
+ */
49
+ public function isSignupHidden() {
50
+ return Professio_BudgetMailer_Model_Config_Source_Account::HIDDENCHECKED
51
+ == Mage::helper('budgetmailer/config')->getAdvancedCreateAccount();
52
+ }
53
+
54
+ /**
55
+ * Check if sign-up is checked
56
+ * @return bool
57
+ */
58
+ public function isSignupChecked() {
59
+ $v = Mage::helper('budgetmailer/config')->getAdvancedCreateAccount();
60
+
61
+ return
62
+ Professio_BudgetMailer_Model_Config_Source_Account::HIDDENCHECKED == $v
63
+ || Professio_BudgetMailer_Model_Config_Source_Account::CHECKED == $v;
64
+ }
65
  }
app/code/community/Professio/BudgetMailer/Helper/Config.php CHANGED
@@ -25,14 +25,14 @@ class Professio_BudgetMailer_Helper_Config extends Mage_Core_Helper_Abstract
25
  {
26
  const CONFIG_PATH_ADVANCED_ADDRESS_TYPE =
27
  'budgetmailer/advanced/address_type';
28
- const CONFIG_PATH_ADVANCED_ON_ADDRESS_DELETE =
29
- 'budgetmailer/advanced/on_address_delete';
30
  const CONFIG_PATH_ADVANCED_ON_ADDRESS_UPDATE =
31
  'budgetmailer/advanced/on_address_update';
32
  const CONFIG_PATH_ADVANCED_ON_CUSTOMER_DELETE =
33
  'budgetmailer/advanced/on_customer_delete';
34
  const CONFIG_PATH_ADVANCED_ON_CUSTOMER_UPDATE =
35
  'budgetmailer/advanced/on_customer_update';
 
 
36
  const CONFIG_PATH_ADVANCED_ON_ORDER =
37
  'budgetmailer/advanced/on_order';
38
  const CONFIG_PATH_ADVANCED_FRONTEND =
@@ -59,31 +59,20 @@ class Professio_BudgetMailer_Helper_Config extends Mage_Core_Helper_Abstract
59
  }
60
 
61
  /**
62
- * Get enabled front-end
63
- *
64
- * @return boolean
65
  */
66
- public function isAdvancedFrontendEnabled()
67
- {
68
- return Mage::getStoreConfig(self::CONFIG_PATH_ADVANCED_FRONTEND);
69
  }
70
 
71
  /**
72
- * Get on address delete enabled
73
  *
74
  * @return boolean
75
  */
76
- public function isAdvancedOnAddressDeleteEnabled()
77
  {
78
- $c =
79
- Professio_BudgetMailer_Model_Config_Source_Delete_Address
80
- ::ON_DELETE_USE_NEW;
81
-
82
- $v = Mage::getStoreConfig(
83
- self::CONFIG_PATH_ADVANCED_ON_ADDRESS_DELETE
84
- );
85
-
86
- return $c == $v;
87
  }
88
 
89
  /**
25
  {
26
  const CONFIG_PATH_ADVANCED_ADDRESS_TYPE =
27
  'budgetmailer/advanced/address_type';
 
 
28
  const CONFIG_PATH_ADVANCED_ON_ADDRESS_UPDATE =
29
  'budgetmailer/advanced/on_address_update';
30
  const CONFIG_PATH_ADVANCED_ON_CUSTOMER_DELETE =
31
  'budgetmailer/advanced/on_customer_delete';
32
  const CONFIG_PATH_ADVANCED_ON_CUSTOMER_UPDATE =
33
  'budgetmailer/advanced/on_customer_update';
34
+ const CONFIG_PATH_ADVANCED_ON_CREATE_ACCOUNT =
35
+ 'budgetmailer/advanced/on_create_account';
36
  const CONFIG_PATH_ADVANCED_ON_ORDER =
37
  'budgetmailer/advanced/on_order';
38
  const CONFIG_PATH_ADVANCED_FRONTEND =
59
  }
60
 
61
  /**
62
+ * Get sign-up configuration while creating an account
 
 
63
  */
64
+ public function getAdvancedCreateAccount() {
65
+ return Mage::getStoreConfig(self::CONFIG_PATH_ADVANCED_ON_CREATE_ACCOUNT);
 
66
  }
67
 
68
  /**
69
+ * Get enabled front-end
70
  *
71
  * @return boolean
72
  */
73
+ public function isAdvancedFrontendEnabled()
74
  {
75
+ return Mage::getStoreConfig(self::CONFIG_PATH_ADVANCED_FRONTEND);
 
 
 
 
 
 
 
 
76
  }
77
 
78
  /**
app/code/community/Professio/BudgetMailer/Helper/Mapper.php CHANGED
@@ -100,6 +100,7 @@ class Professio_BudgetMailer_Helper_Mapper extends Mage_Core_Helper_Abstract
100
  protected $_customerToApi = array(
101
  'email' => 'email',
102
  'firstname' => 'firstName',
 
103
  'lastname' => 'lastName',
104
  'sex' => 'gender',
105
  );
@@ -111,6 +112,7 @@ class Professio_BudgetMailer_Helper_Mapper extends Mage_Core_Helper_Abstract
111
  protected $_customerToModel = array(
112
  'email' => 'email',
113
  'firstname' => 'first_name',
 
114
  'lastname' => 'last_name',
115
  'gender' => 'sex'
116
  );
@@ -149,6 +151,17 @@ class Professio_BudgetMailer_Helper_Mapper extends Mage_Core_Helper_Abstract
149
  'list' => 'name',
150
  );
151
 
 
 
 
 
 
 
 
 
 
 
 
152
  /**
153
  * Subscriber to model
154
  * @var array
@@ -161,11 +174,11 @@ class Professio_BudgetMailer_Helper_Mapper extends Mage_Core_Helper_Abstract
161
  /**
162
  * Map address to API contact object
163
  *
164
- * @param Mage_Customer_Model_Address $address
165
  * @param stdClass $contactApi
166
  */
167
  public function addressToContact(
168
- Mage_Customer_Model_Address $address, $contactApi
169
  )
170
  {
171
  if (!is_object($contactApi)) {
@@ -185,11 +198,11 @@ class Professio_BudgetMailer_Helper_Mapper extends Mage_Core_Helper_Abstract
185
  /**
186
  * Map address model to contact model
187
  *
188
- * @param Mage_Customer_Model_Address $address
189
  * @param Professio_BudgetMailer_Model_Contact $contact
190
  */
191
  public function addressToModel(
192
- Mage_Customer_Model_Address $address,
193
  Professio_BudgetMailer_Model_Contact $contact
194
  )
195
  {
@@ -273,9 +286,9 @@ class Professio_BudgetMailer_Helper_Mapper extends Mage_Core_Helper_Abstract
273
  $contactApi->sex = (int)$contactApi->sex;
274
  $contactApi->unsubscribed = (bool)$contactApi->unsubscribed;
275
 
276
- $contact->setData(
277
- 'list', $this->listIdToName($contact->getData('list'))
278
- );
279
 
280
  return $contactApi;
281
  }
@@ -496,6 +509,24 @@ class Professio_BudgetMailer_Helper_Mapper extends Mage_Core_Helper_Abstract
496
  $list->setData('id', $this->listIdToBudgetmailerId($listApi->id));
497
  }
498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499
  /**
500
  * Map subscriber model to contact model
501
  *
100
  protected $_customerToApi = array(
101
  'email' => 'email',
102
  'firstname' => 'firstName',
103
+ 'middlename' => 'insertion',
104
  'lastname' => 'lastName',
105
  'sex' => 'gender',
106
  );
112
  protected $_customerToModel = array(
113
  'email' => 'email',
114
  'firstname' => 'first_name',
115
+ 'middlename' => 'insertion',
116
  'lastname' => 'last_name',
117
  'gender' => 'sex'
118
  );
151
  'list' => 'name',
152
  );
153
 
154
+ /**
155
+ * Order to model
156
+ * @var array
157
+ */
158
+ protected $_orderToModel = array(
159
+ 'customer_email' => 'email',
160
+ 'customer_firstname' => 'first_name',
161
+ 'customer_middlename' => 'insertion',
162
+ 'customer_lastname' => 'last_name',
163
+ );
164
+
165
  /**
166
  * Subscriber to model
167
  * @var array
174
  /**
175
  * Map address to API contact object
176
  *
177
+ * @param Mage_Customer_Model_Address_Abstract $address
178
  * @param stdClass $contactApi
179
  */
180
  public function addressToContact(
181
+ Mage_Customer_Model_Address_Abstract $address, $contactApi
182
  )
183
  {
184
  if (!is_object($contactApi)) {
198
  /**
199
  * Map address model to contact model
200
  *
201
+ * @param Mage_Customer_Model_Address_Abstract $address
202
  * @param Professio_BudgetMailer_Model_Contact $contact
203
  */
204
  public function addressToModel(
205
+ Mage_Customer_Model_Address_Abstract $address,
206
  Professio_BudgetMailer_Model_Contact $contact
207
  )
208
  {
286
  $contactApi->sex = (int)$contactApi->sex;
287
  $contactApi->unsubscribed = (bool)$contactApi->unsubscribed;
288
 
289
+ // $contact->setData(
290
+ // 'list', $this->listIdToName($contact->getData('list'))
291
+ // );
292
 
293
  return $contactApi;
294
  }
509
  $list->setData('id', $this->listIdToBudgetmailerId($listApi->id));
510
  }
511
 
512
+ /**
513
+ * Map order model to contact model
514
+ *
515
+ * @param Mage_Sales_Model_Order $order
516
+ * @param Professio_BudgetMailer_Model_Contact $contact
517
+ */
518
+ public function orderToModel(
519
+ Mage_Sales_Model_Order $order,
520
+ Professio_BudgetMailer_Model_Contact $contact
521
+ )
522
+ {
523
+ foreach ($this->_orderToModel as $keyOrder => $keyModel) {
524
+ $contact->setData(
525
+ $keyModel, $order->getData($keyOrder)
526
+ );
527
+ }
528
+ }
529
+
530
  /**
531
  * Map subscriber model to contact model
532
  *
app/code/community/Professio/BudgetMailer/Model/Client.php CHANGED
@@ -23,8 +23,25 @@
23
  */
24
  class Professio_BudgetMailer_Model_Client extends Zend_Rest_Client
25
  {
 
 
 
 
 
 
 
 
 
 
26
  const LIMIT = 1000;
27
 
 
 
 
 
 
 
 
28
  /**
29
  * Caching of API contacts
30
  *
@@ -404,11 +421,11 @@ class Professio_BudgetMailer_Model_Client extends Zend_Rest_Client
404
  {
405
  $this->init(true);
406
 
407
- /*try {
408
- throw new Exception('trace');
409
- } catch (Exception $e) {
410
- Mage::logException($e);
411
- }*/
412
 
413
  $contactCache = $this->getCache($id);
414
 
@@ -664,47 +681,77 @@ class Professio_BudgetMailer_Model_Client extends Zend_Rest_Client
664
  return $contact;
665
  }
666
 
667
- /**
668
- * Insert multiple contacts to API
669
- *
670
- * @param array $contacts array of contact objects
671
- * @param null|string $list list name, id, or null for default
672
- *
673
- * @return boolean
674
- * @throws Professio_BudgetMailer_Exception
675
- */
676
- public function postContacts($contacts, $list = null)
677
  {
 
 
 
 
 
 
 
678
  $this->init(true);
679
 
680
  if (is_null($list)) {
681
  $list = $this->getList();
682
  }
683
 
684
- $path = '/contacts/' . rawurlencode($list) . '/bulk';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
685
  $data = json_encode($contacts);
686
 
687
  $this->log(
688
- 'budgetmailer/client::postContacts() path: '
689
  . $path . ', list: ' . $list . ', contact: ' . $data
690
  );
691
 
692
- $rs = $this->restPost($path, $data);
693
 
694
- $this->log(
695
- 'budgetmailer/client::postContacts() result: ' . $rs->getStatus()
696
- . ', headers: ' . json_encode($rs->getHeaders())
697
- . ', body: ' . $rs->getBody()
698
- );
 
 
 
 
 
 
 
 
 
 
699
 
700
  $this->_totalCount = $rs->getHeader('X-Total-Count');
701
  $this->_totalFail = $rs->getHeader('X-Total-Fail');
702
  $this->_totalSuccess = $rs->getHeader('X-Total-Success');
703
 
 
 
 
 
 
 
704
  if ($rs->isError()) {
705
  throw new Professio_BudgetMailer_Exception(
706
  Mage::helper('budgetmailer')
707
- ->__('Couldn\'t bulk subscribe contacts to BudgetMailer API.')
708
  );
709
  }
710
 
@@ -823,4 +870,44 @@ class Professio_BudgetMailer_Model_Client extends Zend_Rest_Client
823
  return false;
824
  }
825
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
826
  }
23
  */
24
  class Professio_BudgetMailer_Model_Client extends Zend_Rest_Client
25
  {
26
+ const BULK_DELETE = 0;
27
+ const BULK_UNSUB = 1;
28
+ const BULK_DELUNSUB = 2;
29
+ const BULK_INS = 3;
30
+
31
+ /**
32
+ * Bulk API method limit
33
+ *
34
+ * @var integer
35
+ */
36
  const LIMIT = 1000;
37
 
38
+ /**
39
+ * Allowed bulk methods
40
+ */
41
+ protected $_bulkMethods = array(
42
+ self::BULK_DELETE, self::BULK_DELUNSUB, self::BULK_UNSUB, self::BULK_INS
43
+ );
44
+
45
  /**
46
  * Caching of API contacts
47
  *
421
  {
422
  $this->init(true);
423
 
424
+ // try {
425
+ // throw new Exception('trace');
426
+ // } catch (Exception $e) {
427
+ // Mage::logException($e);
428
+ // }
429
 
430
  $contactCache = $this->getCache($id);
431
 
681
  return $contact;
682
  }
683
 
684
+ public function postContacts($contacts, $bulkMethod, $list = null)
 
 
 
 
 
 
 
 
 
685
  {
686
+ if (!in_array($bulkMethod, $this->_bulkMethods)) {
687
+ throw new Professio_BudgetMailer_Exception(
688
+ Mage::helper('budgetmailer')
689
+ ->__('Invalid bulk method.')
690
+ );
691
+ }
692
+
693
  $this->init(true);
694
 
695
  if (is_null($list)) {
696
  $list = $this->getList();
697
  }
698
 
699
+ $path = '/contacts/' . rawurlencode($list);
700
+
701
+ switch($bulkMethod) {
702
+ case self::BULK_DELETE:
703
+ $path .= '/bulk-delete';
704
+ break;
705
+ case self::BULK_UNSUB:
706
+ $path .= '/bulk-unsubscribe';
707
+ break;
708
+ case self::BULK_DELUNSUB:
709
+ $path .= '/bulk-delete';
710
+ break;
711
+ case self::BULK_INS:
712
+ $path .= '/bulk-insert';
713
+ break;
714
+ }
715
+
716
  $data = json_encode($contacts);
717
 
718
  $this->log(
719
+ 'budgetmailer/client::postContactsBulk() path: '
720
  . $path . ', list: ' . $list . ', contact: ' . $data
721
  );
722
 
723
+ //$rs = $this->restPost($path);
724
 
725
+ // INFO not using restPost because of the params reset
726
+ // with combination with the get param neded to delete & unsub
727
+ $this->_prepareRest($path);
728
+
729
+ if (self::BULK_DELUNSUB == $bulkMethod) {
730
+ $this->getHttpClient()->setParameterGet('unsubscribe', 'true');
731
+ $this->log(
732
+ 'budgetmailer/client::postContactsBulk() unsubscribe=true');
733
+ } else if (self::BULK_INS == $bulkMethod) {
734
+ $this->getHttpClient()->setParameterGet('overwrite', 'true');
735
+ $this->log(
736
+ 'budgetmailer/client::postContactsBulk() overwrite=true');
737
+ }
738
+
739
+ $rs = $this->_performPost('POST', $data);
740
 
741
  $this->_totalCount = $rs->getHeader('X-Total-Count');
742
  $this->_totalFail = $rs->getHeader('X-Total-Fail');
743
  $this->_totalSuccess = $rs->getHeader('X-Total-Success');
744
 
745
+ $this->log(
746
+ 'budgetmailer/client::postContactsBulk() result: ' . $rs->getStatus()
747
+ . ', headers: ' . json_encode($rs->getHeaders())
748
+ . ', body: ' . $rs->getBody()
749
+ );
750
+
751
  if ($rs->isError()) {
752
  throw new Professio_BudgetMailer_Exception(
753
  Mage::helper('budgetmailer')
754
+ ->__('Couldn\'t bulk process contacts in BudgetMailer API.')
755
  );
756
  }
757
 
870
  return false;
871
  }
872
  }
873
+
874
+ /**
875
+ * Overridden prepare rest... replaced self with Zend_Rest_Client
876
+ *
877
+ * Call a remote REST web service URI and return the Zend_Http_Response object
878
+ *
879
+ * @param string $path The path to append to the URI
880
+ * @throws Zend_Rest_Client_Exception
881
+ * @return void
882
+ */
883
+ private function _prepareRest($path)
884
+ {
885
+ // Get the URI object and configure it
886
+ if (!$this->_uri instanceof Zend_Uri_Http) {
887
+ #require_once 'Zend/Rest/Client/Exception.php';
888
+ throw new Zend_Rest_Client_Exception('URI object must be set before performing call');
889
+ }
890
+
891
+ $uri = $this->_uri->getUri();
892
+
893
+ if ($path[0] != '/' && $uri[strlen($uri)-1] != '/') {
894
+ $path = '/' . $path;
895
+ }
896
+
897
+ $this->_uri->setPath($path);
898
+
899
+ /**
900
+ * Get the HTTP client and configure it for the endpoint URI. Do this each time
901
+ * because the Zend_Http_Client instance is shared among all Zend_Service_Abstract subclasses.
902
+ */
903
+ if ($this->_noReset) {
904
+ // if $_noReset we do not want to reset on this request,
905
+ // but we do on any subsequent request
906
+ $this->_noReset = false;
907
+ } else {
908
+ Zend_Rest_Client::getHttpClient()->resetParameters();
909
+ }
910
+
911
+ Zend_Rest_Client::getHttpClient()->setUri($this->_uri);
912
+ }
913
  }
app/code/community/Professio/BudgetMailer/Model/Config/Source/Account.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Professio_BudgetMailer extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Professio
13
+ * @package Professio_BudgetMailer
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+
18
+ /**
19
+ * Account type config source
20
+ *
21
+ * @category Professio
22
+ * @package Professio_BudgetMailer
23
+ */
24
+ class Professio_BudgetMailer_Model_Config_Source_Account
25
+ {
26
+ const CHECKED = 'checked';
27
+ const UNCHECKED = 'unchecked';
28
+ const HIDDENCHECKED = 'hiddenchecked';
29
+
30
+ /**
31
+ * Options getter
32
+ *
33
+ * @return array
34
+ */
35
+ public function toOptionArray()
36
+ {
37
+ return array(
38
+ array(
39
+ 'label' => Mage::helper('budgetmailer')->__('Display checked checkbox'),
40
+ 'value' => self::CHECKED
41
+ ),
42
+ array(
43
+ 'label' => Mage::helper('budgetmailer')->__('Display unchecked checkbox'),
44
+ 'value' => self::UNCHECKED
45
+ ),
46
+ array(
47
+ 'label' => Mage::helper('budgetmailer')->__('Don\'t display checkbox, sign-up automatically'),
48
+ 'value' => self::HIDDENCHECKED
49
+ ),
50
+ );
51
+ }
52
+
53
+ /**
54
+ * Get options in "key-value" format
55
+ *
56
+ * @return array
57
+ */
58
+ public function toArray()
59
+ {
60
+ return array(
61
+ self::CHECKED =>
62
+ Mage::helper('budgetmailer')->__('Display checked checkbox'),
63
+ self::UNCHECKED =>
64
+ Mage::helper('budgetmailer')->__('Display unchecked checkbox'),
65
+ self::HIDDENCHECKED =>
66
+ Mage::helper('budgetmailer')->__('Don\'t display checkbox, sign-up automatically'),
67
+ );
68
+ }
69
+ }
app/code/community/Professio/BudgetMailer/Model/Config/Source/Address.php CHANGED
@@ -53,7 +53,7 @@ class Professio_BudgetMailer_Model_Config_Source_Address
53
  public function toArray()
54
  {
55
  return array(
56
- self::ON_DELETE_DELEBILLINGTE =>
57
  Mage::helper('budgetmailer')->__('Billing Address'),
58
  self::SHIPPING =>
59
  Mage::helper('budgetmailer')->__('Shipping Address'),
53
  public function toArray()
54
  {
55
  return array(
56
+ self::BILLING =>
57
  Mage::helper('budgetmailer')->__('Billing Address'),
58
  self::SHIPPING =>
59
  Mage::helper('budgetmailer')->__('Shipping Address'),
app/code/community/Professio/BudgetMailer/Model/Contact.php CHANGED
@@ -215,6 +215,10 @@ class Professio_BudgetMailer_Model_Contact extends Mage_Core_Model_Abstract
215
 
216
  if (!is_null($this->getOrigData())) {
217
  foreach ($this->getData() as $k => $v) {
 
 
 
 
218
  $changed = $this->dataHasChangedFor($k);
219
 
220
  // decode orig value of tags field
215
 
216
  if (!is_null($this->getOrigData())) {
217
  foreach ($this->getData() as $k => $v) {
218
+ if ('is_massupdate' == $k) {
219
+ continue;
220
+ }
221
+
222
  $changed = $this->dataHasChangedFor($k);
223
 
224
  // decode orig value of tags field
app/code/community/Professio/BudgetMailer/Model/Exporter.php CHANGED
@@ -35,6 +35,12 @@ class Professio_BudgetMailer_Model_Exporter
35
  */
36
  protected $_subscribersCollection;
37
 
 
 
 
 
 
 
38
  /**
39
  * Get BudgetMailer API client
40
  *
@@ -90,6 +96,25 @@ class Professio_BudgetMailer_Model_Exporter
90
  return $this->_subscribersCollection;
91
  }
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  /**
94
  * Get mapper helper
95
  * @return Professio_BudgetMailer_Helper_Mapper
@@ -207,6 +232,9 @@ class Professio_BudgetMailer_Model_Exporter
207
  //$contact->save(false);
208
 
209
  $emails[] = $contact->getEmail();
 
 
 
210
  }
211
 
212
  $contacts[] = $this->getMapper()->contactToApi($contact);
@@ -214,11 +242,15 @@ class Professio_BudgetMailer_Model_Exporter
214
 
215
  if (count($contacts)) {
216
  list($total, $fail, $success, $contactsNew) =
217
- $this->getClient()->postContacts($contacts);
 
 
218
 
219
- foreach ($contactsNew->Success as $contact) {
220
- Mage::getModel('budgetmailer/importer')
221
- ->importContact($contact);
 
 
222
  }
223
  }
224
  } catch (Exception $e) {
@@ -346,6 +378,9 @@ class Professio_BudgetMailer_Model_Exporter
346
  $contact->setSubscribe($subscribe);
347
  //$contact->setIsMassupdate(true);
348
  //$contact->save(false);
 
 
 
349
  }
350
 
351
  $contacts[] = $this->getMapper()->contactToApi($contact);
@@ -353,11 +388,15 @@ class Professio_BudgetMailer_Model_Exporter
353
 
354
  if (count($contacts)) {
355
  list($total, $fail, $success, $contactsNew) =
356
- $this->getClient()->postContacts($contacts);
 
 
357
 
358
- foreach ($contactsNew->Success as $contact) {
359
- Mage::getModel('budgetmailer/importer')
360
- ->importContact($contact);
 
 
361
  }
362
  }
363
  } catch (Exception $e) {
@@ -377,201 +416,139 @@ class Professio_BudgetMailer_Model_Exporter
377
  return array($total, $fail, $success);
378
  }
379
 
380
- /**
381
- * Custom log wrapper - log only in developer mode
382
- *
383
- * @param string $message
384
- */
385
- protected function log($message)
386
  {
387
- if (Mage::getIsDeveloperMode()) {
388
- Mage::log($message);
389
- }
390
- }
391
-
392
- /**
393
- * Mass (un)subscribe customers
394
- * @param array $customerIds list of customer ids
395
- * @param boolean $subscribe subscribe or not
396
- * @return array mass actions stats as assoc array
397
- */
398
- public function massSubscribeCustomers($customerIds, $subscribe = true)
399
- {
400
- $this->log('budgetmailer/exporter::massSubscribeCustomers() start');
401
 
402
  try {
403
- $customerIdPages = array_chunk(
404
- $customerIds, Professio_BudgetMailer_Model_Client::LIMIT, true
405
- );
406
- $totals = array('complete' => 0, 'fail' => 0, 'success' => 0);
407
 
408
- foreach ($customerIdPages as $customerIdPage) {
409
- $this->getCustomersCollection()->clear();
410
- $this->getCustomersCollection()->addAttributeToFilter(
411
- 'id', array('in' => $customerIdPage)
412
  );
413
- $this->getCustomersCollection()->load();
414
 
415
- list($total, $fail, $success) = $this
416
- ->exportCustomersPage($subscribe);
417
-
418
- $totals['complete'] += $total;
419
- $totals['fail'] += $fail;
420
- $totals['success'] += $success;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
421
  }
422
- } catch (Exception $e) {
423
  $this->log(
424
- 'budgetmailer/exporter::massSubscribeCustomers() failed '
425
  . 'with exception: ' . $e->getMessage()
426
  );
427
 
428
  Mage::logException($e);
429
  }
430
 
431
- $this->log('budgetmailer/exporter::massSubscribeCustomers() end');
432
 
433
  return $totals;
434
  }
435
 
436
- /**
437
- * Mass (un)subscribe subscribers
438
- * @param array $subscriberIds list of subscriber ids
439
- * @param boolean $subscribe subscribe or not
440
- * @return array mass actions stats as assoc array
441
- */
442
- public function massSubscribeSubscribers($subscriberIds, $subscribe = true)
443
  {
444
- $this->log('budgetmailer/exporter::massSubscribeSubscribers() start');
445
-
446
  try {
447
- $subscriberIdPages = array_chunk(
448
- $subscriberIds, Professio_BudgetMailer_Model_Client::LIMIT, true
449
- );
450
- $totals = array('complete' => 0, 'fail' => 0, 'success' => 0);
451
 
452
- foreach ($subscriberIdPages as $subscriberIdPage) {
453
- $this->getSubscribersCollection()->clear();
454
- $this->getSubscribersCollection()->addAttributeToFilter(
455
- 'id', array('in' => $subscriberIdPage)
456
- );
457
- $this->getSubscribersCollection()->load();
458
-
459
- list($total, $fail, $success) = $this
460
- ->exportSubscribersPage($subscribe);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
461
 
462
- $totals['complete'] += $total;
463
- $totals['fail'] += $fail;
464
- $totals['success'] += $success;
 
 
 
465
  }
466
  } catch (Exception $e) {
467
  $this->log(
468
- 'budgetmailer/exporter::massSubscribeSubscribers() failed '
469
  . 'with exception: ' . $e->getMessage()
470
  );
471
 
472
  Mage::logException($e);
473
  }
474
 
475
- $this->log('budgetmailer/exporter::massSubscribeSubscribers() end');
476
-
477
- return $totals;
478
- }
479
-
480
- /**
481
- * INFO unused...
482
- * Export single customer
483
- *
484
- * @param Mage_Customer_Model_Customer $customer
485
- *
486
- * @return boolean
487
- */
488
- /*protected function exportCustomer($customer)
489
- {
490
- $this->log('budgetmailer/exporter::exportCustomer() start');
491
-
492
- $contact = $this->getContact();
493
- // enabled useApi param... because otherwise i can try to
494
- // create existing contacts
495
- $contact->loadByCustomer($customer, true);
496
-
497
  $this->log(
498
- 'budgetmailer/exporter::exportCustomer(): customer id: '
499
- . $customer->getEntityId() . ', contact id: '
500
- . $contact->getEntityId()
501
  );
502
-
503
- if (!$contact->getEntityId()) {
504
- $this->getMapper()->customerToModel($customer, $contact);
505
-
506
- $address = $this->getHelper()
507
- ->getCustomersPrimaryAddress($customer);
508
-
509
- if ($address && $address->getEntityId()) {
510
- $this->getMapper()->addressToModel($address, $contact);
511
- }
512
-
513
- $contact->setCustomerId($customer->getEntityId());
514
- $contact->setEmail($customer->getEmail());
515
- $contact->setIsMassupdate(true);
516
- $contact->save();
517
- $rs = true;
518
- } else {
519
- $rs = false;
520
- }
521
 
522
- $this->log('budgetmailer/exporter::exportCustomer() end');
523
-
524
- return $rs;
525
- }*/
526
 
527
  /**
528
- * INFO NOT USED
529
- * Export single subscriber
530
- * @param Mage_Newsletter_Model_Subscriber $subscriber
531
- * @return boolean
532
  */
533
- /*protected function exportSubscriber($subscriber)
534
  {
535
- $this->log('budgetmailer/exporter::exportSubscriber() start');
536
-
537
- $contact = $this->getContact();
538
- // will try to load subscribers from api
539
- $contact->loadByEmail($subscriber->getEmail(), true);
540
-
541
- $this->log(
542
- 'budgetmailer/exporter::exportSubscriber(): subscriber id: '
543
- . $subscriber->getSubscriberId() . ', contact id: '
544
- . $contact->getEntityId()
545
- );
546
-
547
- if (!$contact->getEntityId()) {
548
- if ($subscriber->getCustomer()) {
549
- $this->getMapper()
550
- ->customerToModel($subscriber->getCustomer(), $contact);
551
-
552
- $address = $this->getHelper()
553
- ->getCustomersPrimaryAddress($subscriber->getCustomer());
554
-
555
- if ($address && $address->getEntityId()) {
556
- $this->getMapper()->addressToModel($address, $contact);
557
- }
558
-
559
- $contact->setCustomerId(
560
- $subscriber->getCustomer()->getEntityId()
561
- );
562
- }
563
-
564
- $contact->setEmail($subscriber->getEmail());
565
- $contact->setIsMassupdate(true);
566
- $contact->save();
567
- $rs = true;
568
- } else {
569
- $rs = false;
570
  }
571
-
572
- $this->log('budgetmailer/exporter::exportSubscriber() end');
573
-
574
- return $rs;
575
- }*/
576
-
577
  }
35
  */
36
  protected $_subscribersCollection;
37
 
38
+ /**
39
+ * Unregistered customer orders collection
40
+ * @var Mage_Sales_Model_Resource_Order_Collection
41
+ */
42
+ protected $_unregisteredCollection;
43
+
44
  /**
45
  * Get BudgetMailer API client
46
  *
96
  return $this->_subscribersCollection;
97
  }
98
 
99
+ /**
100
+ * Prepare and get collection of orders from unregistered customers
101
+ *
102
+ * @return Mage_Sales_Model_Resource_Order_Collection
103
+ */
104
+ protected function getUnregisteredCollection()
105
+ {
106
+ if (!isset($this->_unregisteredCollection)) {
107
+ $this->_unregisteredCollection =
108
+ Mage::getModel('sales/order')->getCollection();
109
+ $this->_unregisteredCollection
110
+ ->setPageSize(Professio_BudgetMailer_Model_Client::LIMIT);
111
+ $this->_unregisteredCollection
112
+ ->addAttributeToFilter('customer_id', array('null' => true));
113
+ }
114
+
115
+ return $this->_unregisteredCollection;
116
+ }
117
+
118
  /**
119
  * Get mapper helper
120
  * @return Professio_BudgetMailer_Helper_Mapper
232
  //$contact->save(false);
233
 
234
  $emails[] = $contact->getEmail();
235
+ } else {
236
+ $contact->setUnsubscribed(!$subscribe);
237
+ $contact->setSubscribe($subscribe);
238
  }
239
 
240
  $contacts[] = $this->getMapper()->contactToApi($contact);
242
 
243
  if (count($contacts)) {
244
  list($total, $fail, $success, $contactsNew) =
245
+ $this->getClient()->postContacts(
246
+ $contacts, Professio_BudgetMailer_Model_Client::BULK_INS
247
+ );
248
 
249
+ if (isset($contactsNew->Success) && is_array($contactsNew->Success)) {
250
+ foreach ($contactsNew->Success as $contact) {
251
+ Mage::getModel('budgetmailer/importer')
252
+ ->importContact($contact);
253
+ }
254
  }
255
  }
256
  } catch (Exception $e) {
378
  $contact->setSubscribe($subscribe);
379
  //$contact->setIsMassupdate(true);
380
  //$contact->save(false);
381
+ } else {
382
+ $contact->setUnsubscribed(!$subscribe);
383
+ $contact->setSubscribe($subscribe);
384
  }
385
 
386
  $contacts[] = $this->getMapper()->contactToApi($contact);
388
 
389
  if (count($contacts)) {
390
  list($total, $fail, $success, $contactsNew) =
391
+ $this->getClient()->postContacts(
392
+ $contacts, Professio_BudgetMailer_Model_Client::BULK_INS
393
+ );
394
 
395
+ if (isset($contactsNew->Success) && is_array($contactsNew->Success)) {
396
+ foreach ($contactsNew->Success as $contact) {
397
+ Mage::getModel('budgetmailer/importer')
398
+ ->importContact($contact);
399
+ }
400
  }
401
  }
402
  } catch (Exception $e) {
416
  return array($total, $fail, $success);
417
  }
418
 
419
+ public function exportUnregistered($subscribe = true)
 
 
 
 
 
420
  {
421
+ $this->log('budgetmailer/exporter::exportUnregistered() start');
422
+
423
+ $totals = array('total' => 0, 'fail' => 0, 'success' => 0);
 
 
 
 
 
 
 
 
 
 
 
424
 
425
  try {
426
+ $total = $this->getUnregisteredCollection()->getSize();
 
 
 
427
 
428
+ if ($total > 0) {
429
+ $page = 1;
430
+ $pages = ceil(
431
+ $total / Professio_BudgetMailer_Model_Client::LIMIT
432
  );
 
433
 
434
+ $this->log(
435
+ 'budgetmailer/exporter::exportUnregistered() '
436
+ . 'total: ' . $total . ', pages: '
437
+ . $pages
438
+ );
439
+
440
+ do {
441
+ $this->getUnregisteredCollection()->clear();
442
+ $this->getUnregisteredCollection()->setCurPage($page);
443
+ $this->getUnregisteredCollection()->load();
444
+
445
+ list($total, $fail, $success) =
446
+ $this->exportUnregisteredPage($subscribe);
447
+
448
+ $totals['total'] += $total;
449
+ $totals['fail'] += $fail;
450
+ $totals['success'] += $success;
451
+
452
+ $page++;
453
+ } while ($page <= $pages);
454
+ } else {
455
+ $this->log(
456
+ 'budgetmailer/exporter::exportUnregistered() no unregistered orders'
457
+ );
458
  }
459
+ } catch(Exception $e) {
460
  $this->log(
461
+ 'budgetmailer/exporter::exportUnregistered() failed '
462
  . 'with exception: ' . $e->getMessage()
463
  );
464
 
465
  Mage::logException($e);
466
  }
467
 
468
+ $this->log('budgetmailer/exporter::exportUnregistered() end');
469
 
470
  return $totals;
471
  }
472
 
473
+ public function exportUnregisteredPage($subscribe = true)
 
 
 
 
 
 
474
  {
475
+ $this->log('budgetmailer/exporter::exportUnregisteredPage() start');
476
+
477
  try {
478
+ $contacts = $emails = array();
479
+ $total = $fail = $success = 0;
 
 
480
 
481
+ foreach (
482
+ $this->getUnregisteredCollection()->getIterator() as $order
483
+ ) {
484
+ $contact = $this->getContact();
485
+ $contact->loadByEmail($order->getCustomerOrder(), false);
486
+
487
+ if (!$contact->getEntityId()) {
488
+ $this->getMapper()->orderToModel($order, $contact);
489
+
490
+ $address = $order->getBillingAddress();
491
+
492
+ if ($address && $address->getEntityId()) {
493
+ $this->getMapper()->addressToModel($address, $contact);
494
+ }
495
+
496
+ $contact->setUnsubscribed(!$subscribe);
497
+ $contact->setSubscribe($subscribe);
498
+
499
+ if (Mage::helper('budgetmailer/config')->isAdvancedOnOrderEnabled()) {
500
+ $tags = $this->getHelper()->getOrderTags($order);
501
+ $contact->setTags($tags);
502
+ }
503
+
504
+ $emails[] = $contact->getEmail();
505
+ } else {
506
+ $contact->setUnsubscribed(!$subscribe);
507
+ $contact->setSubscribe($subscribe);
508
+ }
509
+
510
+ $contacts[] = $this->getMapper()->contactToApi($contact);
511
+ }
512
+
513
+ if (count($contacts)) {
514
+ list($total, $fail, $success, $contactsNew) =
515
+ $this->getClient()->postContacts(
516
+ $contacts, Professio_BudgetMailer_Model_Client::BULK_INS
517
+ );
518
 
519
+ if (isset($contactsNew->Success) && is_array($contactsNew->Success)) {
520
+ foreach ($contactsNew->Success as $contact) {
521
+ Mage::getModel('budgetmailer/importer')
522
+ ->importContact($contact);
523
+ }
524
+ }
525
  }
526
  } catch (Exception $e) {
527
  $this->log(
528
+ 'budgetmailer/exporter::exportUnregisteredPage() failed '
529
  . 'with exception: ' . $e->getMessage()
530
  );
531
 
532
  Mage::logException($e);
533
  }
534
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
535
  $this->log(
536
+ 'budgetmailer/exporter::exportUnregisteredPage() end (total: '
537
+ . $total . ', fail: ' . $fail . ', success: ' . $success
 
538
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
 
540
+ return array($total, $fail, $success);
541
+ }
 
 
542
 
543
  /**
544
+ * Custom log wrapper - log only in developer mode
545
+ *
546
+ * @param string $message
 
547
  */
548
+ protected function log($message)
549
  {
550
+ if (Mage::getIsDeveloperMode()) {
551
+ Mage::log($message);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
552
  }
553
+ }
 
 
 
 
 
554
  }
app/code/community/Professio/BudgetMailer/Model/Importer.php CHANGED
@@ -464,6 +464,31 @@ class Professio_BudgetMailer_Model_Importer
464
  return $totals;
465
  }
466
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
  /**
468
  * Custom logging method - logging only if in developer mode
469
  *
464
  return $totals;
465
  }
466
 
467
+ public function deleteContact($contactApi)
468
+ {
469
+ $this->log('budgetmailer/importer::deleteContact() start');
470
+
471
+ $contact = Mage::getModel('budgetmailer/contact');
472
+
473
+ if ($contactApi->email) {
474
+ $contact->loadByEmail($contactApi->email, false);
475
+ }
476
+
477
+ if (!$contact->getEntityId() && $contactApi->id) {
478
+ $contact->loadByBudgetMailerId($contactApi->id, false);
479
+ }
480
+
481
+ if ($contact->getEntityId()) {
482
+ $contact->delete();
483
+
484
+ return true;
485
+ }
486
+
487
+ $this->log('budgetmailer/importer::deleteContact() end');
488
+
489
+ return false;
490
+ }
491
+
492
  /**
493
  * Custom logging method - logging only if in developer mode
494
  *
app/code/community/Professio/BudgetMailer/Model/Observer.php CHANGED
@@ -75,110 +75,6 @@ class Professio_BudgetMailer_Model_Observer
75
  }
76
  }
77
 
78
- /**
79
- * Add mass actions to customer grid
80
- *
81
- * @param Varien_Event_Observer $observer
82
- */
83
- public function addMassAction($observer)
84
- {
85
- //$this->log('budgetmailer/observer::addMassAction() start');
86
-
87
- try {
88
- $block = $observer->getEvent()->getBlock();
89
- $controller = $block->getRequest()->getControllerName();
90
-
91
- if ('Mage_Adminhtml_Block_Widget_Grid_Massaction'
92
- == get_class($block)
93
- && in_array(
94
- $controller,
95
- array('customer', 'newsletter_subscriber')
96
- )
97
- ) {
98
- $url = '*/budgetmailer/';
99
-
100
- $block->addItem(
101
- 'budgetmailer_subscribe',
102
- array(
103
- 'label' => Mage::helper('budgetmailer')
104
- ->__('Subscribe to a BudgetMailer List'),
105
- 'url' => Mage::helper('adminhtml')
106
- ->getUrl($url . 'masssubscribe')
107
- )
108
- );
109
-
110
- $block->addItem(
111
- 'budgetmailer_unsubscribe',
112
- array(
113
- 'label' => Mage::helper('budgetmailer')
114
- ->__('Unsubscribe from a BudgetMailer List'),
115
- 'url' => Mage::helper('adminhtml')
116
- ->getUrl($url . 'massunsubscribe')
117
- )
118
- );
119
- }
120
- } catch (Exception $e) {
121
- $this->log('budgetmailer/observer::addMassAction() failed');
122
- Mage::logException($e);
123
- }
124
-
125
- //$this->log('budgetmailer/observer::addMassAction() end');
126
- }
127
-
128
- /**
129
- * After address delete - try to use new primary address, and update contact
130
- *
131
- * @param Varien_Event_Observer $observer
132
- */
133
- public function addressDeleteAfter($observer)
134
- {
135
- $this->log('budgetmailer/observer::addressDeleteAfter() start');
136
-
137
- try {
138
- if (Mage::helper('budgetmailer/config')
139
- ->isAdvancedOnAddressDeleteEnabled()
140
- ) {
141
- $address = $observer->getCustomerAddress();
142
- $customer = $address->getCustomer();
143
-
144
- if ($customer && $customer->getEntityId()) {
145
- $addressPrimary = Mage::helper('budgetmailer')
146
- ->getCustomersPrimaryAddress($customer);
147
-
148
- // check if primary address / map / save
149
- if ($address && $addressPrimary
150
- && $address->getEntityId()
151
- == $addressPrimary->getEntityId()
152
- ) {
153
- $contact = Mage::getModel('budgetmailer/contact')
154
- ->loadByCustomer($customer);
155
- Mage::helper('budgetmailer/mapper')
156
- ->addressToModel($address, $contact);
157
- $contact->save();
158
- }
159
- } else {
160
- $this->log(
161
- 'budgetmailer/observer::addressDeleteAfter() '
162
- . 'no customer'
163
- );
164
- }
165
- } else {
166
- $this->log(
167
- 'budgetmailer/observer::addressDeleteAfter() disabled'
168
- );
169
- }
170
- } catch (Exception $e) {
171
- $this->getSession()->addError($e->getMessage());
172
- $this->log(
173
- 'budgetmailer/observer::addressDeleteAfter() '
174
- . 'failed with exception: ' . $e->getMessage()
175
- );
176
- Mage::logException($e);
177
- }
178
-
179
- $this->log('budgetmailer/observer::addressDeleteAfter() end');
180
- }
181
-
182
  /**
183
  * After address save, check if primary and update contact
184
  *
@@ -527,6 +423,25 @@ class Professio_BudgetMailer_Model_Observer
527
  $this->log('budgetmailer/observer::salesOrderPlaceAfter() start');
528
 
529
  try {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
530
  if (Mage::helper('budgetmailer/config')
531
  ->isAdvancedOnOrderEnabled()) {
532
  $order = $observer->getEvent()->getOrder();
75
  }
76
  }
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  /**
79
  * After address save, check if primary and update contact
80
  *
423
  $this->log('budgetmailer/observer::salesOrderPlaceAfter() start');
424
 
425
  try {
426
+ $budgetmailerSubscribe = Mage::app()->getRequest()
427
+ ->getPost('bm_is_subscribed');
428
+
429
+ if ($budgetmailerSubscribe) {
430
+ $order = $observer->getEvent()->getOrder();
431
+ $email = $order->getCustomerEmail();
432
+
433
+ $contact = Mage::getModel('budgetmailer/contact');
434
+ $contact->loadByEmail($email);
435
+
436
+ Mage::helper('budgetmailer/mapper')
437
+ ->addressToModel($order->getBillingAddress(), $contact);
438
+ Mage::helper('budgetmailer/mapper')
439
+ ->orderToModel($order, $contact);
440
+
441
+ $contact->setSubscribe(true);
442
+ $contact->save();
443
+ }
444
+
445
  if (Mage::helper('budgetmailer/config')
446
  ->isAdvancedOnOrderEnabled()) {
447
  $order = $observer->getEvent()->getOrder();
app/code/community/Professio/BudgetMailer/controllers/Adminhtml/Budgetmailer/ContactController.php CHANGED
@@ -24,7 +24,6 @@
24
  class Professio_BudgetMailer_Adminhtml_Budgetmailer_ContactController
25
  extends Professio_BudgetMailer_Controller_Adminhtml_BudgetMailer
26
  {
27
-
28
  /**
29
  * Intiate new contact and try to load it by requested id
30
  *
@@ -43,6 +42,16 @@ extends Professio_BudgetMailer_Controller_Adminhtml_BudgetMailer
43
 
44
  return $contact;
45
  }
 
 
 
 
 
 
 
 
 
 
46
 
47
  /**
48
  * Displays list of contacts
@@ -249,8 +258,6 @@ extends Professio_BudgetMailer_Controller_Adminhtml_BudgetMailer
249
 
250
  /**
251
  * Delete multiple contacts as mass action
252
- *
253
- * @return null
254
  */
255
  public function massDeleteAction()
256
  {
@@ -264,50 +271,79 @@ extends Professio_BudgetMailer_Controller_Adminhtml_BudgetMailer
264
  );
265
  } else {
266
  try {
267
- foreach ($contactIds as $contactId) {
268
- $contact = Mage::getModel('budgetmailer/contact');
269
-
270
- try {
271
- $contact->setId($contactId)->delete();
272
- } catch(Professio_BudgetMailer_Exception $e) {
273
- Mage::getSingleton('adminhtml/session')->addError(
274
- Mage::helper('budgetmailer')
275
- ->__(
276
- 'There was an error deleting contacts '
277
- . 'from BudgetMailer API.'
278
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  );
280
- Mage::logException($e);
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  }
282
  }
283
 
284
- Mage::getSingleton('adminhtml/session')->addSuccess(
285
- Mage::helper('budgetmailer')
286
- ->__(
287
- 'Total of %d contacts were successfully deleted.',
288
- count($contactIds)
289
- )
290
- );
291
- } catch (Mage_Core_Exception $e) {
292
  Mage::getSingleton('adminhtml/session')
293
- ->addError($e->getMessage());
 
 
 
 
 
 
 
 
294
  } catch (Exception $e) {
295
  Mage::getSingleton('adminhtml/session')
296
  ->addError(
297
  Mage::helper('budgetmailer')
298
- ->__('There was an error deleting contacts.')
299
  );
 
300
  Mage::logException($e);
301
  }
302
  }
303
 
304
  $this->_redirect('*/*/index');
305
  }
306
-
307
  /**
308
- * Not used...
309
  */
310
- public function massStatusAction()
311
  {
312
  $contactIds = $this->getRequest()->getParam('contact');
313
 
@@ -315,183 +351,160 @@ extends Professio_BudgetMailer_Controller_Adminhtml_BudgetMailer
315
  Mage::getSingleton('adminhtml/session')
316
  ->addError(
317
  Mage::helper('budgetmailer')
318
- ->__('Please select contacts.')
319
  );
320
  } else {
321
  try {
322
- foreach ($contactIds as $contactId) {
323
- $contact = Mage::getSingleton('budgetmailer/contact');
324
- $contact->load($contactId)
325
- ->setStatus($this->getRequest()->getParam('status'))
326
- ->setIsMassupdate(true)
327
- ->save();
328
- }
329
-
330
- $this->_getSession()->addSuccess(
331
- $this->__(
332
- 'Total of %d contacts were successfully updated.',
333
- count($contactIds)
334
- )
335
  );
336
- } catch (Mage_Core_Exception $e) {
337
- Mage::getSingleton('adminhtml/session')
338
- ->addError($e->getMessage());
339
- } catch (Exception $e) {
340
- Mage::getSingleton('adminhtml/session')
341
- ->addError(
342
- Mage::helper('budgetmailer')
343
- ->__('There was an error updating contacts.')
344
  );
345
- Mage::logException($e);
346
- }
347
- }
348
-
349
- $this->_redirect('*/*/index');
350
- }
351
 
352
- /**
353
- * Mass unsubscribe contacts
354
- *
355
- * @return null
356
- */
357
- public function massUnsubscribedAction()
358
- {
359
- $contactIds = $this->getRequest()->getParam('contact');
360
-
361
- if (!is_array($contactIds)) {
362
- Mage::getSingleton('adminhtml/session')
363
- ->addError(
364
- Mage::helper('budgetmailer')
365
- ->__('Please select contacts.')
366
- );
367
- } else {
368
- try {
369
- foreach ($contactIds as $contactId) {
370
- $subscribe = !$this->getRequest()
371
- ->getParam('flag_unsubscribed');
372
-
373
- $contact = Mage::getSingleton('budgetmailer/contact');
374
- $contact->load($contactId);
375
-
376
- $contact->setUnsubscribed(!$subscribe);
377
- $contact->setSubscribe($subscribe);
378
 
379
- $contact->setIsMassupdate(true);
380
- $contact->save();
 
 
 
 
 
 
 
381
  }
382
 
383
- $this->_getSession()->addSuccess(
384
- $this->__(
385
- 'Total of %d contacts were successfully updated.',
386
- count($contactIds)
387
- )
388
- );
389
- } catch (Mage_Core_Exception $e) {
390
  Mage::getSingleton('adminhtml/session')
391
- ->addError($e->getMessage());
 
 
 
 
 
 
 
 
392
  } catch (Exception $e) {
393
  Mage::getSingleton('adminhtml/session')
394
  ->addError(
395
  Mage::helper('budgetmailer')
396
- ->__('There was an error updating contacts.')
397
  );
 
398
  Mage::logException($e);
399
  }
400
  }
401
 
402
  $this->_redirect('*/*/index');
403
  }
404
-
405
  /**
406
- * Not used
407
  */
408
- public function massListIdAction()
409
  {
 
410
  $contactIds = $this->getRequest()->getParam('contact');
411
 
412
  if (!is_array($contactIds)) {
413
  Mage::getSingleton('adminhtml/session')
414
  ->addError(
415
  Mage::helper('budgetmailer')
416
- ->__('Please select contacts.')
417
  );
418
  } else {
419
  try {
420
- foreach ($contactIds as $contactId) {
421
- $contact = Mage::getSingleton('budgetmailer/contact');
422
- $contact->load($contactId)
423
- ->setListId(
424
- $this->getRequest()->getParam('flag_list_id')
425
- )
426
- ->setIsMassupdate(true)
427
- ->save();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
428
  }
429
 
430
- $this->_getSession()
431
  ->addSuccess(
432
- $this->__(
433
- 'Total of %d contacts were successfully updated.',
434
- count($contactIds)
 
 
 
435
  )
436
  );
437
- } catch (Mage_Core_Exception $e) {
438
- Mage::getSingleton('adminhtml/session')
439
- ->addError($e->getMessage());
440
  } catch (Exception $e) {
441
  Mage::getSingleton('adminhtml/session')
442
  ->addError(
443
  Mage::helper('budgetmailer')
444
- ->__('There was an error updating contacts.')
445
  );
 
446
  Mage::logException($e);
447
  }
448
  }
449
 
450
  $this->_redirect('*/*/index');
451
  }
452
-
453
- /**
454
- * Not used
455
- */
456
- public function exportCsvAction()
457
- {
458
- $fileName = 'contact.csv';
459
- $content = $this->getLayout()
460
- ->createBlock('budgetmailer/adminhtml_contact_grid')
461
- ->getCsv();
462
- $this->_prepareDownloadResponse($fileName, $content);
463
- }
464
-
465
- /**
466
- * Not used
467
- */
468
- public function exportExcelAction()
469
- {
470
- $fileName = 'contact.xls';
471
- $content = $this->getLayout()
472
- ->createBlock('budgetmailer/adminhtml_contact_grid')
473
- ->getExcelFile();
474
- $this->_prepareDownloadResponse($fileName, $content);
475
- }
476
-
477
- /**
478
- * Not used
479
- */
480
- public function exportXmlAction()
481
- {
482
- $fileName = 'contact.xml';
483
- $content = $this->getLayout()
484
- ->createBlock('budgetmailer/adminhtml_contact_grid')
485
- ->getXml();
486
- $this->_prepareDownloadResponse($fileName, $content);
487
- }
488
-
489
- /**
490
- * Not used
491
- */
492
- protected function _isAllowed()
493
- {
494
- return Mage::getSingleton('admin/session')
495
- ->isAllowed('budgetmailer/contact');
496
- }
497
  }
24
  class Professio_BudgetMailer_Adminhtml_Budgetmailer_ContactController
25
  extends Professio_BudgetMailer_Controller_Adminhtml_BudgetMailer
26
  {
 
27
  /**
28
  * Intiate new contact and try to load it by requested id
29
  *
42
 
43
  return $contact;
44
  }
45
+
46
+ /**
47
+ * Check if current user can use this controller
48
+ * @return bool
49
+ */
50
+ protected function _isAllowed()
51
+ {
52
+ return Mage::getSingleton('admin/session')
53
+ ->isAllowed('budgetmailer/contact');
54
+ }
55
 
56
  /**
57
  * Displays list of contacts
258
 
259
  /**
260
  * Delete multiple contacts as mass action
 
 
261
  */
262
  public function massDeleteAction()
263
  {
271
  );
272
  } else {
273
  try {
274
+ $rs = array('total' => 0, 'fail' => 0, 'success' => 0);
275
+ $contactIdsChunks = array_chunk(
276
+ $contactIds, Professio_BudgetMailer_Model_Client::LIMIT
277
+ );
278
+
279
+ foreach($contactIdsChunks as $chunk) {
280
+ $collection = Mage::getModel('budgetmailer/contact')
281
+ ->getCollection();
282
+ $collection->addFieldToFilter(
283
+ 'entity_id', array('in' => $chunk)
284
+ );
285
+ $collection->load();
286
+
287
+ $contacts = array();
288
+ $map = array();
289
+
290
+ foreach($collection->getIterator() as $contact) {
291
+ $contactApi = new stdClass();
292
+ $contactApi->email = $contact->getEmail();
293
+
294
+ $contacts[] = $contactApi;
295
+ $map[$contact->getEmail()] = $contact->getId();
296
+ }
297
+
298
+ list($total, $fail, $success, $contactsDeleted)
299
+ = Mage::getSingleton('budgetmailer/client')->postContacts(
300
+ $contacts, Professio_BudgetMailer_Model_Client::BULK_DELETE
301
  );
302
+
303
+ $rs['total'] += $total;
304
+ $rs['fail'] += $fail;
305
+ $rs['success'] += $success;
306
+
307
+ if (isset($contactsDeleted->Success) && is_array($contactsDeleted->Success)) {
308
+ foreach($contactsDeleted->Success as $contactApi) {
309
+ if (isset($map[$contactApi->email])) {
310
+ $contact = Mage::getModel('budgetmailer/contact');
311
+ $contact->setEmail($contactApi->email); // set email to avoid reload from API
312
+ $contact->setId($map[$contactApi->email]);
313
+ $contact->delete(false);
314
+ }
315
+ }
316
  }
317
  }
318
 
 
 
 
 
 
 
 
 
319
  Mage::getSingleton('adminhtml/session')
320
+ ->addSuccess(
321
+ sprintf(
322
+ $this->__(
323
+ 'Deleting contacts finished '
324
+ . '(completed: %d, fail: %d, success: %d).'
325
+ ),
326
+ $rs['total'], $rs['fail'], $rs['success']
327
+ )
328
+ );
329
  } catch (Exception $e) {
330
  Mage::getSingleton('adminhtml/session')
331
  ->addError(
332
  Mage::helper('budgetmailer')
333
+ ->__('There was an unexpected error deleting the contact(s).')
334
  );
335
+
336
  Mage::logException($e);
337
  }
338
  }
339
 
340
  $this->_redirect('*/*/index');
341
  }
342
+
343
  /**
344
+ * Unsubscribe multiple contacts as mass action
345
  */
346
+ public function massUnsubscribeAction()
347
  {
348
  $contactIds = $this->getRequest()->getParam('contact');
349
 
351
  Mage::getSingleton('adminhtml/session')
352
  ->addError(
353
  Mage::helper('budgetmailer')
354
+ ->__('Please select contacts to unsubscribe.')
355
  );
356
  } else {
357
  try {
358
+ $rs = array('total' => 0, 'fail' => 0, 'success' => 0);
359
+ $contactIdsChunks = array_chunk(
360
+ $contactIds, Professio_BudgetMailer_Model_Client::LIMIT
 
 
 
 
 
 
 
 
 
 
361
  );
362
+
363
+ foreach($contactIdsChunks as $chunk) {
364
+ $collection = Mage::getModel('budgetmailer/contact')
365
+ ->getCollection();
366
+ $collection->addFieldToFilter(
367
+ 'entity_id', array('in' => $chunk)
 
 
368
  );
369
+ $collection->load();
 
 
 
 
 
370
 
371
+ $contacts = array();
372
+ $map = array();
373
+
374
+ foreach($collection->getIterator() as $contact) {
375
+ $contactApi = new stdClass();
376
+ $contactApi->email = $contact->getEmail();
377
+
378
+ $contacts[] = $contactApi;
379
+ $map[$contact->getEmail()] = $contact;
380
+ }
381
+
382
+ list($total, $fail, $success, $contactsDeleted)
383
+ = Mage::getSingleton('budgetmailer/client')->postContacts(
384
+ $contacts, Professio_BudgetMailer_Model_Client::BULK_UNSUB
385
+ );
386
+
387
+ $rs['total'] += $total;
388
+ $rs['fail'] += $fail;
389
+ $rs['success'] += $success;
 
 
 
 
 
 
 
390
 
391
+ if (isset($contactsDeleted->Success) && is_array($contactsDeleted->Success)) {
392
+ foreach($contactsDeleted->Success as $contactApi) {
393
+ if (isset($map[$contactApi->email])) {
394
+ $contact = $map[$contactApi->email];
395
+ $contact->setUnsubscribed(true);
396
+ $contact->save(false);
397
+ }
398
+ }
399
+ }
400
  }
401
 
 
 
 
 
 
 
 
402
  Mage::getSingleton('adminhtml/session')
403
+ ->addSuccess(
404
+ sprintf(
405
+ $this->__(
406
+ 'Unsubscribing contacts finished '
407
+ . '(completed: %d, fail: %d, success: %d).'
408
+ ),
409
+ $rs['total'], $rs['fail'], $rs['success']
410
+ )
411
+ );
412
  } catch (Exception $e) {
413
  Mage::getSingleton('adminhtml/session')
414
  ->addError(
415
  Mage::helper('budgetmailer')
416
+ ->__('There was an unexpected error unsubscribing the contact(s).')
417
  );
418
+
419
  Mage::logException($e);
420
  }
421
  }
422
 
423
  $this->_redirect('*/*/index');
424
  }
425
+
426
  /**
427
+ * Delete and unsubscribe multiple contacts as mass action
428
  */
429
+ public function massDeleteUnsubscribeAction()
430
  {
431
+
432
  $contactIds = $this->getRequest()->getParam('contact');
433
 
434
  if (!is_array($contactIds)) {
435
  Mage::getSingleton('adminhtml/session')
436
  ->addError(
437
  Mage::helper('budgetmailer')
438
+ ->__('Please select contacts to unsubscribe and delete.')
439
  );
440
  } else {
441
  try {
442
+ $rs = array('total' => 0, 'fail' => 0, 'success' => 0);
443
+ $contactIdsChunks = array_chunk(
444
+ $contactIds, Professio_BudgetMailer_Model_Client::LIMIT
445
+ );
446
+
447
+ foreach($contactIdsChunks as $chunk) {
448
+ $collection = Mage::getModel('budgetmailer/contact')
449
+ ->getCollection();
450
+ $collection->addFieldToFilter(
451
+ 'entity_id', array('in' => $chunk)
452
+ );
453
+ $collection->load();
454
+
455
+ $contacts = array();
456
+ $map = array();
457
+
458
+ foreach($collection->getIterator() as $contact) {
459
+ $contactApi = new stdClass();
460
+ $contactApi->email = $contact->getEmail();
461
+
462
+ $contacts[] = $contactApi;
463
+ $map[$contact->getEmail()] = $contact->getId();
464
+ }
465
+
466
+ list($total, $fail, $success, $contactsDeleted)
467
+ = Mage::getSingleton('budgetmailer/client')->postContacts(
468
+ $contacts, Professio_BudgetMailer_Model_Client::BULK_DELUNSUB
469
+ );
470
+
471
+ $rs['total'] += $total;
472
+ $rs['fail'] += $fail;
473
+ $rs['success'] += $success;
474
+
475
+ if (isset($contactsDeleted->Success) && is_array($contactsDeleted->Success)) {
476
+ foreach($contactsDeleted->Success as $contactApi) {
477
+ if (isset($map[$contactApi->email])) {
478
+ $contact = Mage::getModel('budgetmailer/contact');
479
+ $contact->setEmail($contactApi->email); // set email to avoid reload from API
480
+ $contact->setId($map[$contactApi->email]);
481
+ $contact->delete(false);
482
+ }
483
+ }
484
+ }
485
  }
486
 
487
+ Mage::getSingleton('adminhtml/session')
488
  ->addSuccess(
489
+ sprintf(
490
+ $this->__(
491
+ 'Unsubscribing and deleting contacts finished '
492
+ . '(completed: %d, fail: %d, success: %d).'
493
+ ),
494
+ $rs['total'], $rs['fail'], $rs['success']
495
  )
496
  );
 
 
 
497
  } catch (Exception $e) {
498
  Mage::getSingleton('adminhtml/session')
499
  ->addError(
500
  Mage::helper('budgetmailer')
501
+ ->__('There was an unexpected error unsubscribing and deleting the contact(s).')
502
  );
503
+
504
  Mage::logException($e);
505
  }
506
  }
507
 
508
  $this->_redirect('*/*/index');
509
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
510
  }
app/code/community/Professio/BudgetMailer/controllers/Adminhtml/BudgetmailerController.php CHANGED
@@ -132,7 +132,33 @@ extends Mage_Adminhtml_Controller_Action
132
  );
133
  } catch (Exception $e) {
134
  $this->getSession()
135
- ->addError($this->__('Newsletter export import failed.'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  Mage::logException($e);
137
  }
138
 
@@ -176,6 +202,7 @@ extends Mage_Adminhtml_Controller_Action
176
  $rs = $this->getExporter()->massSubscribeCustomers(
177
  $this->getRequest()->getParam('customer'), true
178
  );
 
179
  $message = Mage::helper('budgetmailer')->__(
180
  sprintf(
181
  'Subscribed %d customer(s) (fail: %d, success: %d).',
@@ -210,6 +237,10 @@ extends Mage_Adminhtml_Controller_Action
210
  }
211
  } catch(Exception $e) {
212
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
 
 
 
 
213
  }
214
  }
215
 
@@ -224,6 +255,7 @@ extends Mage_Adminhtml_Controller_Action
224
  $rs = $this->getExporter()->massSubscribeCustomers(
225
  $this->getRequest()->getParam('customer'), false
226
  );
 
227
  $message = Mage::helper('budgetmailer')->__(
228
  sprintf(
229
  'Unsubscribed %d customer(s) (fail: %d, success: %d).',
@@ -247,8 +279,76 @@ extends Mage_Adminhtml_Controller_Action
247
  $message = Mage::helper('adminhtml')
248
  ->__('Please select some item(s).');
249
  }
 
 
 
 
 
 
 
 
 
 
250
  } catch(Exception $e) {
251
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  }
253
  }
254
  }
132
  );
133
  } catch (Exception $e) {
134
  $this->getSession()
135
+ ->addError($this->__('Newsletter export failed.'));
136
+ Mage::logException($e);
137
+ }
138
+
139
+ $this->_redirect('*/budgetmailer_contact/index');
140
+ }
141
+
142
+ /**
143
+ * Export unregistered customers action
144
+ */
145
+ public function exportunregisteredAction()
146
+ {
147
+ try {
148
+ $rs = $this->getExporter()->exportUnregistered();
149
+ $this->getSession()
150
+ ->addSuccess(
151
+ sprintf(
152
+ $this->__(
153
+ 'Unregistered customers export finished '
154
+ . '(completed: %d, fail: %d, success: %d).'
155
+ ),
156
+ $rs['total'], $rs['fail'], $rs['success']
157
+ )
158
+ );
159
+ } catch (Exception $e) {
160
+ $this->getSession()
161
+ ->addError($this->__('Unregistered customers export failed.'));
162
  Mage::logException($e);
163
  }
164
 
202
  $rs = $this->getExporter()->massSubscribeCustomers(
203
  $this->getRequest()->getParam('customer'), true
204
  );
205
+
206
  $message = Mage::helper('budgetmailer')->__(
207
  sprintf(
208
  'Subscribed %d customer(s) (fail: %d, success: %d).',
237
  }
238
  } catch(Exception $e) {
239
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
240
+ if (!isset($redirect)) {
241
+ $redirect = '/';
242
+ }
243
+ $this->_redirect($redirect);
244
  }
245
  }
246
 
255
  $rs = $this->getExporter()->massSubscribeCustomers(
256
  $this->getRequest()->getParam('customer'), false
257
  );
258
+
259
  $message = Mage::helper('budgetmailer')->__(
260
  sprintf(
261
  'Unsubscribed %d customer(s) (fail: %d, success: %d).',
279
  $message = Mage::helper('adminhtml')
280
  ->__('Please select some item(s).');
281
  }
282
+
283
+ if ($rs) {
284
+ Mage::getSingleton('adminhtml/session')->addSuccess($message);
285
+ } else {
286
+ Mage::getSingleton('adminhtml/session')->addError($message);
287
+ }
288
+
289
+ if (isset($redirect)) {
290
+ $this->_redirect($redirect);
291
+ }
292
  } catch(Exception $e) {
293
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
294
+ if (!isset($redirect)) {
295
+ $redirect = '/';
296
+ }
297
+ $this->_redirect($redirect);
298
+ }
299
+ }
300
+
301
+ /**
302
+ * Mass delete customers or subscribers
303
+ */
304
+ public function massdeleteAction()
305
+ {
306
+ try {
307
+ if ($this->getRequest()->getParam('customer')) {
308
+ $redirect = '*/customer/index';
309
+ $rs = $this->getExporter()->massDeleteCustomers(
310
+ $this->getRequest()->getParam('customer'), false
311
+ );
312
+
313
+ $message = Mage::helper('budgetmailer')->__(
314
+ sprintf(
315
+ 'Deleted %d customer(s) (fail: %d, success: %d).',
316
+ $rs['total'], $rs['fail'], $rs['success']
317
+ )
318
+ );
319
+ } elseif ($this->getRequest()->getParam('subscriber')) {
320
+ $redirect = '*/newsletter_subscriber/index';
321
+ $rs = $this->getExporter()->massDeleteSubscribers(
322
+ $this->getRequest()->getParam('subscriber'), false
323
+ );
324
+ $message = Mage::helper('budgetmailer')->__(
325
+ sprintf(
326
+ 'Deleted %d subscriber(s) '
327
+ . '(fail: %d, success: %d).',
328
+ $rs['total'], $rs['fail'], $rs['success']
329
+ )
330
+ );
331
+ } else {
332
+ $rs = false;
333
+ $message = Mage::helper('adminhtml')
334
+ ->__('Please select some item(s).');
335
+ }
336
+
337
+ if ($rs) {
338
+ Mage::getSingleton('adminhtml/session')->addSuccess($message);
339
+ } else {
340
+ Mage::getSingleton('adminhtml/session')->addError($message);
341
+ }
342
+
343
+ if (isset($redirect)) {
344
+ $this->_redirect($redirect);
345
+ }
346
+ } catch(Exception $e) {
347
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
348
+ if (!isset($redirect)) {
349
+ $redirect = '/';
350
+ }
351
+ $this->_redirect($redirect);
352
  }
353
  }
354
  }
app/code/community/Professio/BudgetMailer/etc/config.xml CHANGED
@@ -42,16 +42,6 @@
42
  </observers>
43
  </admin_system_config_changed_section_budgetmailer>
44
 
45
- <core_block_abstract_prepare_layout_before>
46
- <observers>
47
- <budgetmailer_core_block_abstract_prepare_layout_before>
48
- <class>budgetmailer/observer</class>
49
- <method>addMassAction</method>
50
- <type>singleton</type>
51
- </budgetmailer_core_block_abstract_prepare_layout_before>
52
- </observers>
53
- </core_block_abstract_prepare_layout_before>
54
-
55
  <customer_save_after>
56
  <observers>
57
  <budgetmailer_customer_customer_save_after>
@@ -112,11 +102,11 @@
112
  <advanced>
113
  <address_type>billing</address_type>
114
  <frontend>1</frontend>
115
- <on_address_delete>use_new</on_address_delete>
116
  <on_address_update>update</on_address_update>
117
  <on_customer_delete>ignore</on_customer_delete>
118
  <on_customer_update>update</on_customer_update>
119
  <on_order>1</on_order>
 
120
  </advanced>
121
  </budgetmailer>
122
  </default>
@@ -177,6 +167,11 @@
177
  <budgetmailer>
178
  <class>Professio_BudgetMailer_Block</class>
179
  </budgetmailer>
 
 
 
 
 
180
  </blocks>
181
 
182
  <helpers>
@@ -196,16 +191,6 @@
196
  </observers>
197
  </customer_address_save_after>
198
 
199
- <customer_address_delete_after>
200
- <observers>
201
- <budgetmailer_customer_customer_save_after>
202
- <class>budgetmailer/observer</class>
203
- <method>addressDeleteAfter</method>
204
- <type>singleton</type>
205
- </budgetmailer_customer_customer_save_after>
206
- </observers>
207
- </customer_address_delete_after>
208
-
209
  <customer_delete_after>
210
  <observers>
211
  <budgetmailer_customer_customer_delete_after>
42
  </observers>
43
  </admin_system_config_changed_section_budgetmailer>
44
 
 
 
 
 
 
 
 
 
 
 
45
  <customer_save_after>
46
  <observers>
47
  <budgetmailer_customer_customer_save_after>
102
  <advanced>
103
  <address_type>billing</address_type>
104
  <frontend>1</frontend>
 
105
  <on_address_update>update</on_address_update>
106
  <on_customer_delete>ignore</on_customer_delete>
107
  <on_customer_update>update</on_customer_update>
108
  <on_order>1</on_order>
109
+ <on_create_account>unchecked</on_create_account>
110
  </advanced>
111
  </budgetmailer>
112
  </default>
167
  <budgetmailer>
168
  <class>Professio_BudgetMailer_Block</class>
169
  </budgetmailer>
170
+ <checkout>
171
+ <rewrite>
172
+ <agreements>Professio_BudgetMailer_Block_CheckoutAgreements</agreements>
173
+ </rewrite>
174
+ </checkout>
175
  </blocks>
176
 
177
  <helpers>
191
  </observers>
192
  </customer_address_save_after>
193
 
 
 
 
 
 
 
 
 
 
 
194
  <customer_delete_after>
195
  <observers>
196
  <budgetmailer_customer_customer_delete_after>
app/code/community/Professio/BudgetMailer/etc/system.xml CHANGED
@@ -126,7 +126,7 @@
126
  <show_in_default>1</show_in_default>
127
  <show_in_website>1</show_in_website>
128
  <show_in_store>1</show_in_store>
129
- <comment>Time to live of local contacts data, for both modes. Please do not change this value, unless you are understand how this works.</comment>
130
  </ttl>
131
  </fields>
132
  </sync>
@@ -161,17 +161,6 @@
161
  <comment>Select address that will be synchronized.</comment>
162
  </address_type>
163
 
164
- <on_address_delete translate="label comment" module="budgetmailer">
165
- <label>On Primary Address Delete</label>
166
- <frontend_type>select</frontend_type>
167
- <source_model>budgetmailer/config_source_delete_address</source_model>
168
- <sort_order>30</sort_order>
169
- <show_in_default>1</show_in_default>
170
- <show_in_website>1</show_in_website>
171
- <show_in_store>1</show_in_store>
172
- <comment>Select address update behaviour.</comment>
173
- </on_address_delete>
174
-
175
  <on_address_update translate="label comment" module="budgetmailer">
176
  <label>On Primary Address Update</label>
177
  <frontend_type>select</frontend_type>
@@ -215,6 +204,17 @@
215
  <show_in_store>1</show_in_store>
216
  <comment>If enabled, contact will be tagged by category names of ordered products.</comment>
217
  </on_order>
 
 
 
 
 
 
 
 
 
 
 
218
  </fields>
219
  </advanced>
220
  </groups>
126
  <show_in_default>1</show_in_default>
127
  <show_in_website>1</show_in_website>
128
  <show_in_store>1</show_in_store>
129
+ <comment>Time to live of local contacts data, for both modes. Please do not change this value, unless you understand how this works.</comment>
130
  </ttl>
131
  </fields>
132
  </sync>
161
  <comment>Select address that will be synchronized.</comment>
162
  </address_type>
163
 
 
 
 
 
 
 
 
 
 
 
 
164
  <on_address_update translate="label comment" module="budgetmailer">
165
  <label>On Primary Address Update</label>
166
  <frontend_type>select</frontend_type>
204
  <show_in_store>1</show_in_store>
205
  <comment>If enabled, contact will be tagged by category names of ordered products.</comment>
206
  </on_order>
207
+
208
+ <on_create_account translate="label comment" module="budgetmailer">
209
+ <label>Create an Account Behaviour</label>
210
+ <frontend_type>select</frontend_type>
211
+ <source_model>budgetmailer/config_source_account</source_model>
212
+ <sort_order>80</sort_order>
213
+ <show_in_default>1</show_in_default>
214
+ <show_in_website>1</show_in_website>
215
+ <show_in_store>1</show_in_store>
216
+ <comment>Select how the newsletter sign-up should look and behave, when creating new account.</comment>
217
+ </on_create_account>
218
  </fields>
219
  </advanced>
220
  </groups>
app/design/frontend/base/default/template/budgetmailer/onepage-agreements.phtml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Professio_BudgetMailer extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Professio
13
+ * @package Professio_BudgetMailer
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+
18
+ /**
19
+ * Subscription form before agreements.
20
+ *
21
+ * @category Professio
22
+ * @package Professio_BudgetMailer
23
+ */
24
+ if (!$this->getAgreements() && $this->isCurrentCustomerSignedUp()) { return; } ?>
25
+
26
+ <form action="" id="checkout-agreements" onsubmit="return false;">
27
+
28
+ <?php if ($this->getConfigHelper()->isAdvancedFrontendEnabled() && !$this->isCurrentCustomerSignedUp()):
29
+ $style = $this->isSignupHidden() ? ' style="display: none"' : null;
30
+ ?>
31
+ <div class="buttons-set"<?php print $style ?>>
32
+ <ul class="form-list">
33
+ <li>
34
+ <div>
35
+ <?php $checked = $this->isSignupChecked() ? ' checked="checked"' : null; ?>
36
+ <input<?php print $checked?> type="checkbox" name="bm_is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="bm_is_subscribed" class="checkbox" />
37
+ <label for="bm_is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
38
+ </div>
39
+ </li>
40
+ </ul>
41
+ </div>
42
+ <?php endif; ?>
43
+
44
+ <?php if ($this->getAgreements()): ?>
45
+ <ol class="checkout-agreements">
46
+ <?php foreach ($this->getAgreements() as $_a): ?>
47
+ <li>
48
+ <div class="agreement-content"<?php echo ($_a->getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>>
49
+ <?php if ($_a->getIsHtml()):?>
50
+ <?php echo $_a->getContent() ?>
51
+ <?php else:?>
52
+ <?php echo nl2br($this->escapeHtml($_a->getContent())) ?>
53
+ <?php endif; ?>
54
+ </div>
55
+ <p class="agree">
56
+ <input type="checkbox" id="agreement-<?php echo $_a->getId()?>" name="agreement[<?php echo $_a->getId()?>]" value="1" title="<?php echo $this->escapeHtml($_a->getCheckboxText()) ?>" class="checkbox" /><label for="agreement-<?php echo $_a->getId()?>"><?php echo $_a->getIsHtml() ? $_a->getCheckboxText() : $this->escapeHtml($_a->getCheckboxText()) ?></label>
57
+ </p>
58
+ </li>
59
+ <?php endforeach ?>
60
+ </ol>
61
+ <?php endif; ?>
62
+
63
+ </form>
app/design/frontend/base/default/template/budgetmailer/subscribe/mini.phtml CHANGED
@@ -21,13 +21,20 @@
21
  * @category Professio
22
  * @package Professio_BudgetMailer
23
  */
 
 
 
 
 
 
 
24
  ?>
25
  <script type="text/javascript">
26
- var bm_li = '<li class="control">';
27
  bm_li += '<div class="input-box">';
28
- bm_li += '<input type="checkbox" name="bm_is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="bm_is_subscribed"<?php if($this->getFormData()->getBmIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />';
29
  bm_li += '</div>';
30
- bm_li += '<label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>';
31
  bm_li += '</li>';
32
  // XXX add dynamically subscribe button here...
33
  //#form-validate .form-list ... append li.control etc
21
  * @category Professio
22
  * @package Professio_BudgetMailer
23
  */
24
+
25
+ if (!$this->getConfigHelper()->isAdvancedFrontendEnabled()) {
26
+ return '';
27
+ }
28
+
29
+ $style = $this->isSignupHidden() ? ' style="display: none"' : null;
30
+ $checked = $this->isSignupChecked() ? ' checked="checked"' : null;
31
  ?>
32
  <script type="text/javascript">
33
+ var bm_li = '<li class="control"<?php print $style ?>>';
34
  bm_li += '<div class="input-box">';
35
+ bm_li += '<input<?php print $checked ?> type="checkbox" name="bm_is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="bm_is_subscribed"<?php if($this->getFormData()->getBmIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />';
36
  bm_li += '</div>';
37
+ bm_li += '<label for="bm_is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>';
38
  bm_li += '</li>';
39
  // XXX add dynamically subscribe button here...
40
  //#form-validate .form-list ... append li.control etc
app/design/frontend/rwd/default/template/budgetmailer/onepage-agreements.phtml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Professio_BudgetMailer extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/mit-license.php
11
+ *
12
+ * @category Professio
13
+ * @package Professio_BudgetMailer
14
+ * @copyright Copyright (c) 2015
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+
18
+ /**
19
+ * Subscription form before agreements.
20
+ *
21
+ * @category Professio
22
+ * @package Professio_BudgetMailer
23
+ */
24
+ if (!$this->getAgreements() && $this->isCurrentCustomerSignedUp()) { return; } ?>
25
+
26
+ <form action="" id="checkout-agreements" onsubmit="return false;">
27
+
28
+ <?php if ($this->getConfigHelper()->isAdvancedFrontendEnabled() && !$this->isCurrentCustomerSignedUp()):
29
+ $style = $this->isSignupHidden() ? ' style="display: none"' : null;
30
+ ?>
31
+ <div class="buttons-set"<?php print $style ?>>
32
+ <ul class="form-list">
33
+ <li>
34
+ <div>
35
+ <?php $checked = $this->isSignupChecked() ? ' checked="checked"' : null; ?>
36
+ <input<?php print $checked?> type="checkbox" name="bm_is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="bm_is_subscribed" class="checkbox" />
37
+ <label for="bm_is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
38
+ </div>
39
+ </li>
40
+ </ul>
41
+ </div>
42
+ <?php endif; ?>
43
+
44
+ <?php if ($this->getAgreements()): ?>
45
+ <ol class="checkout-agreements">
46
+ <?php foreach ($this->getAgreements() as $_a): ?>
47
+ <li>
48
+ <div class="agreement-content"<?php echo ($_a->getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>>
49
+ <?php if ($_a->getIsHtml()):?>
50
+ <?php echo $_a->getContent() ?>
51
+ <?php else:?>
52
+ <?php echo nl2br($this->escapeHtml($_a->getContent())) ?>
53
+ <?php endif; ?>
54
+ </div>
55
+ <p class="agree">
56
+ <input type="checkbox" id="agreement-<?php echo $_a->getId()?>" name="agreement[<?php echo $_a->getId()?>]" value="1" title="<?php echo $this->escapeHtml($_a->getCheckboxText()) ?>" class="checkbox" /><label for="agreement-<?php echo $_a->getId()?>"><?php echo $_a->getIsHtml() ? $_a->getCheckboxText() : $this->escapeHtml($_a->getCheckboxText()) ?></label>
57
+ </p>
58
+ </li>
59
+ <?php endforeach ?>
60
+ </ol>
61
+ <?php endif; ?>
62
+
63
+ </form>
app/design/frontend/rwd/default/template/budgetmailer/subscribe/mini.phtml CHANGED
@@ -21,13 +21,20 @@
21
  * @category Professio
22
  * @package Professio_BudgetMailer
23
  */
 
 
 
 
 
 
 
24
  ?>
25
  <script type="text/javascript">
26
- var bm_li = '<li class="control">';
27
  bm_li += '<div class="input-box">';
28
- bm_li += '<input type="checkbox" name="bm_is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="bm_is_subscribed"<?php if($this->getFormData()->getBmIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />';
29
  bm_li += '</div>';
30
- bm_li += '<label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>';
31
  bm_li += '</li>';
32
  // XXX add dynamically subscribe button here...
33
  //#form-validate .form-list ... append li.control etc
21
  * @category Professio
22
  * @package Professio_BudgetMailer
23
  */
24
+
25
+ if (!$this->getConfigHelper()->isAdvancedFrontendEnabled()) {
26
+ return '';
27
+ }
28
+
29
+ $style = $this->isSignupHidden() ? ' style="display: none"' : null;
30
+ $checked = $this->isSignupChecked() ? ' checked="checked"' : null;
31
  ?>
32
  <script type="text/javascript">
33
+ var bm_li = '<li class="control"<?php print $style ?>>';
34
  bm_li += '<div class="input-box">';
35
+ bm_li += '<input<?php print $checked ?> type="checkbox" name="bm_is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="bm_is_subscribed"<?php if($this->getFormData()->getBmIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />';
36
  bm_li += '</div>';
37
+ bm_li += '<label for="bm_is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>';
38
  bm_li += '</li>';
39
  // XXX add dynamically subscribe button here...
40
  //#form-validate .form-list ... append li.control etc
app/locale/en_US/Professio_BudgetMailer.csv CHANGED
@@ -1,39 +1,65 @@
1
- "Contact","Contact"
2
- "Subscribe","Subscribe"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  "Save Contact","Save Contact"
4
  "Delete Contact","Delete Contact"
5
  "Add Contact","Add Contact"
6
- "Delete","Delete"
7
- "Are you sure?","Are you sure?"
8
- "Change Unsubscribed","Change Unsubscribed"
9
- "Unsubscribed","Unsubscribed"
10
- "Yes","Yes"
11
- "No","No"
12
  "Delete Orphans","Delete Orphans"
13
  "Export Magento Customers","Export Magento Customers"
14
  "Export Magento Newsletter Subscribers","Export Magento Newsletter Subscribers"
 
15
  "Import BudgetMailer Contacts","Import BudgetMailer Contacts"
16
- "BudgetMailer Newsletter","BudgetMailer Newsletter"
17
- "List","List"
18
- "Budgetmailer ID","BudgetMailer ID"
19
- "Name","Name"
20
- "Status","Status"
21
- "Enabled","Enabled"
22
- "Disabled","Disabled"
23
- "Save List","Save List"
24
- "Delete List","Delete List"
25
- "Save and Continue Edit","Save and Continue Edit"
26
- "Add List","Add List"
27
- "Id","Id"
28
- "Created at","Created at"
29
- "Updated at","Updated at"
30
- "Action","Action"
31
- "Edit","Edit"
32
- "Change status","Change status"
33
- "Remove","Remove"
34
- "Add Tag","Add Tag"
35
- "No Tags","No Tags"
36
- "BudgetMailer list is not set.","BudgetMailer list is not set."
37
  "Couldn't delete contact from BudgetMailer API.","Couldn't delete contact from BudgetMailer API."
38
  "Couldn't delete tag from contact from BudgetMailer API.","Couldn't delete tag from contact from BudgetMailer API."
39
  "Couldn't get the contact from BudgetMailer API.","Couldn't get the contact from BudgetMailer API."
@@ -41,90 +67,47 @@
41
  "Couldn't get the lists from BudgetMailer API.","Couldn't get the lists from BudgetMailer API."
42
  "Couldn't get tags from BudgetMailer API.","Couldn't get tags from BudgetMailer API."
43
  "Couldn't subscribe contact to BudgetMailer API.","Couldn't subscribe contact to BudgetMailer API."
44
- "Couldn't bulk subscribe contacts to BudgetMailer API.","Couldn't bulk subscribe contacts to BudgetMailer API."
 
45
  "Couldn't post tags to BudgetMailer API.","Couldn't post tags to BudgetMailer API."
46
  "Couldn't update contact in BudgetMailer API.","Couldn't update contact in BudgetMailer API."
 
47
  "Billing Address","Billing Address"
48
  "Shipping Address","Shipping Address"
49
- "Use new primary address","Use new primary address"
50
  "Do nothing","Do nothing"
 
 
 
 
51
  "Select List","Select List"
52
  "Update Contact","Update Contact"
53
- "Subscribe to a BudgetMailer List","Subscribe to a BudgetMailer List"
54
- "Unsubscribe from a BudgetMailer List","Unsubscribe from a BudgetMailer List"
55
- "Invalid API endpoint, key and secret combination.","Invalid API endpoint, key and secret combination."
56
- "API endpoint, key and secret combination is valid.","API endpoint, key and secret combination is valid."
57
- "Contacts","Contacts"
58
- "This contact no longer exists.","This contact no longer exists."
59
- "There was a problem saving the contact.","There was a problem saving the contact."
60
- "Unable to find contact to save.","Unable to find contact to save."
61
- "Contact was successfully deleted.","Contact was successfully deleted."
62
- "There was an error deleting contact.","There was an error deleting contact."
63
- "Could not find contact to delete.","Could not find contact to delete."
64
- "Please select contacts to delete.","Please select contacts to delete."
65
- "There was an error deleting contacts.","There was an error deleting contacts."
66
- "Please select contacts.","Please select contacts."
67
- "There was an error updating contacts.","There was an error updating contacts."
68
- "Deleting of orphan contacts failed.","Deleting of orphan contacts failed."
69
- "Customers import failed.","Customers import failed."
70
- "Newsletter subscribers import failed.","Newsletter subscribers import failed."
71
- "BudgetMailer contacts import failed.","BudgetMailer contacts import failed."
72
- "Please select some item(s).","Please select some item(s)."
73
  "Newsletter Subscription","Newsletter Subscription"
74
- "The subscription has been saved.","The subscription has been saved."
75
- "The subscription has been removed.","The subscription has been removed."
76
- "Unexpected error:","Unexpected error:"
77
- "This URL works only with HTTPS.","This URL works only with HTTPS."
78
- "Webhook disabled.","Webhook disabled."
79
- "Invalid signature.","Invalid signature."
80
- "Nothing to do.","Nothing to do."
81
- "OK","OK"
82
  "Subscribed to newsletter?","Subscribed to newsletter?"
83
- "Back","Back"
84
- "Save","Save"
85
- "Sign Up for Newsletter","Sign Up for Newsletter"
86
- "Newsletter","Newsletter"
87
  "Sign Up for Our Newsletter:","Sign Up for Our Newsletter:"
88
  "Sign up for our newsletter","Sign up for our newsletter"
89
- "Subscribe","Subscribe"
90
- "Company", "Company"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  "Company Name","Company Name"
92
  "Country Code","Country Code"
93
- "API Endpoint","API Endpoint"
94
- "API Key","API Key"
95
- "API Secret","API Secret"
96
- "BudgetMailer API Endpoint. Please don't change the URL unless you are instructed to.","BudgetMailer API Endpoint. Please don't change the URL unless you are instructed to."
97
- "Insert your BudgetMailer API Key.","Insert your BudgetMailer API Key."
98
- "Insert your BudgetMailer API Secret.","Insert your BudgetMailer API Secret."
99
- "Please select the BudgetMailer List you want to use with Magento.","Please select the BudgetMailer List you want to use with Magento."
100
- "Use Cron Job","Use Cron Job"
101
- "In this mode, data will be synchronized periodically, every day at 1 a.m.","In this mode, data will be synchronized periodically, every day at 1 a.m."
102
- "Use webhook","Use webhook"
103
- "In this mode, BudgetMailer Contacts will be synchronized by webhook in a real time. However this requires having SSL certificate installed, and Magento configured to use HTTPS protocol.","In this mode, BudgetMailer Contacts will be synchronized by webhook in a real time. However this requires having SSL certificate installed, and Magento configured to use HTTPS protocol."
104
- "Local data TTL","Local data TTL"
105
- "Time to live of local contacts data, for both modes. Please do not change this value, unless you are understand how this works.","Time to live of local contacts data, for both modes. Please do not change this value, unless you are understand how this works."
106
- "Enable front-end output","Enable front-end output"
107
- "If disabled, this module, won't have any front-end output.","If disabled, this module, won't have any front-end output."
108
- "Use Address","Use Address"
109
- "Select address that will be synchronized.","Select address that will be synchronized."
110
- "On Primary Address Delete","On Primary Address Delete"
111
- "Select address update behaviour.","Select address update behaviour."
112
- "On Primary Address Update","On Primary Address Update"
113
- "On Customer Delete","On Customer Delete"
114
- "Select address update behaviour.","Select address update behaviour."
115
- "On Customer Update","On Customer Update"
116
- "Select customer update behaviour.","Select customer update behaviour."
117
- "Tag Customers after Order","Tag Customers after Order"
118
- "If enabled, contact will be tagged by category names of ordered products.","If enabled, contact will be tagged by category names of ordered products."
119
- "Newsletter Subscription","Newsletter Subscription"
120
- "Customers export finished (completed: %d, fail: %d, success: %d).","Customers export finished (completed: %d, fail: %d, success: %d)."
121
- "Newsletter Subscribers export finished (completed: %d, fail: %d, success: %d).","Newsletter Subscribers export finished (completed: %d, fail: %d, success: %d)."
122
- "BudgetMailer contacts import finished (completed: %d, failed: %d).","BudgetMailer contacts import finished (completed: %d, failed: %d)."
123
- "Delete orphan contacts finished (completed: %d, deleted: %d, skipped: %d).","Delete orphan contacts finished (completed: %d, deleted: %d, skipped: %d)."
124
- "Yes","Yes"
125
- "No","No"
126
- "Billing Address","Billing Address"
127
- "Shipping Address","Shipping Address"
128
- "Use new primary address","Use new primary address"
129
- "Update Contact","Update Contact"
130
- "Do nothing","Do nothing"
1
+ "Unexpected error:","Unexpected error:"
2
+ "This URL works only with HTTPS.","This URL works only with HTTPS."
3
+ "Webhook disabled.","Webhook disabled."
4
+ "Invalid signature.","Invalid signature."
5
+ "Nothing to do.","Nothing to do."
6
+ OK,OK
7
+ "The subscription has been saved.","The subscription has been saved."
8
+ BudgetMailer,BudgetMailer
9
+ Contacts,Contacts
10
+ "This contact no longer exists.","This contact no longer exists."
11
+ "Add contact","Add contact"
12
+ "There was a problem saving the contact.","There was a problem saving the contact."
13
+ "Unable to find contact to save.","Unable to find contact to save."
14
+ "Contact was successfully deleted.","Contact was successfully deleted."
15
+ "There was an error deleting contact.","There was an error deleting contact."
16
+ "Could not find contact to delete.","Could not find contact to delete."
17
+ "Please select contacts to delete.","Please select contacts to delete."
18
+ "There was an unexpected error deleting the contact(s).","There was an unexpected error deleting the contact(s)."
19
+ "Please select contacts to unsubscribe.","Please select contacts to unsubscribe."
20
+ "There was an unexpected error unsubscribing the contact(s).","There was an unexpected error unsubscribing the contact(s)."
21
+ "Please select contacts to unsubscribe and delete.","Please select contacts to unsubscribe and delete."
22
+ "There was an unexpected error unsubscribing and deleting the contact(s).","There was an unexpected error unsubscribing and deleting the contact(s)."
23
+ "Deleting of orphan contacts failed.","Deleting of orphan contacts failed."
24
+ "Customers export failed.","Customers export failed."
25
+ "Newsletter export failed.","Newsletter export failed."
26
+ "Unregistered customers export failed.","Unregistered customers export failed."
27
+ "BudgetMailer contacts import failed.","BudgetMailer contacts import failed."
28
+ "Please select some item(s).","Please select some item(s)."
29
+ "Newsletter Subscription","Newsletter Subscription"
30
+ "The subscription has been removed.","The subscription has been removed."
31
+ "Save List","Save List"
32
+ "Delete List","Delete List"
33
+ "Save And Continue Edit","Save And Continue Edit"
34
+ "Add List","Add List"
35
+ List,List
36
+ "Budgetmailer ID","Budgetmailer ID"
37
+ Name,Name
38
+ Status,Status
39
+ Enabled,Enabled
40
+ Disabled,Disabled
41
+ Id,Id
42
+ "Created at","Created at"
43
+ "Updated at","Updated at"
44
+ Action,Action
45
+ Edit,Edit
46
+ Delete,Delete
47
+ "Are you sure?","Are you sure?"
48
+ "Change status","Change status"
49
  "Save Contact","Save Contact"
50
  "Delete Contact","Delete Contact"
51
  "Add Contact","Add Contact"
52
+ Contact,Contact
53
+ Subscribe,Subscribe
54
+ "Delete from BudgetMailer","Delete from BudgetMailer"
55
+ "Unsubscribe from BudgetMailer","Unsubscribe from BudgetMailer"
56
+ "Delete and Unsubscribe from BudgetMailer","Delete and Unsubscribe from BudgetMailer"
57
+ "BudgetMailer Newsletter","BudgetMailer Newsletter"
58
  "Delete Orphans","Delete Orphans"
59
  "Export Magento Customers","Export Magento Customers"
60
  "Export Magento Newsletter Subscribers","Export Magento Newsletter Subscribers"
61
+ "Export unregistered Customers","Export unregistered Customers"
62
  "Import BudgetMailer Contacts","Import BudgetMailer Contacts"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  "Couldn't delete contact from BudgetMailer API.","Couldn't delete contact from BudgetMailer API."
64
  "Couldn't delete tag from contact from BudgetMailer API.","Couldn't delete tag from contact from BudgetMailer API."
65
  "Couldn't get the contact from BudgetMailer API.","Couldn't get the contact from BudgetMailer API."
67
  "Couldn't get the lists from BudgetMailer API.","Couldn't get the lists from BudgetMailer API."
68
  "Couldn't get tags from BudgetMailer API.","Couldn't get tags from BudgetMailer API."
69
  "Couldn't subscribe contact to BudgetMailer API.","Couldn't subscribe contact to BudgetMailer API."
70
+ "Invalid bulk method.","Invalid bulk method."
71
+ "Couldn't bulk process contacts in BudgetMailer API.","Couldn't bulk process contacts in BudgetMailer API."
72
  "Couldn't post tags to BudgetMailer API.","Couldn't post tags to BudgetMailer API."
73
  "Couldn't update contact in BudgetMailer API.","Couldn't update contact in BudgetMailer API."
74
+ "Invalid API endpoint, key and secret combination.","Invalid API endpoint, key and secret combination."
75
  "Billing Address","Billing Address"
76
  "Shipping Address","Shipping Address"
 
77
  "Do nothing","Do nothing"
78
+ "Use new primary address","Use new primary address"
79
+ "Display checked checkbox","Display checked checkbox"
80
+ "Display unchecked checkbox","Display unchecked checkbox"
81
+ "Don't display checkbox, sign-up automatically","Don't display checkbox, sign-up automatically"
82
  "Select List","Select List"
83
  "Update Contact","Update Contact"
84
+ Remove,Remove
85
+ "Add Tag","Add Tag"
86
+ "No Tags","No Tags"
87
+ "BudgetMailer list is not set.","BudgetMailer list is not set."
88
+ "Sign Up for Newsletter","Sign Up for Newsletter"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  "Newsletter Subscription","Newsletter Subscription"
 
 
 
 
 
 
 
 
90
  "Subscribed to newsletter?","Subscribed to newsletter?"
91
+ Back,Back
92
+ Save,Save
93
+ Newsletter,Newsletter
 
94
  "Sign Up for Our Newsletter:","Sign Up for Our Newsletter:"
95
  "Sign up for our newsletter","Sign up for our newsletter"
96
+ Subscribe,Subscribe
97
+ "Email","Email"
98
+ "First Name","First Name"
99
+ "Insertion","Middle Name"
100
+ "Last Name","Last Name"
101
+ "Sex","Sex"
102
+ "Male","Male",
103
+ "Female","Female"
104
+ "Address","Address"
105
+ "Postal Code","Postal Code"
106
+ "City","City"
107
+ "Telephone","Telephone"
108
+ "Mobile","Mobile"
109
+ "Remarks","Notes"
110
+ "Tags","Tags"
111
+ "Company","Company"
112
  "Company Name","Company Name"
113
  "Country Code","Country Code"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/locale/nl_NL/Professio_BudgetMailer.csv CHANGED
@@ -1,39 +1,65 @@
1
- "Contact","Contact"
2
- "Subscribe","Aanmelden"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  "Save Contact","Contact opslaan"
4
  "Delete Contact","Verwijder contact"
5
  "Add Contact","Contact toevoegen"
6
- "Delete","Verwijderen"
7
- "Are you sure?","Weet je het zeker?"
8
- "Change Unsubscribed","Wijzig afgemeld"
9
- "Unsubscribed","Afgemeld"
10
- "Yes","Ja"
11
- "No","Nee"
12
  "Delete Orphans","Verwijder wezen"
13
  "Export Magento Customers","Exporteer Magento klanten"
14
  "Export Magento Newsletter Subscribers","Exporteer Magento nieuwsbrief aanmeldingen"
 
15
  "Import BudgetMailer Contacts","Importeer BudgetMailer contacten"
16
- "BudgetMailer Newsletter","BudgetMailer Nieuwsbrief"
17
- "List","Lijst"
18
- "Budgetmailer ID","BudgetMailer ID"
19
- "Name","Naam"
20
- "Status","Status"
21
- "Enabled","Ingeschakeld"
22
- "Disabled","Uitgeschakeld"
23
- "Save List","Lijst opslaan"
24
- "Delete List","Verwijdern lijst"
25
- "Save and Continue Edit","Opslaan en verder bewerken"
26
- "Add List","Lijst toevoegen"
27
- "Id","Id"
28
- "Created at","Aangemaakt op"
29
- "Updated at","Gewijzigd op"
30
- "Action","Actie"
31
- "Edit","Bewerk"
32
- "Change status","Wijzig status"
33
- "Remove","Verwijder"
34
- "Add Tag","Tag toevoegen"
35
- "No Tags","Geen tags"
36
- "BudgetMailer list is not set.","BudgetMailer lijst niet aangegeven."
37
  "Couldn't delete contact from BudgetMailer API.","Kan contact niet verwijderen met BudgetMailer API."
38
  "Couldn't delete tag from contact from BudgetMailer API.","Kan tag van contact niet verwijderen met BudgetMailer API."
39
  "Couldn't get the contact from BudgetMailer API.","Kan contact niet ophalen met BudgetMailer API."
@@ -41,90 +67,45 @@
41
  "Couldn't get the lists from BudgetMailer API.","Kan lijsten niet ophalen met BudgetMailer API."
42
  "Couldn't get tags from BudgetMailer API.","Kan tags niet ophalen met BudgetMailer API."
43
  "Couldn't subscribe contact to BudgetMailer API.","Kan contact niet aanmelden met BudgetMailer API."
44
- "Couldn't bulk subscribe contacts to BudgetMailer API.","Kan contacten niet bulk aanmelden met BudgetMailer API."
 
45
  "Couldn't post tags to BudgetMailer API.","Kan tags niet posten met BudgetMailer API."
46
  "Couldn't update contact in BudgetMailer API.","Kan contact niet wijzigen met BudgetMailer API."
47
- "Billing Address","Factuuradres"
48
- "Shipping Address","Verzendadres"
49
- "Use new primary address","Nieuw primair adres gebruiken"
50
  "Do nothing","Niks doen"
 
 
 
 
51
  "Select List","Selecteer lijst"
52
  "Update Contact","Contact bijwerken"
53
- "Subscribe to a BudgetMailer List","Aanmelden bij een BudgetMailer lijst"
54
- "Unsubscribe from a BudgetMailer List","Afmelden van een BudgetMailer lijst"
55
- "Invalid API endpoint, sleutel en geheime combinatie.","Ongeldige API endpoint, sleutel en geheime combinatie."
56
- "API endpoint, sleutel en geheime combinatie is geldig.","API endpoint, sleutel en geheime combinatie is geldig."
57
- "Contacts","Contacten"
58
- "This contact no longer exists.","Dit contact bestaat niet meer."
59
- "There was a problem saving the contact.","Er was een probleem bij het opslaan van dit contact."
60
- "Unable to find contact to save.","Kan contact niet vinden om op te slaan."
61
- "Contact was successfully deleted.","Contact succesvol verwijderd."
62
- "There was an error deleting contact.","Er ging iets fout bij het verwijderen van het contact."
63
- "Could not find contact to delete.","Kan contact niet vinden om te verwijderen."
64
- "Please select contacts to delete.","Selecteer contacten om te verwijderen."
65
- "There was an error deleting contacts.","Er ging iets fout bij het verwijderen van de contacten."
66
- "Please select contacts.","Selecteer contacten."
67
- "There was an error updating contacts.","Er ging iets fout bij het wijzigen van de contacten."
68
- "Deleting of orphan contacts failed.","Verwijderen van wezen contacten mislukt."
69
- "Customers import failed.","Importeren klanten mislukt."
70
- "Newsletter subscribers import failed.","Importeren nieuwsbrief aanmeldingen mislukt."
71
- "BudgetMailer contacts import failed.","importeren BudgetMailer contacten mislukt."
72
- "Please select some item(s).","Selecteer item(s)."
73
- "Newsletter Subscription","Nieuwsbrief aanmelding"
74
- "The subscription has been saved.","De aanmelding is opgeslagen."
75
- "The subscription has been removed.","De aanmelding is verwijderd."
76
- "Unexpected error:","Onverwachte fout:"
77
- "This URL works only with HTTPS.","Deze URL werkt alleen met HTTPS."
78
- "Webhook disabled.","Webhook uitgeschakeld."
79
- "Invalid signature.","Ongeldige handtekening."
80
- "Nothing to do.","Niks te doen."
81
- "OK","OK"
82
- "Subscribed to newsletter?","Aanmelden voor nieuwsbrief?"
83
- "Back","Terug"
84
- "Save","Opslaan"
85
  "Sign Up for Newsletter","Meld je aan voor nieuwsbrief"
86
- "Newsletter","Nieuwsbrief"
 
 
 
87
  "Sign Up for Our Newsletter:","Meld je aan voor onze nieuwsbrief:"
88
  "Sign up for our newsletter","Meld je aan voor onze nieuwsbrief"
89
- "Subscribe","Aanmelden"
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  "Company","Bedrijfsnaam"
91
  "Company Name","Bedrijfsnaam"
92
  "Country Code","Landcode"
93
- "API Endpoint","API Endpoint"
94
- "API Key","API-sleutel"
95
- "API Secret","Geheime sleutel"
96
- "BudgetMailer API Endpoint. Please don't change the URL unless you are instructed to.","BudgetMailer API Endpoint. Wijzig deze URL niet tenzij je dit door BudgetMailer aangegeven wordt."
97
- "Insert your BudgetMailer API Key.","Voeg hier je BudgetMailer API-sleutel toe."
98
- "Insert your BudgetMailer API Secret.","Voeg hier je BudgetMailer geheime sleutel toe."
99
- "Please select the BudgetMailer List you want to use with Magento.","Selecteer hier de BudgetMailer lijst die je met Magento wilt gebruiken."
100
- "Use Cron Job","Gebruik cron job"
101
- "In this mode, data will be synchronized periodically, every day at 1 a.m.","Bij het gebruiken van de cron job wordt de data elke nacht om 1.00 uur gesynchroniseerd."
102
- "Use webhook","Gebruik webhook"
103
- "In this mode, BudgetMailer Contacts will be synchronized by webhook in a real time. However this requires having SSL certificate installed, and Magento configured to use HTTPS protocol.","Bij het gebruiken van de webhook worden wijzigingen in je BudgetMailer contacten real time bijgewerkt. Het is hiervoor wel verplicht om Magento in combinatie met HTTPS te gebruiken."
104
- "Local data TTL","Locale data TTL"
105
- "Time to live of local contacts data, for both modes. Please do not change this value, unless you are understand how this works.","Time to live voor lokale contact data. Wijzig deze waarde niet tenzij je weet hoe het werkt."
106
- "Enable front-end output","Front-end output inschakelen"
107
- "If disabled, this module, won't have any front-end output.","Als dit uitgeschakeld is, dan wordt er niets in je front-end weergegeven."
108
- "Use Address","Gebruik adres"
109
- "Select address that will be synchronized.","Selecteer adres dat je met BudgetMailer wilt synchroniseren."
110
- "On Primary Address Delete","Bij verwijderen van het primaire adres"
111
- "Select address update behaviour.","Selecteer wat er moet gebeuren bij het wijzigen van het primaire adres"
112
- "On Primary Address Update","Bij wijzigen van het primaire adres"
113
- "On Customer Delete","Bij verwijderen van klant"
114
- "Select address update behaviour.","Selecteer wat er moet gebeuren bij het verwijderen van een klant."
115
- "On Customer Update","Bij wijzigen van klant"
116
- "Select customer update behaviour.","Selecteer wat er moet gebeuren bij het wijzigen van een klant."
117
- "Tag Customers after Order","Klanten na bestelling taggen"
118
- "If enabled, contact will be tagged by category names of ordered products.","Als dit ingeschakeld is, dan wroden klanten getagd met de categorienamen van de gekochte producten."
119
- "Newsletter Subscription","Nieuwsbrief aanmeldingen"
120
- "Customers export finished (completed: %d, fail: %d, success: %d).","Exporteren klanten voltooid (voltooid: %d, mislukt: %d, gelukt: %d)."
121
- "Newsletter Subscribers export finished (completed: %d, fail: %d, success: %d).","Exporteren nieuwsbrief-aanmeldinge voltooid (voltooid: %d, mislukt: %d, gelukt: %d)."
122
- "BudgetMailer contacts import finished (completed: %d, failed: %d).","Importeren BudgetMailer-contacten voltooid (voltooid: %d, mislukt: %d)."
123
- "Delete orphan contacts finished (completed: %d, deleted: %d, skipped: %d).","Verwijderen wezen voltooid (voltooid: %d, verwijderd: %d, overgeslagen: %d)"
124
- "Yes","Ja"
125
- "No","Nee"
126
- "Billing Address","Facturatieadres"
127
- "Shipping Address","Verzendingsadres"
128
- "Use new primary address","Nieuw hoofdadres gebruiken"
129
- "Update Contact","Contact bijwerken"
130
- "Do nothing","Niks doen"
1
+ "Unexpected error:","Onverwachte fout:"
2
+ "This URL works only with HTTPS.","Deze URL werkt alleen met HTTPS."
3
+ "Webhook disabled.","Webhook uitgeschakeld."
4
+ "Invalid signature.","Ongeldige handtekening."
5
+ "Nothing to do.","Niks te doen."
6
+ OK,OK
7
+ "The subscription has been saved.","De aanmelding is opgeslagen."
8
+ BudgetMailer,BudgetMailer
9
+ Contacts,Contacten
10
+ "This contact no longer exists.","Dit contact bestaat niet meer."
11
+ "Add contact","Contact toevoegen"
12
+ "There was a problem saving the contact.","Er was een probleem bij het opslaan van dit contact."
13
+ "Unable to find contact to save.","Kan contact niet vinden om op te slaan."
14
+ "Contact was successfully deleted.","Contact succesvol verwijderd."
15
+ "There was an error deleting contact.","Er ging iets fout bij het verwijderen van het contact."
16
+ "Could not find contact to delete.","Kan contact niet vinden om te verwijderen."
17
+ "Please select contacts to delete.","Selecteer contacten om te verwijderen."
18
+ "There was an unexpected error deleting the contact(s).","Contact(en) verwijderen mislukt. Er is iets onverwachts fout gegaan."
19
+ "Please select contacts to unsubscribe.","Selecteer contact(en) om af te melden."
20
+ "There was an unexpected error unsubscribing the contact(s).","Contact(en) afmelden en verwijderen mislukt. Er is iets onverwachts fout gegaan."
21
+ "Please select contacts to unsubscribe and delete.","Selecteer contact(en) om af te melden en te verwijderen."
22
+ "There was an unexpected error unsubscribing and deleting the contact(s).","Contact(en) afmelden en verwijderen mislukt. Er is iets onverwachts fout gegaan."
23
+ "Deleting of orphan contacts failed.","Verwijderen van wezen contacten mislukt."
24
+ "Customers export failed.","Exporteren contacten mislukt."
25
+ "Newsletter export failed.","Exporteren nieuwsbrief aanmeldingen mislukt."
26
+ "Unregistered customers export failed.","Exporteren ongeregistreerde klanten mislukt."
27
+ "BudgetMailer contacts import failed.","importeren BudgetMailer contacten mislukt."
28
+ "Please select some item(s).","Selecteer item(s)."
29
+ "Newsletter Subscription","Nieuwsbrief aanmeldingen"
30
+ "The subscription has been removed.","De aanmelding is verwijderd."
31
+ "Save List","Lijst opslaan"
32
+ "Delete List","Verwijdern lijst"
33
+ "Save And Continue Edit","Opslaan en verder bewerken"
34
+ "Add List","Lijst toevoegen"
35
+ List,Lijst
36
+ "Budgetmailer ID","BudgetMailer ID"
37
+ Name,Naam
38
+ Status,Status
39
+ Enabled,Ingeschakeld
40
+ Disabled,Uitgeschakeld
41
+ Id,Id
42
+ "Created at","Aangemaakt op"
43
+ "Updated at","Gewijzigd op"
44
+ Action,Actie
45
+ Edit,Bewerk
46
+ Delete,Verwijderen
47
+ "Are you sure?","Weet je het zeker?"
48
+ "Change status","Wijzig status"
49
  "Save Contact","Contact opslaan"
50
  "Delete Contact","Verwijder contact"
51
  "Add Contact","Contact toevoegen"
52
+ Contact,Contact
53
+ Subscribe,Aanmelden
54
+ "Delete from BudgetMailer","Verwijderen in BudgetMailer"
55
+ "Unsubscribe from BudgetMailer","Afmelden in BudgetMailer"
56
+ "Delete and Unsubscribe from BudgetMailer","Afmelden en verwijderen in BudgetMailer"
57
+ "BudgetMailer Newsletter","BudgetMailer Nieuwsbrief"
58
  "Delete Orphans","Verwijder wezen"
59
  "Export Magento Customers","Exporteer Magento klanten"
60
  "Export Magento Newsletter Subscribers","Exporteer Magento nieuwsbrief aanmeldingen"
61
+ "Export unregistered Customers","Exporteer ongeregistreerde klanten"
62
  "Import BudgetMailer Contacts","Importeer BudgetMailer contacten"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  "Couldn't delete contact from BudgetMailer API.","Kan contact niet verwijderen met BudgetMailer API."
64
  "Couldn't delete tag from contact from BudgetMailer API.","Kan tag van contact niet verwijderen met BudgetMailer API."
65
  "Couldn't get the contact from BudgetMailer API.","Kan contact niet ophalen met BudgetMailer API."
67
  "Couldn't get the lists from BudgetMailer API.","Kan lijsten niet ophalen met BudgetMailer API."
68
  "Couldn't get tags from BudgetMailer API.","Kan tags niet ophalen met BudgetMailer API."
69
  "Couldn't subscribe contact to BudgetMailer API.","Kan contact niet aanmelden met BudgetMailer API."
70
+ "Invalid bulk method.","Ongeldige bulk-methode."
71
+ "Couldn't bulk process contacts in BudgetMailer API.","Kan bulk verwerken contacten met de BudgetMailer API niet uitvoeren"
72
  "Couldn't post tags to BudgetMailer API.","Kan tags niet posten met BudgetMailer API."
73
  "Couldn't update contact in BudgetMailer API.","Kan contact niet wijzigen met BudgetMailer API."
74
+ "Invalid API endpoint, key and secret combination.","Ongeldige API endpoint, sleutel en geheime combinatie."
75
+ "Billing Address",Facturatieadres
76
+ "Shipping Address",Verzendingsadres
77
  "Do nothing","Niks doen"
78
+ "Use new primary address","Nieuw hoofdadres gebruiken"
79
+ "Display checked checkbox","Geef aangevinkte selectievak weer"
80
+ "Display unchecked checkbox","Geef lege selectievak weer"
81
+ "Don't display checkbox, sign-up automatically","Geef selectievak niet weer, maar meldt automatisch aan"
82
  "Select List","Selecteer lijst"
83
  "Update Contact","Contact bijwerken"
84
+ Remove,Verwijder
85
+ "Add Tag","Tag toevoegen"
86
+ "No Tags","Geen tags"
87
+ "BudgetMailer list is not set.","BudgetMailer lijst niet aangegeven."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  "Sign Up for Newsletter","Meld je aan voor nieuwsbrief"
89
+ "Subscribed to newsletter?","Aanmelden voor nieuwsbrief?"
90
+ Back,Terug
91
+ Save,Opslaan
92
+ Newsletter,Nieuwsbrief
93
  "Sign Up for Our Newsletter:","Meld je aan voor onze nieuwsbrief:"
94
  "Sign up for our newsletter","Meld je aan voor onze nieuwsbrief"
95
+ "Email","E-mailadres"
96
+ "First Name","Voornaam"
97
+ "Insertion","Tussenvoegsel"
98
+ "Last Name","Achternaam"
99
+ "Sex","Geslacht"
100
+ "Male","Man",
101
+ "Female","Vrouw"
102
+ "Address","Adres"
103
+ "Postal Code","Postcode"
104
+ "City","Plaats"
105
+ "Telephone","Telefoon"
106
+ "Mobile","Mobiel"
107
+ "Remarks","Opmerkingen"
108
+ "Tags","Tags"
109
  "Company","Bedrijfsnaam"
110
  "Company Name","Bedrijfsnaam"
111
  "Country Code","Landcode"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,22 +1,21 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Professio_BudgetMailer</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license>MIT</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Professio BudgetMailer seamlessly implements BudgetMailer API, and flawlessly replace Magento Newsletter.</summary>
10
  <description>Professio BudgetMailer seamlessly implements BudgetMailer API, and flawlessly replace Magento Newsletter.</description>
11
- <notes>Release History&#xD;
12
- &#xD;
13
  1.0.2 - PHP bug fix: using empty() in write context&#xD;
14
  1.0.1 - Repacking for Magento Connect&#xD;
15
  1.0.0 - Initial version</notes>
16
  <authors><author><name>J.S. Diertens</name><user>budgetmailer</user><email>info@budgetmailer.nl</email></author></authors>
17
- <date>2015-10-01</date>
18
- <time>22:48:26</time>
19
- <contents><target name="magecommunity"><dir name="Professio"><dir name="BudgetMailer"><dir name="Block"><dir name="Adminhtml"><dir name="Contact"><dir name="Edit"><file name="Form.php" hash="84ffb3e0633e9ff1ce93b3606b82a574"/><dir name="Tab"><file name="Form.php" hash="7d01ee2ed832e1f0d3814402181c9942"/></dir><file name="Tabs.php" hash="469cdd4b84c4733679bbf60f4bd9bbb9"/></dir><file name="Edit.php" hash="a58fbc229ac537be75f85a7e20ce39b2"/><file name="Grid.php" hash="90b904cf0f245800eb611a3e599d0436"/></dir><file name="Contact.php" hash="2627c926ff6a5c79fef8d25a6f45022f"/><dir name="Customer"><file name="Tab.php" hash="11e9f72548a61e33f5012ace80fea2d4"/></dir><dir name="Helper"><dir name="Column"><dir name="Renderer"><file name="Parent.php" hash="5da322afef5caea928d85e90c30c297b"/></dir></dir></dir><dir name="List"><dir name="Edit"><file name="Form.php" hash="fc11a9ee7bd6a3b8bf703569f93f558e"/><dir name="Tab"><file name="Form.php" hash="9391bc1eaa8dd3075317ebcb473d1938"/></dir><file name="Tabs.php" hash="05c4743d5c17319c41f387e8189e6e5c"/></dir><file name="Edit.php" hash="a601e5169eacf2bab6307c56af02727f"/><file name="Grid.php" hash="3cb50bb35c682a35b83f5315946ea898"/></dir><file name="List.php" hash="c805782c8aef4cbce2b8acfacec29119"/></dir><file name="Newsletter.php" hash="b9aec616529485c88bfc895c5ab37f4b"/><dir name="Subscribe"><file name="Mini.php" hash="e4c78ecfca926db483719d1a95daab72"/></dir><file name="Subscribe.php" hash="dd55cee6b835ca4292d3776319947485"/></dir><dir name="Controller"><dir name="Adminhtml"><file name="BudgetMailer.php" hash="419ac9d8824cdcf7b3d5040305d41d9b"/></dir></dir><file name="Exception.php" hash="8d5a5578baa52c32c86aab9552367871"/><dir name="Form"><dir name="Element"><file name="Tags.php" hash="1d8c68499bb5a249246c5a96f437f5af"/></dir></dir><dir name="Helper"><file name="Config.php" hash="8c3cb321e4a7f6a01cb549d43bbe68f6"/><file name="Data.php" hash="87b2bfe6bc81dffd8a311444ab2dd627"/><file name="Mapper.php" hash="562055033b8d1598cbcbe5fea23205b2"/></dir><dir name="Model"><file name="Client.php" hash="2235fa30a9d6e9b1cabff4feafc9d910"/><dir name="Config"><dir name="Source"><file name="Address.php" hash="506569472173eb88859a39071a2478d9"/><dir name="Delete"><file name="Address.php" hash="d5fae5c1b2e822d025a00eaeaf6b77e5"/></dir><file name="Delete.php" hash="42c9db5f3a06898dbf9226fe73263c6e"/><file name="List.php" hash="d0ef01f39fe9d92b48ff3c555e7e26d5"/><file name="Update.php" hash="ab92b99a2bce5dc5235b1135b9d00f1e"/></dir></dir><file name="Contact.php" hash="3dc08375c1fc454f06339af195032d10"/><file name="Exporter.php" hash="280c61b74a24792bf976402e66d2ae0f"/><file name="Importer.php" hash="e300c9bc223e6c5fa4f01d2791ed4e08"/><file name="List.php" hash="bd324ba673c963d81de8345242bcc822"/><file name="Observer.php" hash="8347ddce61ad89a13b9b22b694538964"/><dir name="Resource"><dir name="Contact"><file name="Collection.php" hash="33b6a3514437d48b90d6deadd6deb05c"/></dir><file name="Contact.php" hash="0f02959a67178ab33fe903a60f4e2359"/><dir name="List"><file name="Collection.php" hash="db2d92515fe39a8ad0f1ca144550fd7d"/></dir><file name="List.php" hash="12c23fa0395209c68bdf9d273464c957"/><file name="Setup.php" hash="939f3c5bf1c38b36b9de6984befe53ac"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Budgetmailer"><file name="ContactController.php" hash="a06a5e48431bcdb81af4e929fd9bfead"/></dir><file name="BudgetmailerController.php" hash="838304305f9714ef886f911929a7393e"/></dir><file name="ManageController.php" hash="e70082c900d2b7630752787ade582122"/><file name="SubscriberController.php" hash="b9ebaa98346b04d3f19f4864c8d1ec10"/><file name="WebhookController.php" hash="d7803e2cfa237b35bbf34041571fb3dd"/></dir><dir name="etc"><file name="adminhtml.xml" hash="8f88efcafef92b874f44ffc263d1d4fa"/><file name="config.xml" hash="98476208bfb77eb33e92a2237540a9c5"/><file name="system.xml" hash="f08411074d810feb04ea73cf4096010a"/></dir><dir name="sql"><dir name="budgetmailer_setup"><file name="install-1.0.0.php" hash="8854ecf4cce961c84b88f4b3c4cfb715"/></dir><file name="budgetmailer_setup_uninstall.sql" hash="ccf0931d13ee3baa903f77003c77c7c9"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="budgetmailer.xml" hash="3f8fab70b03bfc23ea2c9091b623da48"/></dir><dir name="template"><dir name="budgetmailer"><file name="newsletter.phtml" hash="4c5797708f22751e6565b6da516483a3"/><dir><dir name="subscribe"><file name="mini.phtml" hash="95d0f6924bab784c45472450745bee0e"/></dir></dir><file name="subscribe.phtml" hash="e1a47e179c4d3d69f6d46e5e03e59d97"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><file name="budgetmailer.xml" hash="5dd0fd80c51125930ae444922343c694"/></dir><dir name="template"><dir name="budgetmailer"><file name="newsletter.phtml" hash="b25b064f39666aa69eedc91ddc44c95c"/><dir><dir name="subscribe"><file name="mini.phtml" hash="ee4a6904d78db697ec84353ed62a37b0"/></dir></dir><file name="subscribe.phtml" hash="ed835b8c15de0788617e6331dd135a3d"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="budgetmailer.xml" hash="a4733989973690c7ed4c5216157bd8a6"/></dir><dir name="template"><dir name="budgetmailer"><dir><dir name="customer"><file name="tab.phtml" hash="832eb6b15600c265dd86ab3d59cb7b9f"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Professio_BudgetMailer.xml" hash="e6ef2ac221374863f4bfcbc415b950fe"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Professio_BudgetMailer.csv" hash="20e16fde841de67d814bd3a9715b5b86"/></dir><dir name="nl_NL"><file name="Professio_BudgetMailer.csv" hash="cdae79bcdafbe838d1c755667dd27da7"/></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php></required></dependencies>
22
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Professio_BudgetMailer</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license>MIT</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Professio BudgetMailer seamlessly implements BudgetMailer API, and flawlessly replace Magento Newsletter.</summary>
10
  <description>Professio BudgetMailer seamlessly implements BudgetMailer API, and flawlessly replace Magento Newsletter.</description>
11
+ <notes>1.0.3 - Various bug fixes, and simplifications&#xD;
 
12
  1.0.2 - PHP bug fix: using empty() in write context&#xD;
13
  1.0.1 - Repacking for Magento Connect&#xD;
14
  1.0.0 - Initial version</notes>
15
  <authors><author><name>J.S. Diertens</name><user>budgetmailer</user><email>info@budgetmailer.nl</email></author></authors>
16
+ <date>2016-03-15</date>
17
+ <time>15:11:38</time>
18
+ <contents><target name="magecommunity"><dir name="Professio"><dir name="BudgetMailer"><dir name="Block"><dir name="Adminhtml"><dir name="Contact"><dir name="Edit"><file name="Form.php" hash="84ffb3e0633e9ff1ce93b3606b82a574"/><dir name="Tab"><file name="Form.php" hash="53fb4454290ad4704e80f48520b933dd"/></dir><file name="Tabs.php" hash="469cdd4b84c4733679bbf60f4bd9bbb9"/></dir><file name="Edit.php" hash="a58fbc229ac537be75f85a7e20ce39b2"/><file name="Grid.php" hash="62742a6a68f47a8af89954d86ca5d44c"/></dir><file name="Contact.php" hash="c1e977bc52d59bc4e72f6b6852bb6533"/><dir name="Customer"><file name="Tab.php" hash="11e9f72548a61e33f5012ace80fea2d4"/></dir><dir name="Helper"><dir name="Column"><dir name="Renderer"><file name="Parent.php" hash="5da322afef5caea928d85e90c30c297b"/></dir></dir></dir><dir name="List"><dir name="Edit"><file name="Form.php" hash="fc11a9ee7bd6a3b8bf703569f93f558e"/><dir name="Tab"><file name="Form.php" hash="9391bc1eaa8dd3075317ebcb473d1938"/></dir><file name="Tabs.php" hash="05c4743d5c17319c41f387e8189e6e5c"/></dir><file name="Edit.php" hash="a601e5169eacf2bab6307c56af02727f"/><file name="Grid.php" hash="3cb50bb35c682a35b83f5315946ea898"/></dir><file name="List.php" hash="c805782c8aef4cbce2b8acfacec29119"/></dir><file name="CheckoutAgreements.php" hash="c01af3dc12c5e724e400863bc13c3472"/><file name="Newsletter.php" hash="b9aec616529485c88bfc895c5ab37f4b"/><dir name="Subscribe"><file name="Mini.php" hash="a883b0136a6eb909732adeed87593bd9"/></dir><file name="Subscribe.php" hash="dd55cee6b835ca4292d3776319947485"/></dir><dir name="Controller"><dir name="Adminhtml"><file name="BudgetMailer.php" hash="419ac9d8824cdcf7b3d5040305d41d9b"/></dir></dir><file name="Exception.php" hash="8d5a5578baa52c32c86aab9552367871"/><dir name="Form"><dir name="Element"><file name="Tags.php" hash="1d8c68499bb5a249246c5a96f437f5af"/></dir></dir><dir name="Helper"><file name="Config.php" hash="6db7732d471e9e16cb5ed89a8c06538d"/><file name="Data.php" hash="87b2bfe6bc81dffd8a311444ab2dd627"/><file name="Mapper.php" hash="61bfe1f75edb4e1551bb50a0397d20de"/></dir><dir name="Model"><file name="Client.php" hash="882320e4eb86b75d3fb66ce699552284"/><dir name="Config"><dir name="Source"><file name="Account.php" hash="33d43e4467d8db04b2e15d617236ed85"/><file name="Address.php" hash="4c3210e958e4fdec0cdb7957a60ddffc"/><dir name="Delete"><file name="Address.php" hash="d5fae5c1b2e822d025a00eaeaf6b77e5"/></dir><file name="Delete.php" hash="42c9db5f3a06898dbf9226fe73263c6e"/><file name="List.php" hash="d0ef01f39fe9d92b48ff3c555e7e26d5"/><file name="Update.php" hash="ab92b99a2bce5dc5235b1135b9d00f1e"/></dir></dir><file name="Contact.php" hash="eb69cd4fff7100f1922f42866624b206"/><file name="Exporter.php" hash="e18fae5d19583d267c9dac387d4d7124"/><file name="Importer.php" hash="690e8072c5238f9e555baad995ce4c8f"/><file name="List.php" hash="bd324ba673c963d81de8345242bcc822"/><file name="Observer.php" hash="f07a7d4bebc286ddcdad34aa97e5b631"/><dir name="Resource"><dir name="Contact"><file name="Collection.php" hash="33b6a3514437d48b90d6deadd6deb05c"/></dir><file name="Contact.php" hash="0f02959a67178ab33fe903a60f4e2359"/><dir name="List"><file name="Collection.php" hash="db2d92515fe39a8ad0f1ca144550fd7d"/></dir><file name="List.php" hash="12c23fa0395209c68bdf9d273464c957"/><file name="Setup.php" hash="939f3c5bf1c38b36b9de6984befe53ac"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Budgetmailer"><file name="ContactController.php" hash="3de80dceeff43b3b00adb24a95a2b218"/></dir><file name="BudgetmailerController.php" hash="5ee8a0bf600a256e0d244d3e6edae912"/></dir><file name="ManageController.php" hash="e70082c900d2b7630752787ade582122"/><file name="SubscriberController.php" hash="b9ebaa98346b04d3f19f4864c8d1ec10"/><file name="WebhookController.php" hash="d7803e2cfa237b35bbf34041571fb3dd"/></dir><dir name="etc"><file name="adminhtml.xml" hash="8f88efcafef92b874f44ffc263d1d4fa"/><file name="config.xml" hash="31625b7aff671052d175bdb9fe701916"/><file name="system.xml" hash="231439eb412d6219fb76e6e07443c5f2"/></dir><dir name="sql"><dir name="budgetmailer_setup"><file name="install-1.0.0.php" hash="8854ecf4cce961c84b88f4b3c4cfb715"/></dir><file name="budgetmailer_setup_uninstall.sql" hash="ccf0931d13ee3baa903f77003c77c7c9"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="budgetmailer.xml" hash="3f8fab70b03bfc23ea2c9091b623da48"/></dir><dir name="template"><dir name="budgetmailer"><file name="newsletter.phtml" hash="4c5797708f22751e6565b6da516483a3"/><file name="onepage-agreements.phtml" hash="7d7b2809008c2d832154c291d0c80610"/><dir name="subscribe"><file name="mini.phtml" hash="dd613818725d6d11f59dc6da6bb4821c"/></dir><file name="subscribe.phtml" hash="e1a47e179c4d3d69f6d46e5e03e59d97"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><file name="budgetmailer.xml" hash="5dd0fd80c51125930ae444922343c694"/></dir><dir name="template"><dir name="budgetmailer"><file name="newsletter.phtml" hash="b25b064f39666aa69eedc91ddc44c95c"/><file name="onepage-agreements.phtml" hash="7d7b2809008c2d832154c291d0c80610"/><dir name="subscribe"><file name="mini.phtml" hash="e3c8fb8758849322af50f790fa2aca2a"/></dir><file name="subscribe.phtml" hash="ed835b8c15de0788617e6331dd135a3d"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="budgetmailer.xml" hash="a4733989973690c7ed4c5216157bd8a6"/></dir><dir name="template"><dir name="budgetmailer"><dir name="customer"><file name="tab.phtml" hash="832eb6b15600c265dd86ab3d59cb7b9f"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Professio_BudgetMailer.xml" hash="e6ef2ac221374863f4bfcbc415b950fe"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Professio_BudgetMailer.csv" hash="fa141b68821fc7a5796c85b7ce7c40d8"/></dir><dir name="nl_NL"><file name="Professio_BudgetMailer.csv" hash="ee64f8c122ab34b7c4f2dcc920a44f09"/></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php></required></dependencies>
21
  </package>