Campaigner_Integration - Version 1.0.2

Version Notes

Tailor the subscription management experience: Provide your Magento customers with specific subscription management options by selecting which Campaigner mailing lists they can sign up for or opt out of when they visit the newsletter subscription area in their Magento account. Please note that regardless of which lists you choose to expose, your main list will always appear in the newsletter subscription area.

Track abandon behavior by contact or across all contacts: Share abandoned cart sequences across all contacts to capture a broad sample of abandons for a special promotion you plan to send to a subset of contacts, or track the sequence per-contact to trigger personalized, automated follow-up messages in Campaigner.

Permissions updated to allow access to admin pages for specific roles.

Improved custom field support.

Added additional uninstall instructions.

Download this release

Release Info

Developer Magento Core Team
Extension Campaigner_Integration
Version 1.0.2
Comparing to
See all releases


Code changes from version 1.0.1 to 1.0.2

Files changed (41) hide show
  1. app/code/community/Campaigner/Integration/Block/Adminhtml/Troubleshooting/View/Tab/Help.php +95 -0
  2. app/code/community/Campaigner/Integration/Block/Customer/Account/Lists.php +0 -21
  3. app/code/community/Campaigner/Integration/Helper/Abandoned.php +33 -4
  4. app/code/community/Campaigner/Integration/Helper/Data.php +103 -26
  5. app/code/community/Campaigner/Integration/Helper/Fields.php +5 -2
  6. app/code/community/Campaigner/Integration/Helper/Order.php +1 -1
  7. app/code/community/Campaigner/Integration/Model/Abandoned/Observer.php +41 -3
  8. app/code/community/Campaigner/Integration/Model/Configuration/Observer.php +5 -5
  9. app/code/community/Campaigner/Integration/Model/Customer/Observer.php +90 -7
  10. app/code/community/Campaigner/Integration/Model/Mysql4/Abandoned/Collection.php +4 -2
  11. app/code/community/Campaigner/Integration/Model/Mysql4/Session.php +13 -0
  12. app/code/community/Campaigner/Integration/Model/Session.php +30 -13
  13. app/code/community/Campaigner/Integration/Model/System/Config/Source/Sequence.php +1 -1
  14. app/code/community/Campaigner/Integration/Model/System/Config/Source/Sequence/Scope.php +13 -0
  15. app/code/community/Campaigner/Integration/Model/Wrapper/Subscribers.php +40 -19
  16. app/code/community/Campaigner/Integration/controllers/AbandonedController.php +29 -38
  17. app/code/community/Campaigner/Integration/controllers/Admin/AbandonedController.php +5 -0
  18. app/code/community/Campaigner/Integration/controllers/Admin/DiagnosticController.php +7 -2
  19. app/code/community/Campaigner/Integration/controllers/Admin/LatestController.php +5 -0
  20. app/code/community/Campaigner/Integration/controllers/Admin/TroubleshootingController.php +5 -0
  21. app/code/community/Campaigner/Integration/controllers/Customer/AccountController.php +5 -9
  22. app/code/community/Campaigner/Integration/etc/adminhtml.xml +20 -0
  23. app/code/community/Campaigner/Integration/etc/config.xml +2 -2
  24. app/code/community/Campaigner/Integration/etc/system.xml +23 -0
  25. app/code/community/Campaigner/Integration/sql/campaigner_setup/mysql4-upgrade-1.0.1-1.0.2.php +20 -0
  26. app/design/adminhtml/default/default/template/campaigner/abandoned/details.phtml +1 -1
  27. app/design/adminhtml/default/default/template/campaigner/abandoned/details/tab/cart.phtml +9 -9
  28. app/design/adminhtml/default/default/template/campaigner/abandoned/details/tab/diagnostics/status.phtml +38 -43
  29. app/design/adminhtml/default/default/template/campaigner/abandoned/status.phtml +13 -13
  30. app/design/adminhtml/default/default/template/campaigner/latest/status.phtml +13 -13
  31. app/design/adminhtml/default/default/template/campaigner/order/view/tab/diagnostics/status.phtml +0 -78
  32. app/design/adminhtml/default/default/template/campaigner/system/config/fieldset/hint.phtml +15 -4
  33. app/design/adminhtml/default/default/template/campaigner/troubleshooting/view/tab/help.phtml +54 -0
  34. app/design/frontend/base/default/layout/campaigner.xml +4 -1
  35. app/design/frontend/base/default/template/campaigner/customer/account/dashboard/info.phtml +16 -9
  36. app/design/frontend/base/default/template/campaigner/customer/account/lists.phtml +3 -7
  37. app/design/frontend/base/default/template/campaigner/customer/account/unsubscribed.phtml +8 -0
  38. app/design/frontend/base/default/template/campaigner/signup/form.phtml +25 -25
  39. app/locale/en_US/Campaigner_Integration.csv +37 -0
  40. package.xml +13 -5
  41. skin/adminhtml/default/default/campaigner/campaigner.css +6 -1
app/code/community/Campaigner/Integration/Block/Adminhtml/Troubleshooting/View/Tab/Help.php CHANGED
@@ -70,4 +70,99 @@ class Campaigner_Integration_Block_Adminhtml_Troubleshooting_View_Tab_Help
70
 
71
  return $this->getFields($shipping_fields);
72
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
70
 
71
  return $this->getFields($shipping_fields);
72
  }
73
+
74
+ public function getTableName($code)
75
+ {
76
+ return Mage::getSingleton('core/resource')->getTableName($code);
77
+ }
78
+
79
+ public function getUninstallTables()
80
+ {
81
+ $table_entities = array(
82
+ 'abandoned',
83
+ 'latest_order',
84
+ 'session'
85
+ );
86
+
87
+ $tables = array();
88
+
89
+ foreach ($table_entities as $table) {
90
+ $tables[] = $this->getTableName("campaigner/{$table}");
91
+ }
92
+
93
+ return $tables;
94
+ }
95
+
96
+ public function getUninstallFiles()
97
+ {
98
+ $files = array(
99
+ array(
100
+ 'type' => 'file',
101
+ 'base' => 'etc',
102
+ 'location' => 'modules/Campaigner_Integration.xml'
103
+ ),
104
+ array(
105
+ 'type' => 'folder',
106
+ 'base' => 'code',
107
+ 'location' => 'Community/Campaigner'
108
+ ),
109
+ array(
110
+ 'type' => 'folder',
111
+ 'base' => 'skin',
112
+ 'location' => 'adminhtml/default/default/campaigner'
113
+ ),
114
+ array(
115
+ 'type' => 'folder',
116
+ 'base' => 'skin',
117
+ 'location' => 'frontend/base/default/campaigner'
118
+ ),
119
+ array(
120
+ 'type' => 'file',
121
+ 'base' => 'design',
122
+ 'location' => 'adminhtml/default/default/layout/campaigner.xml'
123
+ ),
124
+ array(
125
+ 'type' => 'folder',
126
+ 'base' => 'design',
127
+ 'location' => 'adminhtml/default/default/template/campaigner'
128
+ ),
129
+ array(
130
+ 'type' => 'file',
131
+ 'base' => 'design',
132
+ 'location' => 'frontend/base/default/layout/campaigner.xml'
133
+ ),
134
+ array(
135
+ 'type' => 'folder',
136
+ 'base' => 'design',
137
+ 'location' => 'frontend/base/default/template/campaigner'
138
+ ),
139
+ array(
140
+ 'type' => 'file',
141
+ 'base' => 'locale',
142
+ 'location' => 'en_US/template/email/newsletter_subscr_success_campaigner.html'
143
+ ),
144
+ array(
145
+ 'type' => 'file',
146
+ 'base' => 'locale',
147
+ 'location' => 'en_US/template/email/newsletter_unsub_success_campaigner.html'
148
+ ),
149
+ array(
150
+ 'type' => 'file',
151
+ 'base' => 'locale',
152
+ 'location' => 'en_US/template/email/campaigner_relay_test.html'
153
+ ),
154
+ array(
155
+ 'type' => 'file',
156
+ 'base' => 'locale',
157
+ 'location' => 'en_US/Campaigner_Integration.csv'
158
+ ),
159
+ array(
160
+ 'type' => 'file',
161
+ 'base' => 'log',
162
+ 'location' => 'campaigner.log'
163
+ ),
164
+ );
165
+
166
+ return $files;
167
+ }
168
  }
app/code/community/Campaigner/Integration/Block/Customer/Account/Lists.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
-
3
- class Campaigner_Integration_Block_Customer_Account_Lists extends Mage_Core_Block_Template
4
- {
5
- protected $_form;
6
-
7
- public function getSubscriptions()
8
- {
9
- return Mage::helper('campaigner')->getSubscriptions($this->_getEmail());
10
- }
11
-
12
- /**
13
- * Retrieve email from Customer object in session
14
- *
15
- * @return string Email address
16
- */
17
- protected function _getEmail()
18
- {
19
- return $this->helper('customer')->getCustomer()->getEmail();
20
- }
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Campaigner/Integration/Helper/Abandoned.php CHANGED
@@ -6,6 +6,7 @@ class Campaigner_Integration_Helper_Abandoned extends Campaigner_Integration_Hel
6
  private $_current_sequence = 0;
7
  private $_sequence_enabled = false;
8
  private $_sequence_field = "";
 
9
 
10
  public function getAbandonedUrl($quote)
11
  {
@@ -124,17 +125,43 @@ class Campaigner_Integration_Helper_Abandoned extends Campaigner_Integration_Hel
124
  return $order;
125
  }
126
 
127
- public function addSequence(&$merge_vars)
128
  {
129
  if (!$this->_sequence_enabled) {
130
  return;
131
  }
 
132
 
133
- if (!isset($this->_sequences[$this->_current_sequence])) {
134
- $this->_current_sequence = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  }
136
 
137
- $merge_vars[$this->_sequence_field] = $this->_sequences[$this->_current_sequence++];
 
 
 
 
 
138
  }
139
 
140
  public function setupSequence()
@@ -145,6 +172,8 @@ class Campaigner_Integration_Helper_Abandoned extends Campaigner_Integration_Hel
145
  return;
146
  }
147
 
 
 
148
  $sequences = str_replace("\r\n","\n",$this->config('abandonedsequence_options'));
149
  $this->_current_sequence = $this->config('abandonedsequence_current');
150
 
6
  private $_current_sequence = 0;
7
  private $_sequence_enabled = false;
8
  private $_sequence_field = "";
9
+ private $_sequence_scope = 'all';
10
 
11
  public function getAbandonedUrl($quote)
12
  {
125
  return $order;
126
  }
127
 
128
+ public function addSequence(&$merge_vars, &$quote)
129
  {
130
  if (!$this->_sequence_enabled) {
131
  return;
132
  }
133
+ $sequence_value = "";
134
 
135
+ if ($this->_sequence_scope == 'all') {
136
+ if (!isset($this->_sequences[$this->_current_sequence])) {
137
+ $this->_current_sequence = 0;
138
+ }
139
+
140
+ $sequence_value = $this->_sequences[$this->_current_sequence++];
141
+ } else {
142
+ // Individual. Stored in session table
143
+
144
+ $sequence = $quote->getSequence();
145
+
146
+ // If we've already sent the cart, don't update the sequence
147
+ if ($quote->getDateSent()) {
148
+ return;
149
+ }
150
+ if (!isset($this->_sequences[$sequence])) {
151
+ $sequence = 0;
152
+ }
153
+
154
+ $sequence_value = $this->_sequences[$sequence++];
155
+
156
+ $quote->setSequence($sequence);
157
  }
158
 
159
+ $merge_vars[$this->_sequence_field] = $sequence_value;
160
+ }
161
+
162
+ public function getSequenceScope()
163
+ {
164
+ return $this->config('abandonedsequence_scope');
165
  }
166
 
167
  public function setupSequence()
172
  return;
173
  }
174
 
175
+ $this->_sequence_scope = $this->getSequenceScope();
176
+
177
  $sequences = str_replace("\r\n","\n",$this->config('abandonedsequence_options'));
178
  $this->_current_sequence = $this->config('abandonedsequence_current');
179
 
app/code/community/Campaigner/Integration/Helper/Data.php CHANGED
@@ -7,6 +7,7 @@ class Campaigner_Integration_Helper_Data extends Mage_Core_Helper_Abstract
7
  const DISABLED_REASON_PREFIX = "Skipping";
8
 
9
  protected $_logger = null;
 
10
 
11
  public function __construct()
12
  {
@@ -23,6 +24,11 @@ class Campaigner_Integration_Helper_Data extends Mage_Core_Helper_Abstract
23
  $this->_logger->log($data);
24
  }
25
 
 
 
 
 
 
26
  protected function debug($data)
27
  {
28
  $this->_logger->debug($data);
@@ -33,25 +39,14 @@ class Campaigner_Integration_Helper_Data extends Mage_Core_Helper_Abstract
33
  $this->_logger->debugHeader($data, $level);
34
  }
35
 
36
- public function getQuoteMergeVarsOld($quote)
37
  {
38
- // Make it more like getMergeVars where it uses the field maps!!!
39
- $merge_vars = array();
40
- $merge_vars['First Name'] = $quote->getData('customer_firstname');
41
- $merge_vars['Last Name'] = $quote->getData('customer_lastname');
42
-
43
- $billing = $quote->getBillingAddress();
44
 
45
- if ($billing) {
46
- $merge_vars['Phone'] = $billing->getTelephone();
47
- $merge_vars['Fax'] = $billing->getFax();
48
  }
49
 
50
- return $merge_vars;
51
- }
52
-
53
- public function getQuoteMergeVars($quote)
54
- {
55
  $merge_vars = array();
56
 
57
  $maps = unserialize( $this->config('map_fields', $quote->getStoreId()) );
@@ -130,22 +125,31 @@ class Campaigner_Integration_Helper_Data extends Mage_Core_Helper_Abstract
130
  {
131
  $region_id = $data->getData('region_id');
132
 
133
- if (!$region_id)
134
  continue;
 
135
 
136
  $region = Mage::getModel('directory/region')->load($region_id);
137
 
138
- if (!$region)
139
  continue;
 
140
 
141
  $state_code = $region->getCode();
142
 
143
- if ($state_code != "")
144
  $merge_vars[$campaigner_field] = $state_code;
 
145
  } break;
146
  default:
147
  {
148
- if (($value = (string)$data->getData(strtolower($custom_field))) || ($value = (string)$request->getPost(strtolower($custom_field)))) {
 
 
 
 
 
 
149
  $merge_vars[$campaigner_field] = $value;
150
  }
151
  } break;
@@ -156,6 +160,10 @@ class Campaigner_Integration_Helper_Data extends Mage_Core_Helper_Abstract
156
 
157
  protected function getProduct($item)
158
  {
 
 
 
 
159
  $product_id = $item->getProductId();
160
 
161
  if (!$product_id) {
@@ -448,7 +456,7 @@ class Campaigner_Integration_Helper_Data extends Mage_Core_Helper_Abstract
448
  return array('smtp_disable' => $disable, 'relay' => $relay);
449
  }
450
 
451
- public function getCampaignerColumnOptions()
452
  {
453
  $columns = Mage::getSingleton('campaigner/wrapper_database')->getAllColumns(true, true, false);
454
 
@@ -458,12 +466,16 @@ class Campaigner_Integration_Helper_Data extends Mage_Core_Helper_Abstract
458
  return $options;
459
  }
460
 
461
- $custom_fields = Mage::helper('campaigner/fields')->getCustomFields(true, false);
462
 
463
  $invalid_columns = array();
464
 
465
  foreach ($custom_fields as $cf) {
466
- if (strpos($cf['name'],'AbandonedSequence') === false) {
 
 
 
 
467
  $invalid_columns[] = $cf['name'];
468
  }
469
  }
@@ -998,8 +1010,16 @@ class Campaigner_Integration_Helper_Data extends Mage_Core_Helper_Abstract
998
 
999
  $lists = Mage::getSingleton('campaigner/wrapper_lists')->getLists();
1000
 
 
 
 
 
1001
  foreach ($lists as $list) {
1002
- $list_data[$list['Id']] = array('id' => $list['Id'], 'name' => $list['Name'], 'subscribed' => false);
 
 
 
 
1003
  }
1004
 
1005
  return $list_data;
@@ -1036,18 +1056,75 @@ class Campaigner_Integration_Helper_Data extends Mage_Core_Helper_Abstract
1036
  }
1037
  }
1038
 
1039
- public function getSubscriptions($email)
1040
  {
1041
- $this->_logger->setLogArea(Campaigner_Integration_Helper_Troubleshooting::CUSTOMER);
1042
- $this->_logger->setLogLevel(Campaigner_Integration_Helper_Troubleshooting::LOG_LEVEL_LOW);
1043
 
 
 
 
 
 
 
 
 
 
 
1044
  try {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1045
  $lists = $this->getLists();
1046
 
1047
  $subscriptions = $this->getSubscriberData($email, $lists);
1048
 
1049
  $this->_logger->resetLogLevel();
1050
 
 
 
1051
  return $subscriptions;
1052
  }
1053
  catch (Exception $e)
7
  const DISABLED_REASON_PREFIX = "Skipping";
8
 
9
  protected $_logger = null;
10
+ protected $_subscriptions = null;
11
 
12
  public function __construct()
13
  {
24
  $this->_logger->log($data);
25
  }
26
 
27
+ public function logException($data)
28
+ {
29
+ $this->_logger->logException($data);
30
+ }
31
+
32
  protected function debug($data)
33
  {
34
  $this->_logger->debug($data);
39
  $this->_logger->debugHeader($data, $level);
40
  }
41
 
42
+ public function getQuoteMergeVars($quote)
43
  {
44
+ $customer = $quote->getCustomer();
 
 
 
 
 
45
 
46
+ if ($customer) {
47
+ return $this->getMergeVars($customer);
 
48
  }
49
 
 
 
 
 
 
50
  $merge_vars = array();
51
 
52
  $maps = unserialize( $this->config('map_fields', $quote->getStoreId()) );
125
  {
126
  $region_id = $data->getData('region_id');
127
 
128
+ if (!$region_id) {
129
  continue;
130
+ }
131
 
132
  $region = Mage::getModel('directory/region')->load($region_id);
133
 
134
+ if (!$region) {
135
  continue;
136
+ }
137
 
138
  $state_code = $region->getCode();
139
 
140
+ if ($state_code != "") {
141
  $merge_vars[$campaigner_field] = $state_code;
142
+ }
143
  } break;
144
  default:
145
  {
146
+ $value = (string)$data->getData(strtolower($custom_field));
147
+
148
+ if ($value === null) {
149
+ $value = (string)$request->getPost(strtolower($custom_field));
150
+ }
151
+
152
+ if ($value !== null) {
153
  $merge_vars[$campaigner_field] = $value;
154
  }
155
  } break;
160
 
161
  protected function getProduct($item)
162
  {
163
+ if (get_class($item) == "Varien_Object") {
164
+ return $item->getProduct();
165
+ }
166
+
167
  $product_id = $item->getProductId();
168
 
169
  if (!$product_id) {
456
  return array('smtp_disable' => $disable, 'relay' => $relay);
457
  }
458
 
459
+ public function getCampaignerColumnOptions($sequence = false)
460
  {
461
  $columns = Mage::getSingleton('campaigner/wrapper_database')->getAllColumns(true, true, false);
462
 
466
  return $options;
467
  }
468
 
469
+ $custom_fields = Mage::helper('campaigner/fields')->getCustomFields(true, false, true);
470
 
471
  $invalid_columns = array();
472
 
473
  foreach ($custom_fields as $cf) {
474
+ if ($sequence) {
475
+ if (strpos($cf['name'],'AbandonedSequence') === false) {
476
+ $invalid_columns[] = $cf['name'];
477
+ }
478
+ } else {
479
  $invalid_columns[] = $cf['name'];
480
  }
481
  }
1010
 
1011
  $lists = Mage::getSingleton('campaigner/wrapper_lists')->getLists();
1012
 
1013
+ $visible_lists = explode(",",$this->config("visible_lists"));
1014
+
1015
+ $visible_lists[] = $this->config("list");
1016
+
1017
  foreach ($lists as $list) {
1018
+ $id = $list['Id'];
1019
+
1020
+ if (in_array($id,$visible_lists)) {
1021
+ $list_data[$id] = array('id' => $id, 'name' => $list['Name'], 'subscribed' => false);
1022
+ }
1023
  }
1024
 
1025
  return $list_data;
1056
  }
1057
  }
1058
 
1059
+ private function updateStatus($status)
1060
  {
1061
+ try {
1062
+ $campaigner_session = Mage::getSingleton('campaigner/session')->init();
1063
 
1064
+ $campaigner_session->setStatus($status);
1065
+ $campaigner_session->save();
1066
+ } catch (Exception $e) {
1067
+ $this->_logException($e);
1068
+ return false;
1069
+ }
1070
+ }
1071
+
1072
+ public function getSubscriberStatus()
1073
+ {
1074
  try {
1075
+ $subscriptions = $this->getSubscriptions();
1076
+ $status = strtolower($subscriptions['status']);
1077
+ $this->updateStatus($status);
1078
+ return $status;
1079
+ } catch (Exception $e) {
1080
+ return "Unknown";
1081
+ }
1082
+ }
1083
+
1084
+ public function resubscribeContact($customer)
1085
+ {
1086
+ try {
1087
+ $result = Mage::getSingleton("campaigner/wrapper_subscribers")->resubscribeContact($customer->getEmail());
1088
+
1089
+ $campaigner_session = Mage::getSingleton('campaigner/session')->init();
1090
+
1091
+ $campaigner_session->setStatus("Subscribed");
1092
+ $campaigner_session->save();
1093
+
1094
+ return true;
1095
+ } catch (Exception $e) {
1096
+ Mage::logException($e);
1097
+ $this->_logger->logException($e);
1098
+ return false;
1099
+ }
1100
+ }
1101
+
1102
+ public function getSubscriptions($email = null)
1103
+ {
1104
+ try {
1105
+ if ($this->_subscriptions != null) {
1106
+ return $this->_subscriptions;
1107
+ }
1108
+
1109
+ $this->_logger->setLogArea(Campaigner_Integration_Helper_Troubleshooting::CUSTOMER);
1110
+ $this->_logger->setLogLevel(Campaigner_Integration_Helper_Troubleshooting::LOG_LEVEL_LOW);
1111
+
1112
+ if ($email == null) {
1113
+ $customer = Mage::helper('customer')->getCustomer();
1114
+ if (!$customer) {
1115
+ throw new Exception("Customer not found", 1);
1116
+ }
1117
+ $email = $customer->getEmail();
1118
+ }
1119
+
1120
  $lists = $this->getLists();
1121
 
1122
  $subscriptions = $this->getSubscriberData($email, $lists);
1123
 
1124
  $this->_logger->resetLogLevel();
1125
 
1126
+ $this->_subscriptions = $subscriptions;
1127
+
1128
  return $subscriptions;
1129
  }
1130
  catch (Exception $e)
app/code/community/Campaigner/Integration/Helper/Fields.php CHANGED
@@ -117,7 +117,7 @@ class Campaigner_Integration_Helper_Fields extends Campaigner_Integration_Helper
117
  return $fields;
118
  }
119
 
120
- public function getCustomFields($force_product = false, $address_fields = true)
121
  {
122
  $fields = array();
123
 
@@ -131,7 +131,7 @@ class Campaigner_Integration_Helper_Fields extends Campaigner_Integration_Helper
131
  $fields = $this->getMultiFields($fields,"Related", Mage::helper('campaigner')->config('related_fields'));
132
  }
133
 
134
- if (Mage::helper('campaigner')->config('wishlist_enabled')) {
135
  $fields[] = $this->addField('WishListDate', self::DATA_TYPE_DATE);
136
  $fields[] = $this->addField('WishListUrl', self::DATA_TYPE_TEXT, '200');
137
  }
@@ -174,6 +174,9 @@ class Campaigner_Integration_Helper_Fields extends Campaigner_Integration_Helper
174
 
175
  public function saveFieldMap($attributes)
176
  {
 
 
 
177
  $defaults = $this->getDefaultFields();
178
  $attributeMap = array();
179
  foreach ($attributes as $attribute) {
117
  return $fields;
118
  }
119
 
120
+ public function getCustomFields($force_product = false, $address_fields = true, $force_wishlist = false)
121
  {
122
  $fields = array();
123
 
131
  $fields = $this->getMultiFields($fields,"Related", Mage::helper('campaigner')->config('related_fields'));
132
  }
133
 
134
+ if (Mage::helper('campaigner')->config('wishlist_enabled') || $force_wishlist) {
135
  $fields[] = $this->addField('WishListDate', self::DATA_TYPE_DATE);
136
  $fields[] = $this->addField('WishListUrl', self::DATA_TYPE_TEXT, '200');
137
  }
174
 
175
  public function saveFieldMap($attributes)
176
  {
177
+ if ($attributes == null) {
178
+ throw Exception("No Custom fields found");
179
+ }
180
  $defaults = $this->getDefaultFields();
181
  $attributeMap = array();
182
  foreach ($attributes as $attribute) {
app/code/community/Campaigner/Integration/Helper/Order.php CHANGED
@@ -266,7 +266,7 @@ class Campaigner_Integration_Helper_Order extends Campaigner_Integration_Helper_
266
  $cost = $product->getPrice();
267
  }
268
  } else {
269
- if ($parent_item != null) {
270
  $cost = $parent_item->getPrice();
271
  } else {
272
  $cost = $item->getPrice();
266
  $cost = $product->getPrice();
267
  }
268
  } else {
269
+ if ($parent_item != null && get_class($parent_item) != 'Varien_Object') {
270
  $cost = $parent_item->getPrice();
271
  } else {
272
  $cost = $item->getPrice();
app/code/community/Campaigner/Integration/Model/Abandoned/Observer.php CHANGED
@@ -41,7 +41,25 @@ class Campaigner_Integration_Model_Abandoned_Observer extends Campaigner_Integra
41
  }
42
  }
43
 
44
- private function processAbandoned($quote)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  {
46
  $this->_log("ProcessAbandoned Start");
47
  $email = $quote->getCustomerEmail();
@@ -57,7 +75,7 @@ class Campaigner_Integration_Model_Abandoned_Observer extends Campaigner_Integra
57
  $merge_vars['AbandonedDate'] = $abandonedDate;
58
  $merge_vars['AbandonedUrl'] = Mage::helper('campaigner/abandoned')->getAbandonedUrl($quote);
59
 
60
- Mage::helper('campaigner/abandoned')->addSequence($merge_vars);
61
 
62
  $merge_vars = Mage::helper('campaigner/order')->getMergeOrderItems($quote, $merge_vars, "AB");
63
 
@@ -118,7 +136,12 @@ class Campaigner_Integration_Model_Abandoned_Observer extends Campaigner_Integra
118
  $contactList[] = $contactData;
119
 
120
  $email = $contactData['EmailAddress'];
121
- $quote_list[$email] = array('quote_id' => $quote->getId(), 'status' => null);
 
 
 
 
 
122
 
123
  $subscribers = true;
124
  }
@@ -145,6 +168,11 @@ class Campaigner_Integration_Model_Abandoned_Observer extends Campaigner_Integra
145
 
146
  $this->setDateSent($quote_list,$date);
147
 
 
 
 
 
 
148
  $this->_log("Setting date sent for all quotes End");
149
  }
150
 
@@ -158,6 +186,16 @@ class Campaigner_Integration_Model_Abandoned_Observer extends Campaigner_Integra
158
  }
159
  }
160
 
 
 
 
 
 
 
 
 
 
 
161
  public function abandonedStoreProcessor($store, $check_date)
162
  {
163
  $store_code = $store->getCode();
41
  }
42
  }
43
 
44
+ private function updateSequence($id, $sequence)
45
+ {
46
+ try {
47
+ $session = Mage::getModel('campaigner/session')->load($id);
48
+
49
+ if (!$session) {
50
+ throw new Exception("Failed to load abandoned cart session to update sequence.", 1);
51
+ }
52
+
53
+ $session->setSequence($sequence);
54
+
55
+ $session->save();
56
+ } catch (Exception $e) {
57
+ Mage::logException($e);
58
+ $this->_logException($e);
59
+ }
60
+ }
61
+
62
+ private function processAbandoned(&$quote)
63
  {
64
  $this->_log("ProcessAbandoned Start");
65
  $email = $quote->getCustomerEmail();
75
  $merge_vars['AbandonedDate'] = $abandonedDate;
76
  $merge_vars['AbandonedUrl'] = Mage::helper('campaigner/abandoned')->getAbandonedUrl($quote);
77
 
78
+ Mage::helper('campaigner/abandoned')->addSequence($merge_vars, $quote);
79
 
80
  $merge_vars = Mage::helper('campaigner/order')->getMergeOrderItems($quote, $merge_vars, "AB");
81
 
136
  $contactList[] = $contactData;
137
 
138
  $email = $contactData['EmailAddress'];
139
+ $quote_list[$email] = array(
140
+ 'quote_id' => $quote->getId(),
141
+ 'status' => null,
142
+ 'session_id' => $quote->getSessionId(),
143
+ 'sequence' => $quote->getSequence()
144
+ );
145
 
146
  $subscribers = true;
147
  }
168
 
169
  $this->setDateSent($quote_list,$date);
170
 
171
+ // If Sequences are set individually, save them for next time
172
+ if (Mage::helper('campaigner/abandoned')->getSequenceScope() == 'per') {
173
+ $this->updateSequences($quote_list);
174
+ }
175
+
176
  $this->_log("Setting date sent for all quotes End");
177
  }
178
 
186
  }
187
  }
188
 
189
+ private function updateSequences($quote_list)
190
+ {
191
+ foreach ($quote_list as $data) {
192
+ $id = $data['session_id'];
193
+ $sequence = $data['sequence'];
194
+
195
+ $this->updateSequence($id, $sequence);
196
+ }
197
+ }
198
+
199
  public function abandonedStoreProcessor($store, $check_date)
200
  {
201
  $store_code = $store->getCode();
app/code/community/Campaigner/Integration/Model/Configuration/Observer.php CHANGED
@@ -36,11 +36,6 @@ class Campaigner_Integration_Model_Configuration_Observer extends Campaigner_Int
36
 
37
  $this->_helper->enableCampaigner($store);
38
 
39
- // Now that we know we have a valid configuration we can update our attributes
40
- $attributes = Mage::getSingleton('campaigner/wrapper_database')->getAllColumns(false,true,false);
41
-
42
- Mage::helper('campaigner/fields')->saveFieldMap($attributes);
43
-
44
  $force_product = false;
45
  if (isset($fields['save_latest_order']['value']) && $fields['save_latest_order']['value'] == true) {
46
  $force_product = true;
@@ -49,6 +44,11 @@ class Campaigner_Integration_Model_Configuration_Observer extends Campaigner_Int
49
  // Verify all custom fields are present
50
  Mage::helper('campaigner/fields')->verifyFields($force_product);
51
 
 
 
 
 
 
52
  $this->_logger->resetLogLevel();
53
  }
54
  }
36
 
37
  $this->_helper->enableCampaigner($store);
38
 
 
 
 
 
 
39
  $force_product = false;
40
  if (isset($fields['save_latest_order']['value']) && $fields['save_latest_order']['value'] == true) {
41
  $force_product = true;
44
  // Verify all custom fields are present
45
  Mage::helper('campaigner/fields')->verifyFields($force_product);
46
 
47
+ // Now that we know we have a valid configuration we can update our attributes
48
+ $attributes = Mage::getSingleton('campaigner/wrapper_database')->getAllColumns(false,true,false);
49
+
50
+ Mage::helper('campaigner/fields')->saveFieldMap($attributes);
51
+
52
  $this->_logger->resetLogLevel();
53
  }
54
  }
app/code/community/Campaigner/Integration/Model/Customer/Observer.php CHANGED
@@ -2,6 +2,12 @@
2
 
3
  class Campaigner_Integration_Model_Customer_Observer extends Campaigner_Integration_Model_Observer_Abstract
4
  {
 
 
 
 
 
 
5
  private function hasCustomerChanged($customer)
6
  {
7
  $maps = unserialize( $this->_helper->config('map_fields', $customer->getStoreId()) );
@@ -23,6 +29,12 @@ class Campaigner_Integration_Model_Customer_Observer extends Campaigner_Integrat
23
  return false;
24
  }
25
 
 
 
 
 
 
 
26
  protected function getMergeCustomer($object = NULL)
27
  {
28
  //Initialize as GUEST customer
@@ -55,22 +67,39 @@ class Campaigner_Integration_Model_Customer_Observer extends Campaigner_Integrat
55
  return $customer;
56
  }
57
 
58
- private function canShowStatus($campaigner_session)
 
 
 
 
 
59
  {
60
- $last_notified = $campaigner_session->getStatusNotified();
61
 
62
- if (strtotime($last_notified) <= strtotime('-24 hours')) {
 
 
63
  return true;
64
  }
65
  return false;
66
  }
67
 
 
 
 
 
 
68
  private function checkStatus($customer)
69
  {
70
  $campaigner_session = Mage::getSingleton('campaigner/session')->init();
71
  $session = Mage::getSingleton('customer/session');
72
 
73
- if ($campaigner_session->getStatus() == null || $this->canShowStatus($campaigner_session) == true) {
 
 
 
 
 
74
  try {
75
  $contact_data = Mage::getSingleton("campaigner/wrapper_subscribers")->getContact($customer->getEmail(), true, false, true, false);
76
 
@@ -104,7 +133,11 @@ class Campaigner_Integration_Model_Customer_Observer extends Campaigner_Integrat
104
  }
105
  }
106
 
107
-
 
 
 
 
108
  public function customerLogin(Varien_Event_Observer $observer)
109
  {
110
  try
@@ -144,6 +177,40 @@ class Campaigner_Integration_Model_Customer_Observer extends Campaigner_Integrat
144
  }
145
  }
146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  public function updateCustomer(Varien_Event_Observer $observer)
148
  {
149
  try {
@@ -176,7 +243,17 @@ class Campaigner_Integration_Model_Customer_Observer extends Campaigner_Integrat
176
  $this->_log("Modifying Email");
177
 
178
  $this->_log("Adding Subscriber");
179
- $api->add($customer);
 
 
 
 
 
 
 
 
 
 
180
  } else {
181
  if ($this->hasCustomerChanged($customer)) {
182
  $this->_log("Updating Subscriber");
@@ -248,7 +325,13 @@ class Campaigner_Integration_Model_Customer_Observer extends Campaigner_Integrat
248
  $this->_log("Modifying Email");
249
 
250
  $this->_log("Adding Subscriber");
251
- $api->add($customer);
 
 
 
 
 
 
252
  } else {
253
  if ($this->hasCustomerChanged($customer)) {
254
  $this->_log("Updating Subscriber");
2
 
3
  class Campaigner_Integration_Model_Customer_Observer extends Campaigner_Integration_Model_Observer_Abstract
4
  {
5
+ /**
6
+ * has the Customer changed
7
+ *
8
+ * @param Mage_Customer_Model_Customer $customer
9
+ * @return bool
10
+ */
11
  private function hasCustomerChanged($customer)
12
  {
13
  $maps = unserialize( $this->_helper->config('map_fields', $customer->getStoreId()) );
29
  return false;
30
  }
31
 
32
+ /**
33
+ * get the Customer for Data Merge
34
+ *
35
+ * @param Mage_Customer_Model_Customer $object
36
+ * @return Mage_Customer_Model_Customer
37
+ */
38
  protected function getMergeCustomer($object = NULL)
39
  {
40
  //Initialize as GUEST customer
67
  return $customer;
68
  }
69
 
70
+ /**
71
+ * Can we check the status yet?
72
+ *
73
+ * @param Campaigner_Integration_Model_Session $campaignerSession
74
+ */
75
+ private function canCheckStatus($campaignerSession)
76
  {
77
+ $lastNotified = $campaignerSession->getStatusNotified();
78
 
79
+ $timeCheck = $this->_helper->config('status_check_time');
80
+
81
+ if (strtotime($lastNotified) <= strtotime($timeCheck)) {
82
  return true;
83
  }
84
  return false;
85
  }
86
 
87
+ /**
88
+ * Check the status of customer email.
89
+ *
90
+ * @param Mage_Customer_Model_Customer $customer
91
+ */
92
  private function checkStatus($customer)
93
  {
94
  $campaigner_session = Mage::getSingleton('campaigner/session')->init();
95
  $session = Mage::getSingleton('customer/session');
96
 
97
+ if ($customer->getOrigData() == null || !$customer->getOrigData()) {
98
+ $this->_log("New customer. Aborting Status Check...");
99
+ return;
100
+ }
101
+
102
+ if ($campaigner_session->getStatus() == null || $this->canCheckStatus($campaigner_session) == true) {
103
  try {
104
  $contact_data = Mage::getSingleton("campaigner/wrapper_subscribers")->getContact($customer->getEmail(), true, false, true, false);
105
 
133
  }
134
  }
135
 
136
+ /**
137
+ * Send last login to Campaigner
138
+ *
139
+ * @param Varien_Event_Observer $observer
140
+ */
141
  public function customerLogin(Varien_Event_Observer $observer)
142
  {
143
  try
177
  }
178
  }
179
 
180
+ /**
181
+ * check email Status in session table
182
+ */
183
+ private function checkLocalStatus($customer)
184
+ {
185
+ $campaigner_session = Mage::getSingleton('campaigner/session')->loadByCustomerId($customer->getId());
186
+
187
+ if (!$campaigner_session) {
188
+ return false;
189
+ }
190
+
191
+ if ($campaigner_session->getStatus() == "hardbounce") {
192
+ return true;
193
+ }
194
+ return false;
195
+ }
196
+
197
+ private function resetLocalStatus($customer)
198
+ {
199
+ $campaigner_session = Mage::getSingleton('campaigner/session')->loadByCustomerId($customer->getId());
200
+
201
+ if (!$campaigner_session) {
202
+ return false;
203
+ }
204
+
205
+ $campaigner_session->setStatus("Subscribed");
206
+ $campaigner_session->save();
207
+ }
208
+
209
+ /**
210
+ * Update customer information in Campaigner
211
+ *
212
+ * @param Varien_Event_Observer $observer
213
+ */
214
  public function updateCustomer(Varien_Event_Observer $observer)
215
  {
216
  try {
243
  $this->_log("Modifying Email");
244
 
245
  $this->_log("Adding Subscriber");
246
+
247
+ if ($this->checkLocalStatus($customer)) {
248
+ $this->_log("Hard Bounced Email, Subscribing");
249
+ // Status was Hard Bounced so change it
250
+ $api->changeEmail($customer);
251
+ $this->resetLocalStatus($customer);
252
+ } else {
253
+ $this->_log("Status was not Hard Bounced so just update");
254
+ $api->add($customer);
255
+ }
256
+
257
  } else {
258
  if ($this->hasCustomerChanged($customer)) {
259
  $this->_log("Updating Subscriber");
325
  $this->_log("Modifying Email");
326
 
327
  $this->_log("Adding Subscriber");
328
+ if ($this->checkLocalStatus($customer)) {
329
+ // Status was Hard Bounced so change it
330
+ $api->changeEmail($customer);
331
+ $this->resetLocalStatus($customer);
332
+ } else {
333
+ $api->add($customer);
334
+ }
335
  } else {
336
  if ($this->hasCustomerChanged($customer)) {
337
  $this->_log("Updating Subscriber");
app/code/community/Campaigner/Integration/Model/Mysql4/Abandoned/Collection.php CHANGED
@@ -13,10 +13,12 @@ class Campaigner_Integration_Model_Mysql4_Abandoned_Collection extends Mage_Sale
13
 
14
  $this->getSelect()->joinInner(array('camp_ac' => $resource->getTableName("campaigner/abandoned")),"camp_ac.quote_id=main_table.entity_id",array(
15
  'date_sent' => "date_sent",
16
- 'status' => "status"
17
  ));
18
  $this->getSelect()->joinInner(array('camp_s' => $resource->getTableName("campaigner/session") ),"camp_s.id=camp_ac.session_id",array(
19
- 'email' => "IF(main_table.customer_email IS NOT NULL, main_table.customer_email, email)"
 
 
20
  ));
21
 
22
  $this->addFieldToFilter('items_count', array('neq' => '0'))
13
 
14
  $this->getSelect()->joinInner(array('camp_ac' => $resource->getTableName("campaigner/abandoned")),"camp_ac.quote_id=main_table.entity_id",array(
15
  'date_sent' => "date_sent",
16
+ 'status' => "status"
17
  ));
18
  $this->getSelect()->joinInner(array('camp_s' => $resource->getTableName("campaigner/session") ),"camp_s.id=camp_ac.session_id",array(
19
+ 'email' => "IF(main_table.customer_email IS NOT NULL, main_table.customer_email, email)",
20
+ 'sequence' => 'sequence',
21
+ 'session_id' => 'id'
22
  ));
23
 
24
  $this->addFieldToFilter('items_count', array('neq' => '0'))
app/code/community/Campaigner/Integration/Model/Mysql4/Session.php CHANGED
@@ -24,4 +24,17 @@ class Campaigner_Integration_Model_Mysql4_Session extends Mage_Core_Model_Mysql4
24
 
25
  return false;
26
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  }
24
 
25
  return false;
26
  }
27
+
28
+ public function loadByCustomerId($customer_id)
29
+ {
30
+ $select = $this->_read->select()
31
+ ->from($this->getTable('campaigner/session'))
32
+ ->where('customer_id=?', $customer_id);
33
+
34
+ if ($result = $this->_read->fetchRow($select)) {
35
+ return $result;
36
+ }
37
+
38
+ return false;
39
+ }
40
  }
app/code/community/Campaigner/Integration/Model/Session.php CHANGED
@@ -19,30 +19,47 @@ class Campaigner_Integration_Model_Session extends Mage_Core_Model_Abstract
19
  return $this;
20
  }
21
 
 
 
 
 
 
 
 
 
 
 
 
22
  public function init($email = null)
23
  {
 
 
24
  try {
25
  $customer_session = Mage::getSingleton("customer/session");
26
 
27
- $magento_session_id = $customer_session->getEncryptedSessionId();
 
 
 
 
 
28
 
29
- $campaigner_id = Mage::getModel('core/cookie')->get('camp_id');
30
 
31
- $new = false;
32
 
33
- if (!empty($campaigner_id)) {
34
- $this->load($campaigner_id);
35
- } else {
36
- $new = true;
37
- if (!$this->loadByMagentoSessionId($magento_session_id)) {
38
- $this->setMagentoSessionId($magento_session_id);
 
 
 
39
  }
40
  }
41
 
42
- if ($customer_session->isLoggedIn()) {
43
- $this->setCustomerId($customer_session->getId());
44
- }
45
-
46
  if ($email != null) {
47
  $this->setEmail($email);
48
  }
19
  return $this;
20
  }
21
 
22
+ public function loadByCustomerId($customer_id)
23
+ {
24
+ if ($data = $this->getResource()->loadByCustomerId($customer_id)) {
25
+ $this->addData($data);
26
+ } else {
27
+ return false;
28
+ }
29
+
30
+ return $this;
31
+ }
32
+
33
  public function init($email = null)
34
  {
35
+ $new = false;
36
+
37
  try {
38
  $customer_session = Mage::getSingleton("customer/session");
39
 
40
+ if ($customer_session->isLoggedIn()) {
41
+ if (!$this->loadByCustomerId($customer_session->getId())) {
42
+ $new = true;
43
+ $this->setCustomerId($customer_session->getId());
44
+ }
45
+ } else {
46
 
47
+ $magento_session_id = $customer_session->getEncryptedSessionId();
48
 
49
+ $campaigner_id = Mage::getModel('core/cookie')->get('camp_id');
50
 
51
+ if (!empty($campaigner_id)) {
52
+ if (!$this->load($campaigner_id)) {
53
+ $new = true;
54
+ }
55
+ } else {
56
+ $new = true;
57
+ if (!$this->loadByMagentoSessionId($magento_session_id)) {
58
+ $this->setMagentoSessionId($magento_session_id);
59
+ }
60
  }
61
  }
62
 
 
 
 
 
63
  if ($email != null) {
64
  $this->setEmail($email);
65
  }
app/code/community/Campaigner/Integration/Model/System/Config/Source/Sequence.php CHANGED
@@ -7,7 +7,7 @@ class Campaigner_Integration_Model_System_Config_Source_Sequence
7
  Mage::helper('campaigner/troubleshooting')->setLogArea(Campaigner_Integration_Helper_Troubleshooting::CONFIG);
8
  Mage::helper('campaigner/troubleshooting')->setLogLevel(Campaigner_Integration_Helper_Troubleshooting::LOG_LEVEL_LOW);
9
 
10
- $fields = Mage::helper('campaigner')->getCampaignerColumnOptions();
11
 
12
  $options = array();
13
 
7
  Mage::helper('campaigner/troubleshooting')->setLogArea(Campaigner_Integration_Helper_Troubleshooting::CONFIG);
8
  Mage::helper('campaigner/troubleshooting')->setLogLevel(Campaigner_Integration_Helper_Troubleshooting::LOG_LEVEL_LOW);
9
 
10
+ $fields = Mage::helper('campaigner')->getCampaignerColumnOptions(true);
11
 
12
  $options = array();
13
 
app/code/community/Campaigner/Integration/Model/System/Config/Source/Sequence/Scope.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Campaigner_Integration_Model_System_Config_Source_Sequence_Scope
4
+ {
5
+
6
+ public function toOptionArray()
7
+ {
8
+ return array(
9
+ array('value' => 'all', 'label' => Mage::helper('campaigner')->__('Track sequence across all subscribers')),
10
+ array('value' => 'per', 'label' => Mage::helper('campaigner')->__('Track sequence per subscriber')),
11
+ );
12
+ }
13
+ }
app/code/community/Campaigner/Integration/Model/Wrapper/Subscribers.php CHANGED
@@ -4,33 +4,32 @@ class Campaigner_Integration_Model_Wrapper_subscribers extends Campaigner_Integr
4
  {
5
  protected $_contactCache = null;
6
 
7
- public function add($customer, $subscribe = false)
8
  {
9
- $listId = (int)Mage::helper('campaigner')->config('list');
10
- $contactData = $this->getContactData($customer);
11
 
12
- $data = array(
13
- 'UpdateExistingContacts' => true,
14
- 'TriggerWorkflow' => false,
15
- 'contacts' => Array(
16
- 'ContactData' => $contactData
17
- ),
18
- );
19
 
20
- if ($subscribe) {
21
- $data['globalAddToGroup'] = array($listId);
 
22
  }
23
 
24
- $service = 'contact';
25
- $method = "ImmediateUpload";
 
26
 
27
- $response = $this->sendCommand($service, $method, null, $data);
28
  }
29
 
30
- public function addByEmail($email, $merge_vars, $subscribe = false)
31
  {
32
- $listId = (int)Mage::helper('campaigner')->config('list');
33
- $contactData = $this->getEmailContactData($email, $merge_vars);
 
 
 
 
34
 
35
  $data = array(
36
  'UpdateExistingContacts' => true,
@@ -41,13 +40,35 @@ class Campaigner_Integration_Model_Wrapper_subscribers extends Campaigner_Integr
41
  );
42
 
43
  if ($subscribe) {
 
44
  $data['globalAddToGroup'] = array($listId);
45
  }
46
 
47
  $service = 'contact';
48
  $method = "ImmediateUpload";
49
 
50
- $response = $this->sendCommand($service, $method, null, $data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  }
52
 
53
  public function delete($customer)
4
  {
5
  protected $_contactCache = null;
6
 
7
+ private function checkContactCache($contactData)
8
  {
9
+ $data = serialize($contactData);
 
10
 
11
+ $cache = Mage::registry("contact_cache");
 
 
 
 
 
 
12
 
13
+ if (!$cache) {
14
+ Mage::register("contact_cache",$data);
15
+ return false;
16
  }
17
 
18
+ if ($cache == $data) {
19
+ return true;
20
+ }
21
 
22
+ return false;
23
  }
24
 
25
+ private function _add($contactData, $subscribe = false)
26
  {
27
+ // Check first so that it stores the current data if nothing has been
28
+ // stored yet
29
+ if ($this->checkContactCache($contactData) && !$subscribe) {
30
+ $this->log("Contact data has not changed... Aborting");
31
+ return;
32
+ }
33
 
34
  $data = array(
35
  'UpdateExistingContacts' => true,
40
  );
41
 
42
  if ($subscribe) {
43
+ $listId = (int)Mage::helper('campaigner')->config('list');
44
  $data['globalAddToGroup'] = array($listId);
45
  }
46
 
47
  $service = 'contact';
48
  $method = "ImmediateUpload";
49
 
50
+ return $this->sendCommand($service, $method, null, $data);
51
+ }
52
+
53
+ public function add($customer, $subscribe = false)
54
+ {
55
+ $contactData = $this->getContactData($customer);
56
+
57
+ return $this->_add($contactData, $subscribe);
58
+ }
59
+
60
+ public function changeEmail($customer)
61
+ {
62
+ $contactData = $this->getContactData($customer, array('Status' => "Subscribed"));
63
+
64
+ return $this->_add($contactData);
65
+ }
66
+
67
+ public function addByEmail($email, $merge_vars, $subscribe = false)
68
+ {
69
+ $contactData = $this->getEmailContactData($email, $merge_vars);
70
+
71
+ return $this->_add($contactData, $subscribe);
72
  }
73
 
74
  public function delete($customer)
app/code/community/Campaigner/Integration/controllers/AbandonedController.php CHANGED
@@ -2,10 +2,18 @@
2
 
3
  class Campaigner_Integration_AbandonedController extends Campaigner_Integration_Controller_Front_Abstract
4
  {
 
 
 
 
 
 
 
 
 
5
  public function restoreAction()
6
  {
7
- try
8
- {
9
  $coded_cart = Mage::app()->getRequest()->getParam('cart');
10
 
11
  $cart_data = unserialize(base64_decode($coded_cart));
@@ -14,9 +22,7 @@ class Campaigner_Integration_AbandonedController extends Campaigner_Integration_
14
  $this->restoreCartItems($cart_data);
15
 
16
  $this->_redirect("checkout/cart");
17
- }
18
- catch (Exception $e)
19
- {
20
  $this->getCheckout()->addError('Unable to Restore your cart');
21
  Mage::logException($e);
22
  $this->_redirect("checkout/cart");
@@ -30,30 +36,25 @@ class Campaigner_Integration_AbandonedController extends Campaigner_Integration_
30
  $bundle_option = array();
31
  $bundle_option_qty = array();
32
 
33
- foreach ($option_data as $od)
34
- {
35
  $od_parts = explode("=",$od);
36
 
37
  $option_id = $od_parts[0];
38
 
39
  $products = $od_parts[1];
40
 
41
- if (strpos($products,"~"))
42
- {
43
  // Single Item with Qty
44
  $option_products = explode("~",$products);
45
 
46
  $bundle_option[$option_id] = $option_products[0];
47
 
48
  $bundle_option_qty[$option_id] = $option_products[1];
49
- }
50
- else
51
- {
52
  // 1 or more items with no qty
53
  $option_products = explode(":",$products);
54
 
55
- foreach ($option_products as $op)
56
- {
57
  $bundle_option[$option_id][] = $op;
58
  }
59
  }
@@ -71,26 +72,24 @@ class Campaigner_Integration_AbandonedController extends Campaigner_Integration_
71
  $group_list = array();
72
  $position = 0;
73
 
74
- foreach ($id_list as $key => $item_id)
75
- {
76
  $position++;
77
  $qty = $qty_list[$key];
78
 
79
  $id_parts = explode('|',$item_id);
80
 
81
  // If there is more than just an id then we have a complex product
82
- if (count($id_parts) > 1)
83
- {
84
  $id = $id_parts[0];
85
  $option = $id_parts[1];
86
 
87
  // MAKE SURE WE CAN LOAD THE PRODUCT
88
  $product = Mage::getModel('catalog/product')->load($id);
89
- if (!$product)
90
  continue;
 
91
 
92
- switch ($product->getTypeId())
93
- {
94
  case "configurable":
95
  {
96
  $item_list[$position] = array(
@@ -129,15 +128,14 @@ class Campaigner_Integration_AbandonedController extends Campaigner_Integration_
129
  );
130
  } break;
131
  }
132
- }
133
- else
134
- {
135
  // Simple Product
136
 
137
  // MAKE SURE WE CAN LOAD THE PRODUCT
138
  $product = Mage::getModel('catalog/product')->load($item_id);
139
- if (!$product)
140
  continue;
 
141
 
142
  $item_list[] = array(
143
  'product_type' => 'simple',
@@ -148,8 +146,7 @@ class Campaigner_Integration_AbandonedController extends Campaigner_Integration_
148
  }
149
 
150
  // Merge the group and simple products
151
- foreach ($group_list as $group)
152
- {
153
  $item_list[$group['position']] = $group;
154
  }
155
 
@@ -165,8 +162,7 @@ class Campaigner_Integration_AbandonedController extends Campaigner_Integration_
165
 
166
  $item_list = $this->prepareCartItems($cart_data);
167
 
168
- foreach ($item_list as $item)
169
- {
170
  $this->addItemToCart($item);
171
  }
172
 
@@ -180,8 +176,7 @@ class Campaigner_Integration_AbandonedController extends Campaigner_Integration_
180
 
181
  private function addItemToCart($item)
182
  {
183
- try
184
- {
185
  $product = $item['product'];
186
 
187
  $data = array(
@@ -192,10 +187,8 @@ class Campaigner_Integration_AbandonedController extends Campaigner_Integration_
192
  $data['qty'] = $item['qty'];
193
  }
194
 
195
- if (isset($item['option']))
196
- {
197
- foreach ($item['option'] as $key => $option)
198
- {
199
  $data[$key] = $option;
200
  }
201
  }
@@ -206,9 +199,7 @@ class Campaigner_Integration_AbandonedController extends Campaigner_Integration_
206
  $quote->addProductAdvanced($product, new Varien_Object($data));
207
 
208
  return true;
209
- }
210
- catch (Exception $e)
211
- {
212
  Mage::logException($e);
213
  return false;
214
  }
2
 
3
  class Campaigner_Integration_AbandonedController extends Campaigner_Integration_Controller_Front_Abstract
4
  {
5
+ public function testAction()
6
+ {
7
+ $customer_session = Mage::getSingleton("customer/session");
8
+
9
+ $magento_session_id = $customer_session->getEncryptedSessionId();
10
+
11
+ echo "[$magento_session_id]";
12
+ }
13
+
14
  public function restoreAction()
15
  {
16
+ try {
 
17
  $coded_cart = Mage::app()->getRequest()->getParam('cart');
18
 
19
  $cart_data = unserialize(base64_decode($coded_cart));
22
  $this->restoreCartItems($cart_data);
23
 
24
  $this->_redirect("checkout/cart");
25
+ } catch (Exception $e) {
 
 
26
  $this->getCheckout()->addError('Unable to Restore your cart');
27
  Mage::logException($e);
28
  $this->_redirect("checkout/cart");
36
  $bundle_option = array();
37
  $bundle_option_qty = array();
38
 
39
+ foreach ($option_data as $od) {
 
40
  $od_parts = explode("=",$od);
41
 
42
  $option_id = $od_parts[0];
43
 
44
  $products = $od_parts[1];
45
 
46
+ if (strpos($products,"~")) {
 
47
  // Single Item with Qty
48
  $option_products = explode("~",$products);
49
 
50
  $bundle_option[$option_id] = $option_products[0];
51
 
52
  $bundle_option_qty[$option_id] = $option_products[1];
53
+ } else {
 
 
54
  // 1 or more items with no qty
55
  $option_products = explode(":",$products);
56
 
57
+ foreach ($option_products as $op) {
 
58
  $bundle_option[$option_id][] = $op;
59
  }
60
  }
72
  $group_list = array();
73
  $position = 0;
74
 
75
+ foreach ($id_list as $key => $item_id) {
 
76
  $position++;
77
  $qty = $qty_list[$key];
78
 
79
  $id_parts = explode('|',$item_id);
80
 
81
  // If there is more than just an id then we have a complex product
82
+ if (count($id_parts) > 1) {
 
83
  $id = $id_parts[0];
84
  $option = $id_parts[1];
85
 
86
  // MAKE SURE WE CAN LOAD THE PRODUCT
87
  $product = Mage::getModel('catalog/product')->load($id);
88
+ if (!$product) {
89
  continue;
90
+ }
91
 
92
+ switch ($product->getTypeId()) {
 
93
  case "configurable":
94
  {
95
  $item_list[$position] = array(
128
  );
129
  } break;
130
  }
131
+ } else {
 
 
132
  // Simple Product
133
 
134
  // MAKE SURE WE CAN LOAD THE PRODUCT
135
  $product = Mage::getModel('catalog/product')->load($item_id);
136
+ if (!$product) {
137
  continue;
138
+ }
139
 
140
  $item_list[] = array(
141
  'product_type' => 'simple',
146
  }
147
 
148
  // Merge the group and simple products
149
+ foreach ($group_list as $group) {
 
150
  $item_list[$group['position']] = $group;
151
  }
152
 
162
 
163
  $item_list = $this->prepareCartItems($cart_data);
164
 
165
+ foreach ($item_list as $item) {
 
166
  $this->addItemToCart($item);
167
  }
168
 
176
 
177
  private function addItemToCart($item)
178
  {
179
+ try {
 
180
  $product = $item['product'];
181
 
182
  $data = array(
187
  $data['qty'] = $item['qty'];
188
  }
189
 
190
+ if (isset($item['option'])) {
191
+ foreach ($item['option'] as $key => $option) {
 
 
192
  $data[$key] = $option;
193
  }
194
  }
199
  $quote->addProductAdvanced($product, new Varien_Object($data));
200
 
201
  return true;
202
+ } catch (Exception $e) {
 
 
203
  Mage::logException($e);
204
  return false;
205
  }
app/code/community/Campaigner/Integration/controllers/Admin/AbandonedController.php CHANGED
@@ -2,6 +2,11 @@
2
 
3
  class Campaigner_Integration_Admin_AbandonedController extends Mage_Adminhtml_Controller_Action
4
  {
 
 
 
 
 
5
  public function indexAction()
6
  {
7
  $this->loadLayout();
2
 
3
  class Campaigner_Integration_Admin_AbandonedController extends Mage_Adminhtml_Controller_Action
4
  {
5
+ protected function _isAllowed()
6
+ {
7
+ return Mage::getSingleton('admin/session')->isAllowed('campaigner/campaigner_abandoned');
8
+ }
9
+
10
  public function indexAction()
11
  {
12
  $this->loadLayout();
app/code/community/Campaigner/Integration/controllers/Admin/DiagnosticController.php CHANGED
@@ -7,6 +7,11 @@ class Campaigner_Integration_Admin_DiagnosticController extends Mage_Adminhtml_C
7
  private $_quote = null;
8
  private $_result = array();
9
 
 
 
 
 
 
10
  public function downloadAction()
11
  {
12
  $filename = $this->getRequest()->getParam('filename');
@@ -369,7 +374,7 @@ class Campaigner_Integration_Admin_DiagnosticController extends Mage_Adminhtml_C
369
  // Setup sequence for this store
370
  Mage::helper('campaigner/abandoned')->setupSequence();
371
 
372
- Mage::helper('campaigner/abandoned')->addSequence($merge_vars);
373
 
374
  $merge_vars = Mage::helper('campaigner/order')->getMergeOrderItems($quote, $merge_vars, "AB");
375
 
@@ -410,7 +415,7 @@ class Campaigner_Integration_Admin_DiagnosticController extends Mage_Adminhtml_C
410
  // Setup sequence for this store
411
  Mage::helper('campaigner/abandoned')->setupSequence();
412
 
413
- Mage::helper('campaigner/abandoned')->addSequence($merge_vars);
414
 
415
  $merge_vars = Mage::helper('campaigner/order')->getMergeOrderItems($quote, $merge_vars, "AB");
416
 
7
  private $_quote = null;
8
  private $_result = array();
9
 
10
+ protected function _isAllowed()
11
+ {
12
+ return Mage::getSingleton('admin/session')->isAllowed('campaigner/campaigner_diagnostics');
13
+ }
14
+
15
  public function downloadAction()
16
  {
17
  $filename = $this->getRequest()->getParam('filename');
374
  // Setup sequence for this store
375
  Mage::helper('campaigner/abandoned')->setupSequence();
376
 
377
+ Mage::helper('campaigner/abandoned')->addSequence($merge_vars, $quote);
378
 
379
  $merge_vars = Mage::helper('campaigner/order')->getMergeOrderItems($quote, $merge_vars, "AB");
380
 
415
  // Setup sequence for this store
416
  Mage::helper('campaigner/abandoned')->setupSequence();
417
 
418
+ Mage::helper('campaigner/abandoned')->addSequence($merge_vars, $quote);
419
 
420
  $merge_vars = Mage::helper('campaigner/order')->getMergeOrderItems($quote, $merge_vars, "AB");
421
 
app/code/community/Campaigner/Integration/controllers/Admin/LatestController.php CHANGED
@@ -2,6 +2,11 @@
2
 
3
  class Campaigner_Integration_Admin_LatestController extends Mage_Adminhtml_Controller_Action
4
  {
 
 
 
 
 
5
  public function indexAction()
6
  {
7
  $this->loadLayout();
2
 
3
  class Campaigner_Integration_Admin_LatestController extends Mage_Adminhtml_Controller_Action
4
  {
5
+ protected function _isAllowed()
6
+ {
7
+ return Mage::getSingleton('admin/session')->isAllowed('campaigner/campaigner_latest');
8
+ }
9
+
10
  public function indexAction()
11
  {
12
  $this->loadLayout();
app/code/community/Campaigner/Integration/controllers/Admin/TroubleshootingController.php CHANGED
@@ -5,6 +5,11 @@ class Campaigner_Integration_Admin_TroubleshootingController extends Mage_Adminh
5
  private $_output = array();
6
  private $_config = null;
7
 
 
 
 
 
 
8
  public function indexAction()
9
  {
10
  $this->loadLayout();
5
  private $_output = array();
6
  private $_config = null;
7
 
8
+ protected function _isAllowed()
9
+ {
10
+ return Mage::getSingleton('admin/session')->isAllowed('campaigner/campaigner_troubleshooting');
11
+ }
12
+
13
  public function indexAction()
14
  {
15
  $this->loadLayout();
app/code/community/Campaigner/Integration/controllers/Customer/AccountController.php CHANGED
@@ -48,15 +48,11 @@ class Campaigner_Integration_Customer_AccountController extends Campaigner_Integ
48
  try {
49
  $customer = $this->_getCustomerSession()->getCustomer();
50
 
51
- $result = Mage::getSingleton("campaigner/wrapper_subscribers")->resubscribeContact($customer->getEmail());
52
-
53
- $campaigner_session = Mage::getSingleton('campaigner/session')->init();
54
-
55
- $campaigner_session->setStatus("Subscribed");
56
- $campaigner_session->save();
57
-
58
- $this->_getCustomerSession()->addSuccess("Thank you! You are now eligible to receive newsletter emails.");
59
-
60
  } catch (Exception $e) {
61
  $this->_logException($e);
62
  $this->_getCustomerSession()->addError("Unable to update your preferences. Please try again at a later time.");
48
  try {
49
  $customer = $this->_getCustomerSession()->getCustomer();
50
 
51
+ if (Mage::helper('campaigner')->resubscribeContact($customer)) {
52
+ $this->_getCustomerSession()->addSuccess("Thank you! You are now eligible to receive newsletter emails.");
53
+ } else {
54
+ $this->_getCustomerSession()->addError("Unable to update your preferences. Please try again at a later time.");
55
+ }
 
 
 
 
56
  } catch (Exception $e) {
57
  $this->_logException($e);
58
  $this->_getCustomerSession()->addError("Unable to update your preferences. Please try again at a later time.");
app/code/community/Campaigner/Integration/etc/adminhtml.xml CHANGED
@@ -32,6 +32,26 @@
32
  <resources>
33
  <admin>
34
  <children>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  <system>
36
  <children>
37
  <config>
32
  <resources>
33
  <admin>
34
  <children>
35
+ <campaigner>
36
+ <title>Campaigner</title>
37
+ <children>
38
+ <campaigner_abandoned module='campaigner'>
39
+ <title>Abandoned Carts</title>
40
+ </campaigner_abandoned>
41
+ <campaigner_latest>
42
+ <title>Latest Orders</title>
43
+ </campaigner_latest>
44
+ <campaigner_troubleshooting module='campaigner'>
45
+ <title>Troubleshooting</title>
46
+ </campaigner_troubleshooting>
47
+ <campaigner_diagnostics>
48
+ <title>Diagnostics</title>
49
+ </campaigner_diagnostics>
50
+ <campaigner_config>
51
+ <title>Configuration Link</title>
52
+ </campaigner_config>
53
+ </children>
54
+ </campaigner>
55
  <system>
56
  <children>
57
  <config>
app/code/community/Campaigner/Integration/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Campaigner_Integration>
5
- <version>1.0.1</version>
6
  </Campaigner_Integration>
7
  </modules>
8
  <global>
@@ -295,6 +295,7 @@ C]]></abandonedsequence_options>
295
  <batch_date_adjust>-1 week</batch_date_adjust>
296
  <wishlist_enabled>0</wishlist_enabled>
297
  <field_prefix>Mage_</field_prefix>
 
298
  </general>
299
  <export>
300
  <include_disabled>1</include_disabled>
@@ -308,7 +309,6 @@ C]]></abandonedsequence_options>
308
  <logging_stores>all</logging_stores>
309
  <logging_areas>all</logging_areas>
310
  <diagnostic_enabled>0</diagnostic_enabled>
311
-
312
  <enabled>0</enabled>
313
  <email>support@campaigner.com</email>
314
  <subject>Campaigner Magento Module Troubleshooting Report</subject>
2
  <config>
3
  <modules>
4
  <Campaigner_Integration>
5
+ <version>1.0.2</version>
6
  </Campaigner_Integration>
7
  </modules>
8
  <global>
295
  <batch_date_adjust>-1 week</batch_date_adjust>
296
  <wishlist_enabled>0</wishlist_enabled>
297
  <field_prefix>Mage_</field_prefix>
298
+ <status_check_time>-24 hours</status_check_time>
299
  </general>
300
  <export>
301
  <include_disabled>1</include_disabled>
309
  <logging_stores>all</logging_stores>
310
  <logging_areas>all</logging_areas>
311
  <diagnostic_enabled>0</diagnostic_enabled>
 
312
  <enabled>0</enabled>
313
  <email>support@campaigner.com</email>
314
  <subject>Campaigner Magento Module Troubleshooting Report</subject>
app/code/community/Campaigner/Integration/etc/system.xml CHANGED
@@ -115,6 +115,17 @@
115
  <can_be_empty>1</can_be_empty>
116
  <comment>This is the List that emails will be subscribed to and is required</comment>
117
  </list>
 
 
 
 
 
 
 
 
 
 
 
118
  <store_send_type translate="label comment">
119
  <label>Store field to send</label>
120
  <frontend_type>select</frontend_type>
@@ -260,6 +271,18 @@
260
  <comment>This will allow you to assign a sequence of values to your subscribers, one for each abandoned cart.</comment>
261
  <depends><abandoned_enabled>1</abandoned_enabled></depends>
262
  </abandonedsequence_enabled>
 
 
 
 
 
 
 
 
 
 
 
 
263
  <abandonedsequence_field translate="label comment">
264
  <label>Sequence Database Field</label>
265
  <frontend_type>select</frontend_type>
115
  <can_be_empty>1</can_be_empty>
116
  <comment>This is the List that emails will be subscribed to and is required</comment>
117
  </list>
118
+ <visible_lists translate="label comment">
119
+ <label>Additional Subscription Options</label>
120
+ <frontend_type>multiselect</frontend_type>
121
+ <source_model>campaigner/system_config_source_list</source_model>
122
+ <sort_order>62</sort_order>
123
+ <show_in_default>1</show_in_default>
124
+ <show_in_website>0</show_in_website>
125
+ <show_in_store>1</show_in_store>
126
+ <can_be_empty>1</can_be_empty>
127
+ <comment>Lists you select here will appear as options in your subscribers’ Newsletter Subscriptions area. This is not required; please note that the main list will always be shown.</comment>
128
+ </visible_lists>
129
  <store_send_type translate="label comment">
130
  <label>Store field to send</label>
131
  <frontend_type>select</frontend_type>
271
  <comment>This will allow you to assign a sequence of values to your subscribers, one for each abandoned cart.</comment>
272
  <depends><abandoned_enabled>1</abandoned_enabled></depends>
273
  </abandonedsequence_enabled>
274
+ <abandonedsequence_scope>
275
+ <label>Sequence scope</label>
276
+ <frontend_type>select</frontend_type>
277
+ <source_model>campaigner/system_config_source_sequence_scope</source_model>
278
+ <sort_order>375</sort_order>
279
+ <show_in_default>1</show_in_default>
280
+ <show_in_website>0</show_in_website>
281
+ <show_in_store>1</show_in_store>
282
+ <can_be_empty>1</can_be_empty>
283
+ <comment>Assign a sequence to each subscriber's abandoned carts, or spread the sequence out over abandoned carts for all subscribers.</comment>
284
+ <depends><abandoned_enabled>1</abandoned_enabled><abandonedsequence_enabled>1</abandonedsequence_enabled></depends>
285
+ </abandonedsequence_scope>
286
  <abandonedsequence_field translate="label comment">
287
  <label>Sequence Database Field</label>
288
  <frontend_type>select</frontend_type>
app/code/community/Campaigner/Integration/sql/campaigner_setup/mysql4-upgrade-1.0.1-1.0.2.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ try
8
+ {
9
+ $this->run("
10
+
11
+ ALTER TABLE {$this->getTable('campaigner/session')} ADD sequence INT(11) NOT NULL DEFAULT '0';
12
+
13
+ ");
14
+ }
15
+ catch (Exception $e)
16
+ {
17
+ $this->install_log($e->getMessage());
18
+ }
19
+
20
+ $installer->endSetup();
app/design/adminhtml/default/default/template/campaigner/abandoned/details.phtml CHANGED
@@ -12,4 +12,4 @@
12
  <script type="text/javascript">
13
  editForm = new varienForm('edit_form', '<?php echo $this->getValidationUrl() ?>');
14
  </script>
15
- <?php echo $this->getFormScripts() ?>
12
  <script type="text/javascript">
13
  editForm = new varienForm('edit_form', '<?php echo $this->getValidationUrl() ?>');
14
  </script>
15
+ <?php echo $this->getFormScripts() ?>
app/design/adminhtml/default/default/template/campaigner/abandoned/details/tab/cart.phtml CHANGED
@@ -6,7 +6,7 @@ $_qty = 0;
6
  ?>
7
  <div class="entry-edit">
8
  <div class="entry-edit-head">
9
- <h4 class="icon-head head-products">Cart Items</h4>
10
  </div>
11
  </div>
12
 
@@ -22,19 +22,19 @@ $_qty = 0;
22
  <col width="1">
23
  </colgroup><thead>
24
  <tr class="headings">
25
- <th>Product ID</th>
26
- <th>Product Name</span></th>
27
- <th>SKU</th>
28
- <th class="a-center">Qty</th>
29
- <th>Price</th>
30
- <th>Total</th>
31
  </tr>
32
  </thead>
33
  <tbody class="even">
34
-
35
  <?php
36
  foreach ($cart_items as $item): ?>
37
- <?php
38
  $_qty += $item->getQty();
39
  $_sub_total += $item->getPrice();
40
  $_total += $item->getRowTotal();
6
  ?>
7
  <div class="entry-edit">
8
  <div class="entry-edit-head">
9
+ <h4 class="icon-head head-products"><?php echo $this->__('Cart Items'); ?></h4>
10
  </div>
11
  </div>
12
 
22
  <col width="1">
23
  </colgroup><thead>
24
  <tr class="headings">
25
+ <th><?php echo $this->__('Product ID'); ?></th>
26
+ <th><?php echo $this->__('Product Name'); ?></span></th>
27
+ <th><?php echo $this->__('SKU'); ?></th>
28
+ <th class="a-center"><?php echo $this->__('Qty'); ?></th>
29
+ <th><?php echo $this->__('Price'); ?></th>
30
+ <th><?php echo $this->__('Total'); ?></th>
31
  </tr>
32
  </thead>
33
  <tbody class="even">
34
+
35
  <?php
36
  foreach ($cart_items as $item): ?>
37
+ <?php
38
  $_qty += $item->getQty();
39
  $_sub_total += $item->getPrice();
40
  $_total += $item->getRowTotal();
app/design/adminhtml/default/default/template/campaigner/abandoned/details/tab/diagnostics/status.phtml CHANGED
@@ -1,52 +1,47 @@
1
  <?php
2
 
3
- //$_order = $this->getOrder();
4
- //$_send_field = $this->getSendField();
5
  $_date_sent = $this->getCampaignerDate();
6
- //$_can_send_orders = $this->canSendOrders();
7
 
8
  $cart = Mage::helper('campaigner/diagnostic')->getAbandonedCart();
9
 
10
- //Zend_debug::dump($quote->getData());
11
-
12
  ?>
13
 
14
  <div class="box-left">
15
- <!--Diagnostic Information-->
16
- <div class="entry-edit">
17
- <div class="entry-edit-head">
18
- <h4 class="icon-head head-edit-form fieldset-legend">Campaigner Diagnostics for Abandoned Cart</h4>
19
- </div>
20
- <div class="fieldset">
21
- <table cellspacing="0" class="form-list">
22
- <tbody>
23
- <tr>
24
- <td class="label"><label>Sent to Campaigner</label></td>
25
- <td class="value"><strong>
26
- <?php if ($_date_sent == null): ?>
27
- <span style='color: red'>Not Sent</span>
28
- <?php else: ?>
29
- <span style='color: green'><?php echo $this->formatDate($_date_sent, 'medium', true); ?></span>
30
- <?php endif; ?>
31
- </strong></td>
32
- </tr>
33
- <tr>
34
- <td class="label"><label>Campaigner Status</label></td>
35
- <td class="value"><strong>
36
- <?php if (!$this->isCampaignerEnabled()): ?>
37
- <div style='color: red'>Disabled for this Store</div>
38
- <?php elseif (!$this->isCampaignerSetup()): ?>
39
- <div style='color: red'>Api Key Missing/Invalid</div>
40
- <?php else: ?>
41
- <div style='color: green'>Enabled</div>
42
- <?php if (1 == 0 || !$this->isAbandonedEnabled()): ?>
43
- <div style='color: red'>Abandoned Carts are disabled</div>
44
- <?php endif; ?>
45
- <?php endif; ?>
46
- </strong></td>
47
- </tr>
48
- </tbody>
49
- </table>
50
- </div>
51
- </div>
52
- </div>
1
  <?php
2
 
 
 
3
  $_date_sent = $this->getCampaignerDate();
 
4
 
5
  $cart = Mage::helper('campaigner/diagnostic')->getAbandonedCart();
6
 
 
 
7
  ?>
8
 
9
  <div class="box-left">
10
+ <!--Diagnostic Information-->
11
+ <div class="entry-edit">
12
+ <div class="entry-edit-head">
13
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Campaigner Diagnostics for Abandoned Cart') ?></h4>
14
+ </div>
15
+ <div class="fieldset">
16
+ <table cellspacing="0" class="form-list">
17
+ <tbody>
18
+ <tr>
19
+ <td class="label"><label><?php echo $this->__('Sent to Campaigner') ?></label></td>
20
+ <td class="value"><strong>
21
+ <?php if ($_date_sent == null): ?>
22
+ <span style='color: red'><?php echo $this->__('Not Sent') ?></span>
23
+ <?php else: ?>
24
+ <span style='color: green'><?php echo $this->formatDate($_date_sent, 'medium', true); ?></span>
25
+ <?php endif; ?>
26
+ </strong></td>
27
+ </tr>
28
+ <tr>
29
+ <td class="label"><label><?php echo $this->__('Campaigner Status') ?></label></td>
30
+ <td class="value"><strong>
31
+ <?php if (!$this->isCampaignerEnabled()): ?>
32
+ <div style='color: red'><?php echo $this->__('Disabled for this Store') ?></div>
33
+ <?php elseif (!$this->isCampaignerSetup()): ?>
34
+ <div style='color: red'><?php echo $this->__('Api Key Missing/Invalid') ?></div>
35
+ <?php else: ?>
36
+ <div style='color: green'><?php echo $this->__('Enabled') ?></div>
37
+ <?php if (1 == 0 || !$this->isAbandonedEnabled()): ?>
38
+ <div style='color: red'><?php echo $this->__('Abandoned Carts are disabled') ?></div>
39
+ <?php endif; ?>
40
+ <?php endif; ?>
41
+ </strong></td>
42
+ </tr>
43
+ </tbody>
44
+ </table>
45
+ </div>
46
+ </div>
47
+ </div>
app/design/adminhtml/default/default/template/campaigner/abandoned/status.phtml CHANGED
@@ -1,18 +1,18 @@
1
  <?php $status = $this->getAbandonedStatus(); ?>
2
 
3
  <table class='abandoned_status'>
4
- <tr>
5
- <th>Store</th>
6
- <th>Status</th>
7
- <th>Last Run</th>
8
- </tr>
9
- <?php foreach ($status['stores'] as $state): ?>
10
- <tr>
11
- <td><?php echo $state['name']; ?></td>
12
- <td><?php if ($state['enabled']): ?><span class='ab_ok'>Enabled</span><?php else: ?><span class='ab_ng'>Disabled</span><?php endif; ?></td>
13
- <td><?php echo $state['last_run']; ?></td>
14
- <td><?php if ($state['enabled']): ?><button onclick="setLocation('<?php echo $this->getUrl('*/*/run', array('store_id' => $state['id'])); ?>');"><span>Run Now</span></button><?php endif; ?></td>
15
- </tr>
16
- <?php endforeach; ?>
17
  </table>
18
  <br />
1
  <?php $status = $this->getAbandonedStatus(); ?>
2
 
3
  <table class='abandoned_status'>
4
+ <tr>
5
+ <th><?php echo $this->__('Store'); ?></th>
6
+ <th><?php echo $this->__('Status'); ?></th>
7
+ <th><?php echo $this->__('Last Run'); ?></th>
8
+ </tr>
9
+ <?php foreach ($status['stores'] as $state): ?>
10
+ <tr>
11
+ <td><?php echo $state['name']; ?></td>
12
+ <td><?php if ($state['enabled']): ?><span class='ab_ok'>Enabled</span><?php else: ?><span class='ab_ng'><?php echo $this->__('Disabled'); ?></span><?php endif; ?></td>
13
+ <td><?php echo $state['last_run']; ?></td>
14
+ <td><?php if ($state['enabled']): ?><button onclick="setLocation('<?php echo $this->getUrl('*/*/run', array('store_id' => $state['id'])); ?>');"><span><?php echo $this->__('Run Now'); ?></span></button><?php endif; ?></td>
15
+ </tr>
16
+ <?php endforeach; ?>
17
  </table>
18
  <br />
app/design/adminhtml/default/default/template/campaigner/latest/status.phtml CHANGED
@@ -1,18 +1,18 @@
1
  <?php $status = $this->getLatestStatus(); ?>
2
 
3
  <table class='abandoned_status'>
4
- <tr>
5
- <th>Store</th>
6
- <th>Status</th>
7
- <th>Last Run</th>
8
- </tr>
9
- <?php foreach ($status['stores'] as $state): ?>
10
- <tr>
11
- <td><?php echo $state['name']; ?></td>
12
- <td><?php if ($state['enabled']): ?><span class='ab_ok'>Enabled</span><?php else: ?><span class='ab_ng'>Disabled</span><?php endif; ?></td>
13
- <td><?php echo $state['last_run']; ?></td>
14
- <td><?php if ($state['enabled']): ?><button onclick="setLocation('<?php echo $this->getUrl('*/*/run', array('store_id' => $state['id'])); ?>');"><span>Run Now</span></button><?php endif; ?></td>
15
- </tr>
16
- <?php endforeach; ?>
17
  </table>
18
  <br />
1
  <?php $status = $this->getLatestStatus(); ?>
2
 
3
  <table class='abandoned_status'>
4
+ <tr>
5
+ <th><?php echo $this->__('Store'); ?></th>
6
+ <th><?php echo $this->__('Status'); ?></th>
7
+ <th><?php echo $this->__('Last Run'); ?></th>
8
+ </tr>
9
+ <?php foreach ($status['stores'] as $state): ?>
10
+ <tr>
11
+ <td><?php echo $state['name']; ?></td>
12
+ <td><?php if ($state['enabled']): ?><span class='ab_ok'>Enabled</span><?php else: ?><span class='ab_ng'><?php echo $this->__('Disabled'); ?></span><?php endif; ?></td>
13
+ <td><?php echo $state['last_run']; ?></td>
14
+ <td><?php if ($state['enabled']): ?><button onclick="setLocation('<?php echo $this->getUrl('*/*/run', array('store_id' => $state['id'])); ?>');"><span><?php echo $this->__('Run Now'); ?></span></button><?php endif; ?></td>
15
+ </tr>
16
+ <?php endforeach; ?>
17
  </table>
18
  <br />
app/design/adminhtml/default/default/template/campaigner/order/view/tab/diagnostics/status.phtml DELETED
@@ -1,78 +0,0 @@
1
- <?php
2
-
3
- $_order = $this->getOrder();
4
- $_send_field = $this->getSendField();
5
- $_date_sent = $this->getCampaignerDate();
6
- $_can_send_orders = $this->canSendOrders();
7
-
8
- ?>
9
-
10
- <div class="box-left">
11
- <!--Diagnostic Information-->
12
- <div class="entry-edit">
13
- <div class="entry-edit-head">
14
- <h4 class="icon-head head-edit-form fieldset-legend">Campaigner Diagnostics for <?php echo Mage::helper('sales')->__('Order # %s', $_order->getRealOrderId()) ?></h4>
15
- </div>
16
- <div class="fieldset">
17
- <table cellspacing="0" class="form-list">
18
- <tbody>
19
- <tr>
20
- <td class="label"><label>Sent to Campaigner</label></td>
21
- <td class="value"><strong>
22
- <?php if ($_date_sent == null): ?>
23
- <span style='color: red'>Not Sent</span>
24
- <?php else: ?>
25
- <span style='color: green'><?php echo $this->formatDate($_date_sent, 'medium', true); ?></span>
26
- <?php endif; ?>
27
- </strong></td>
28
- </tr>
29
- <?php if ($_send_field == 'status'): ?>
30
- <?php $send_status_list = $this->getStatusList(); ?>
31
- <tr>
32
- <td class="label"><label>Send on Status</label></td>
33
- <td class="value"><strong>
34
- <span id="send_on_status">
35
- <?php echo implode("<br />",$send_status_list); ?>
36
- </span></strong>
37
- </td>
38
- </tr>
39
- <tr>
40
- <td class="label"><label>Order Status</label></td>
41
- <td class="value"><strong><span id="order_status"><?php echo $_order->getStatusLabel() ?></span></strong></td>
42
- </tr>
43
- <?php else: ?>
44
- <?php $send_state_list = $this->getStateList(); ?>
45
- <tr>
46
- <td class="label"><label>Send on State</label></td>
47
- <td class="value"><strong>
48
- <span id="send_on_state">
49
- <?php echo implode("<br />",$send_state_list); ?>
50
- </span></strong>
51
- </td>
52
- </tr>
53
- <tr>
54
- <td class="label"><label>Order State</label></td>
55
- <td class="value"><strong><span id="order_state"><?php echo $this->getOrderState() ?></span></strong></td>
56
- </tr>
57
- <?php endif; ?>
58
-
59
- <tr>
60
- <td class="label"><label>Campaigner Status</label></td>
61
- <td class="value"><strong>
62
- <?php if (!$this->isCampaignerEnabled()): ?>
63
- <div style='color: red'>Disabled for this Store</div>
64
- <?php elseif (!$this->isCampaignerSetup()): ?>
65
- <div style='color: red'>Api Key Missing/Invalid</div>
66
- <?php else: ?>
67
- <div style='color: green'>Enabled</div>
68
- <?php if (!$this->isSendOrdersEnabled()): ?>
69
- <div style='color: red'>Sending orders is disabled</div>
70
- <?php endif; ?>
71
- <?php endif; ?>
72
- </strong></td>
73
- </tr>
74
- </tbody>
75
- </table>
76
- </div>
77
- </div>
78
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/campaigner/system/config/fieldset/hint.phtml CHANGED
@@ -7,19 +7,30 @@ $api_password = Mage::helper('campaigner')->config('api_password');
7
  $abandoned_status = Mage::helper('campaigner')->getAbandonedStatus();
8
  $ab_enabled = $this->getAbandonedEnabled();
9
  $last_run = $abandoned_status['cron_last_run'];
10
- $last_run_label = "Cron Last Run";
11
 
12
- $status_message = "Invalid API Username or Password";
13
 
14
  if ($locked) {
15
- $status_message = "Too many failed login attempts. Account is temporarily locked.";
16
  }
17
 
18
  ?>
19
  <div class="campaigner-notice">
20
  <h4>
21
  <?php if (!$this->isWebsiteConfig()): ?>
22
- <div class='abandoned'>Abandoned Cart Processing: <?php if ($ab_enabled) : ?><span class='ab_ok'>Enabled</span><?php else: ?><span class='ab_ng'>Disabled</span><?php endif; ?> - <?php echo $last_run_label ?>: <?php echo $abandoned_status['cron_last_run'] ?> - <button onclick="window.location='<?php echo $this->getUrl('campaigner_dashboard/admin_abandoned/index'); ?>'; return false;" id="campaigner_details">Details</button></div>
 
 
 
 
 
 
 
 
 
 
 
23
  <?php endif; ?>
24
  <strong>Campaigner Integration v<?php echo $this->getCampaignerVersion() ?><?php if (!$setup && strlen($api_username) > 0): ?> - <span class='ab_ng'><?php echo $status_message ?></span><?php endif; ?></strong>
25
  </h4>
7
  $abandoned_status = Mage::helper('campaigner')->getAbandonedStatus();
8
  $ab_enabled = $this->getAbandonedEnabled();
9
  $last_run = $abandoned_status['cron_last_run'];
10
+ $last_run_label = $this->__("Cron Last Run");
11
 
12
+ $status_message = $this->__("Invalid API Username or Password");
13
 
14
  if ($locked) {
15
+ $status_message = $this->__("Too many failed login attempts. Account is temporarily locked.");
16
  }
17
 
18
  ?>
19
  <div class="campaigner-notice">
20
  <h4>
21
  <?php if (!$this->isWebsiteConfig()): ?>
22
+ <div class='abandoned'>
23
+ <?php echo $this->__('Abandoned Cart Processing:') ?>
24
+ <?php if ($ab_enabled) : ?>
25
+ <span class='ab_ok'><?php echo $this->__('Enabled') ?></span>
26
+ <?php else: ?>
27
+ <span class='ab_ng'><?php echo $this->__('Disabled') ?></span>
28
+ <?php endif; ?>
29
+ - <?php echo $last_run_label ?>: <?php echo $abandoned_status['cron_last_run'] ?> -
30
+ <button onclick="window.location='<?php echo $this->getUrl('campaigner_dashboard/admin_abandoned/index'); ?>'; return false;" id="campaigner_details">
31
+ <?php echo $this->__('Details') ?>
32
+ </button>
33
+ </div>
34
  <?php endif; ?>
35
  <strong>Campaigner Integration v<?php echo $this->getCampaignerVersion() ?><?php if (!$setup && strlen($api_username) > 0): ?> - <span class='ab_ng'><?php echo $status_message ?></span><?php endif; ?></strong>
36
  </h4>
app/design/adminhtml/default/default/template/campaigner/troubleshooting/view/tab/help.phtml CHANGED
@@ -19,6 +19,8 @@ $shipping_fields = $this->getShippingFields();
19
  <p>The "Force Subscription" option should still work as it does not depend on interacting with your custom checkout. Please contact us if you require assistance integrating Campaigner with your custom checkout.</p>
20
  <h4>List</h4>
21
  <p>These are all of your Lists from within Campaigner. Choose which List you wish to subscribe your customers too. This is required to be able to email them from your Campaigner account.</p>
 
 
22
  <h4>Save Latest Order Information</h4>
23
  <p>Selecting Yes will update a subscribers record with detailed information for up to 3 products per order.</p>
24
  <p>For each product, the following fields will be sent:</p>
@@ -112,6 +114,10 @@ be used with Abandoned Carts.</p>
112
  <h3>Abandoned Cart Sequences</h3>
113
  <h4>Add a sequence value to each abandoned cart?</h4>
114
  <p>This will allow you to assign a sequence of values to your subscribers, one for each abandoned shopping cart. For every abandoned cart, the next value in the list will be applied and over write any past values that were assigned.</p>
 
 
 
 
115
  <h4>Sequence Database Field</h4>
116
  <p>This is the field within Campaigner that the sequence will be stored in.</p>
117
  <h4>Sequence Options</h4>
@@ -139,4 +145,52 @@ C<br />
139
  <p>To run Diagnostics on an order, go to the Order View page and select the <strong>Campaigner Diagnostics</strong> tab on the left side of the screen.</p>
140
  <h3>Abandoned Carts</h3>
141
  <p>To run Diagnostics on an abandoned cart, go to the <a href='<?php echo $this->getUrl('campaigner_dashboard/admin_abandoned/index') ?>'>Campaigner Abandoned Carts Page</a> and click on a row to run diagnostics on that cart.</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  </div>
19
  <p>The "Force Subscription" option should still work as it does not depend on interacting with your custom checkout. Please contact us if you require assistance integrating Campaigner with your custom checkout.</p>
20
  <h4>List</h4>
21
  <p>These are all of your Lists from within Campaigner. Choose which List you wish to subscribe your customers too. This is required to be able to email them from your Campaigner account.</p>
22
+ <h4>Additional Subscription Options</h4>
23
+ <p>Lists you select here will appear as options in your subscribers’ Newsletter Subscriptions area. This is not required; please note that the main list will always be shown.</p>
24
  <h4>Save Latest Order Information</h4>
25
  <p>Selecting Yes will update a subscribers record with detailed information for up to 3 products per order.</p>
26
  <p>For each product, the following fields will be sent:</p>
114
  <h3>Abandoned Cart Sequences</h3>
115
  <h4>Add a sequence value to each abandoned cart?</h4>
116
  <p>This will allow you to assign a sequence of values to your subscribers, one for each abandoned shopping cart. For every abandoned cart, the next value in the list will be applied and over write any past values that were assigned.</p>
117
+ <h4>Sequence scope</h4>
118
+ <p>Assign a sequence to each subscriber's abandoned carts, or spread the sequence out over abandoned carts for all subscribers.</p>
119
+ <p>The "Track sequence per subscriber" option will keep track of a separate sequence value for each subscriber.</p>
120
+ <p>The "Track sequence across all subscribers" option will cycle through one sequence for all subscribers.</p>
121
  <h4>Sequence Database Field</h4>
122
  <p>This is the field within Campaigner that the sequence will be stored in.</p>
123
  <h4>Sequence Options</h4>
145
  <p>To run Diagnostics on an order, go to the Order View page and select the <strong>Campaigner Diagnostics</strong> tab on the left side of the screen.</p>
146
  <h3>Abandoned Carts</h3>
147
  <p>To run Diagnostics on an abandoned cart, go to the <a href='<?php echo $this->getUrl('campaigner_dashboard/admin_abandoned/index') ?>'>Campaigner Abandoned Carts Page</a> and click on a row to run diagnostics on that cart.</p>
148
+ <h2><a name='uninstall'></a>Uninstall</h2>
149
+ <h3>Magento Connect Manager</h3>
150
+ <p>Only modules installed using the Magento Connect Manager can be uninstalled through the admin interface.</p>
151
+ <p>If the Campaigner Module does not appear in the list of installed modules, you must follow the instructions for a <a href="#manual_uninstall">Manual Uninstall</a> (see further below).</p>
152
+ <p class='note'><img src="<?php echo Mage::getDesign()->getSkinUrl('images/warning_msg_icon.gif') ?>" /> When using the Magento Connect Manager to uninstall a module, Magento only removes files that came with the original package that was used to install the module.</p>
153
+ <p>To fully uninstall the module, please follow the instructions for a <a href="#manual_uninstall">Manual Uninstall</a> (below).</p>
154
+ <h3><a name='manual_uninstall'></a>Manual Uninstall</h3>
155
+ <p></p>
156
+ <h4>Files</h4>
157
+ <p>The following files or folders must be deleted (in the order presented):</p>
158
+ <table class='campaigner_uninstall_files'><tr><th>Type</th><th>Location</th></tr>
159
+ <?php $files = $this->getUninstallFiles(); ?>
160
+ <?php foreach ($files as $file): ?>
161
+ <?php $base = Mage::getBaseDir($file['base']); ?>
162
+ <tr><td><?php echo $file['type'] ?></td><td><?php echo $base . DS . $file['location'] ?></td></tr>
163
+ <?php endforeach; ?>
164
+ </table>
165
+
166
+ <h4>Database</h4>
167
+ <p>The following database tables must be dropped:</p>
168
+ <table class='map_field_list'>
169
+ <tr>
170
+ <td>
171
+ <?php $database_tables = $this->getUninstallTables(); ?>
172
+ <?php foreach ($database_tables as $table): ?>
173
+ <?php echo $table ?><br />
174
+ <?php endforeach; ?>
175
+ </td>
176
+ </tr>
177
+ </table>
178
+ <p>To remove any configuration data:</p>
179
+ <table class='campaigner_uninstall_files'>
180
+ <tr><th>Table</th><th>Instructions</th></tr>
181
+ <tr>
182
+ <td><?php echo $this->getTableName('core/resource') ?></td><td>Delete the row where the code = "campaigner_setup".</td>
183
+ </tr>
184
+ <!--<tr>
185
+ <td> </td>
186
+ <td><strong>SQL Command:</strong> DELETE FROM `<?php echo $this->getTableName('core/resource') ?>` WHERE `code` = 'campaigner_setup'</td>
187
+ </tr>-->
188
+ <tr>
189
+ <td><?php echo $this->getTableName('core/config_data') ?></td><td>Delete any row where the path contains "campaigner".</td>
190
+ </tr>
191
+ <!--<tr>
192
+ <td> </td>
193
+ <td><strong>SQL Command:</strong> DELETE FROM `<?php echo $this->getTableName('core/config_data') ?>` WHERE `path` LIKE '%campaigner%'</td>
194
+ </tr>-->
195
+ </table>
196
  </div>
app/design/frontend/base/default/layout/campaigner.xml CHANGED
@@ -37,6 +37,7 @@
37
  <action method="setTemplate" ifconfig="campaigner/general/active">
38
  <template>campaigner/customer/account/dashboard/info.phtml</template>
39
  </action>
 
40
  </reference>
41
  </customer_account_index>
42
 
@@ -44,7 +45,9 @@
44
  <label>Customer My Account Campaigner</label>
45
  <update handle="customer_account"/>
46
  <reference name="my.account.wrapper">
47
- <block type="campaigner/customer_account_lists" name="campaigner_additionallists" template="campaigner/customer/account/lists.phtml" />
 
 
48
  <block type="customer/account_dashboard" name="customer.account.link.back" template="customer/account/link/back.phtml"/>
49
  </reference>
50
  </campaigner_customer_account_index>
37
  <action method="setTemplate" ifconfig="campaigner/general/active">
38
  <template>campaigner/customer/account/dashboard/info.phtml</template>
39
  </action>
40
+ <block type="core/template" name="campaigner_unsubscribed" template="campaigner/customer/account/unsubscribed.phtml" />
41
  </reference>
42
  </customer_account_index>
43
 
45
  <label>Customer My Account Campaigner</label>
46
  <update handle="customer_account"/>
47
  <reference name="my.account.wrapper">
48
+ <block type="core/template" name="campaigner_additionallists" template="campaigner/customer/account/lists.phtml">
49
+ <block type="core/template" name="campaigner_unsubscribed" template="campaigner/customer/account/unsubscribed.phtml" />
50
+ </block>
51
  <block type="customer/account_dashboard" name="customer.account.link.back" template="customer/account/link/back.phtml"/>
52
  </reference>
53
  </campaigner_customer_account_index>
app/design/frontend/base/default/template/campaigner/customer/account/dashboard/info.phtml CHANGED
@@ -1,7 +1,6 @@
1
  <?php
2
- $email = $this->helper('customer')->getCustomer()->getEmail();
3
- $subscriptions = Mage::helper('campaigner')->getSubscriptions($email);
4
- $status = strtolower($subscriptions['status']);
5
  ?>
6
 
7
  <div class="col2-set">
@@ -19,7 +18,12 @@ $status = strtolower($subscriptions['status']);
19
  </p>
20
  </div>
21
  <?php if ($status == 'hardbounce'): ?>
22
- <p class='camp_hardbounced'>We've been unable to reach you at <?php echo $this->htmlEscape($this->getCustomer()->getEmail()) ?>. Please <a href="<?php echo $this->getUrl('customer/account/edit') ?>"><?php echo $this->__('update') ?></a> your email address.</p>
 
 
 
 
 
23
  <?php endif; ?>
24
  </div>
25
  </div>
@@ -39,20 +43,23 @@ $status = strtolower($subscriptions['status']);
39
  }
40
  }
41
 
 
 
 
42
  if (count($lists) == 0) {
43
- echo "<p>" . $this->__('You are currently not subscribed to any newsletter.') . "</p>";
44
  } else {
45
  $plural = "";
46
  if (count($lists) > 1) {
47
  $plural = "s";
48
  }
49
- echo "<p>You are subscribed to the following newsletter{$plural}: " . implode(", ", $lists) . "</p>";
 
50
  }
51
  ?>
 
52
  </div>
53
- <?php if ($status == 'unsubscribed'): ?>
54
- <p class='camp_unsubscribed'>You have indicated that you no longer wish to receive newsletter emails. <a href="<?php echo Mage::getUrl('campaigner/customer_account/resubscribe') ?>">Click here</a> to begin receiving these emails again.</p>
55
- <?php endif; ?>
56
  </div>
57
  </div>
58
  <?php endif; ?>
1
  <?php
2
+ $subscriptions = Mage::helper('campaigner')->getSubscriptions();
3
+ $status = Mage::helper('campaigner')->getSubscriberStatus();
 
4
  ?>
5
 
6
  <div class="col2-set">
18
  </p>
19
  </div>
20
  <?php if ($status == 'hardbounce'): ?>
21
+ <p class='camp_hardbounced'>
22
+ <?php echo $this->__('We\'ve been unable to reach you at %s. Please <a href="%s">update</a> your email address.',
23
+ $this->htmlEscape($this->getCustomer()->getEmail()),
24
+ $this->getUrl('customer/account/edit')
25
+ ); ?>
26
+ </p>
27
  <?php endif; ?>
28
  </div>
29
  </div>
43
  }
44
  }
45
 
46
+ ?>
47
+ <p>
48
+ <?php
49
  if (count($lists) == 0) {
50
+ echo $this->__('You are currently not subscribed to any newsletter.');
51
  } else {
52
  $plural = "";
53
  if (count($lists) > 1) {
54
  $plural = "s";
55
  }
56
+ echo $this->__("You are subscribed to the following newsletter{$plural}: ");
57
+ echo implode(", ", $lists);
58
  }
59
  ?>
60
+ </p>
61
  </div>
62
+ <?php echo $this->getChildHtml('campaigner_unsubscribed'); ?>
 
 
63
  </div>
64
  </div>
65
  <?php endif; ?>
app/design/frontend/base/default/template/campaigner/customer/account/lists.phtml CHANGED
@@ -1,9 +1,7 @@
1
  <?php
2
 
3
- $subscriptions = $this->getSubscriptions();
4
- $status = strtolower($subscriptions['status']);
5
- //Zend_debug::dump($subscriptions);
6
-
7
 
8
  ?>
9
  <div class="page-title">
@@ -26,9 +24,7 @@ $status = strtolower($subscriptions['status']);
26
  <?php endforeach; ?>
27
  </ul>
28
 
29
- <?php if ($status == 'unsubscribed'): ?>
30
- <p class='camp_unsubscribed'>You have indicated that you no longer wish to receive newsletter emails. <a href="<?php echo Mage::getUrl('campaigner/customer_account/resubscribe') ?>">Click here</a> to begin receiving these emails again.</p>
31
- <?php endif; ?>
32
  </div>
33
  <div class="buttons-set">
34
  <button type="submit" title="<?php echo $this->__('Save') ?>" class="button"><span><span><?php echo $this->__('Save') ?></span></span></button>
1
  <?php
2
 
3
+ $subscriptions = Mage::helper('campaigner')->getSubscriptions();
4
+ $status = Mage::helper('campaigner')->getSubscriberStatus();
 
 
5
 
6
  ?>
7
  <div class="page-title">
24
  <?php endforeach; ?>
25
  </ul>
26
 
27
+ <?php echo $this->getChildHtml('campaigner_unsubscribed'); ?>
 
 
28
  </div>
29
  <div class="buttons-set">
30
  <button type="submit" title="<?php echo $this->__('Save') ?>" class="button"><span><span><?php echo $this->__('Save') ?></span></span></button>
app/design/frontend/base/default/template/campaigner/customer/account/unsubscribed.phtml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php $status = Mage::helper('campaigner')->getSubscriberStatus(); ?>
2
+ <?php if ($status == 'unsubscribed'): ?>
3
+ <p class='camp_unsubscribed'>
4
+ <?php echo $this->__('You have indicated that you no longer wish to receive newsletter emails. <a href="%s">Click here</a> to begin receiving these emails again.',
5
+ Mage::getUrl('campaigner/customer_account/resubscribe')
6
+ ); ?>
7
+ </p>
8
+ <?php endif; ?>
app/design/frontend/base/default/template/campaigner/signup/form.phtml CHANGED
@@ -11,46 +11,46 @@ var signup_delay = params.delay ? params.delay * 1000 : <?php echo $this->getSig
11
 
12
  function showSignup(data)
13
  {
14
- $('campaigner_signup_placeholder').update(data);
15
- $$('body')[0].addClassName('campaigner_signup_open');
16
- //$('campaigner_signup_background').show();
17
  }
18
 
19
  function closeSignup()
20
  {
21
- $$('body')[0].removeClassName('campaigner_signup_open');
22
- $('campaigner_signup_background').hide();
23
 
24
- if (!test_mode)
25
- {
26
- var CookieDate = new Date;
27
 
28
- var CurrentDate = Math.round(+new Date()/1000);
29
- CookieDate.setFullYear(CookieDate.getFullYear( ) + 5);
30
- Mage.Cookies.set('ed_signup', CurrentDate, CookieDate);
31
- }
32
 
33
- return false;
34
  }
35
 
36
  function showSignupCheck()
37
  {
38
- var url = '<?php echo $this->getSignupCheckUrl() ?>' + window.location.search;
39
- new Ajax.Request(url, {
40
- onSuccess: function(transport)
41
- {
42
- var json = transport.responseText.evalJSON();
43
-
44
- if (json.can_show == true)
45
- showSignup(json.html_content);
46
- }
47
- });
 
48
  }
49
 
50
  document.observe("dom:loaded", function()
51
  {
52
- if (signup_enabled || test_mode)
53
- window.setTimeout("showSignupCheck()",signup_delay);
 
54
  });
55
 
56
  </script>
11
 
12
  function showSignup(data)
13
  {
14
+ $('campaigner_signup_placeholder').update(data);
15
+ $$('body')[0].addClassName('campaigner_signup_open');
 
16
  }
17
 
18
  function closeSignup()
19
  {
20
+ $$('body')[0].removeClassName('campaigner_signup_open');
21
+ $('campaigner_signup_background').hide();
22
 
23
+ if (!test_mode) {
24
+ var CookieDate = new Date;
 
25
 
26
+ var CurrentDate = Math.round(+new Date()/1000);
27
+ CookieDate.setFullYear(CookieDate.getFullYear( ) + 5);
28
+ Mage.Cookies.set('ed_signup', CurrentDate, CookieDate);
29
+ }
30
 
31
+ return false;
32
  }
33
 
34
  function showSignupCheck()
35
  {
36
+ var url = '<?php echo $this->getSignupCheckUrl() ?>' + window.location.search;
37
+ new Ajax.Request(url, {
38
+ onSuccess: function(transport)
39
+ {
40
+ var json = transport.responseText.evalJSON();
41
+
42
+ if (json.can_show == true) {
43
+ showSignup(json.html_content);
44
+ }
45
+ }
46
+ });
47
  }
48
 
49
  document.observe("dom:loaded", function()
50
  {
51
+ if (signup_enabled || test_mode) {
52
+ window.setTimeout("showSignupCheck()",signup_delay);
53
+ }
54
  });
55
 
56
  </script>
app/locale/en_US/Campaigner_Integration.csv ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Abandoned Carts are disabled","Abandoned Carts are disabled"
2
+ "Abandoned Cart Processing:","Abandoned Cart Processing:"
3
+ "Api Key Missing/Invalid","Api Key Missing/Invalid"
4
+ "Campaigner Diagnostics for Abandoned Cart","Campaigner Diagnostics for Abandoned Cart"
5
+ "Campaigner Status","Campaigner Status"
6
+ "Cart Items","Cart Items"
7
+ "Change Password","Change Password"
8
+ "Contact Information","Contact Information"
9
+ "Cron Last Run","Cron Last Run"
10
+ "Details","Details"
11
+ "Disabled","Disabled"
12
+ "Disabled for this Store","Disabled for this Store"
13
+ "Edit","Edit"
14
+ "Enabled","Enabled"
15
+ "Invalid API Username or Password","Invalid API Username or Password"
16
+ "Last Run","Last Run"
17
+ "Newsletter Subscriptions","Newsletter Subscriptions"
18
+ "Newsletters","Newsletters"
19
+ "Not Sent","Not Sent"
20
+ "Price","Price"
21
+ "Product ID","Product ID"
22
+ "Product Name","Product Name"
23
+ "Qty","Qty"
24
+ "Run Now","Run Now"
25
+ "Save","Save"
26
+ "Sent to Campaigner","Sent to Campaigner"
27
+ "Sign Up for Newsletter","Sign Up for Newsletter"
28
+ "SKU","SKU"
29
+ "Status","Status"
30
+ "Store","Store"
31
+ "Too many failed login attempts. Account is temporarily locked.","Too many failed login attempts. Account is temporarily locked."
32
+ "Total","Total"
33
+ "We've been unable to reach you at %s. Please <a href=""%s"">update</a> your email address.","We've been unable to reach you at %s. Please <a href=""%s"">update</a> your email address."
34
+ "You are currently not subscribed to any newsletter.","You are currently not subscribed to any newsletter."
35
+ "You are subscribed to the following newsletter: ","You are subscribed to the following newsletter: "
36
+ "You are subscribed to the following newsletters: ","You are subscribed to the following newsletters: "
37
+ "You have indicated that you no longer wish to receive newsletter emails. <a href=""%s"">Click here</a> to begin receiving these emails again.","You have indicated that you no longer wish to receive newsletter emails. <a href=""%s"">Click here</a> to begin receiving these emails again."
package.xml CHANGED
@@ -1,18 +1,26 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Campaigner_Integration</name>
4
- <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license/>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Campaigner integration for Magento</summary>
10
  <description>Campaigner integration for Magento</description>
11
- <notes>Campaigner Integration for Magento</notes>
 
 
 
 
 
 
 
 
12
  <authors><author><name>Mark Cerullo</name><user>auto-converted</user><email>integrations@campaigner.com</email></author></authors>
13
- <date>2015-07-30</date>
14
- <time>19:45:46</time>
15
- <contents><target name="magecommunity"><dir name="Campaigner"><dir name="Integration"><dir name="Block"><dir name="Adminhtml"><dir name="Abandoned"><dir name="Details"><dir name="Tab"><dir name="Diagnostics"><file name="Status.php" hash="8a19e2e94944ca44fb36b1f1eea2c57e"/></dir><file name="Cart.php" hash="eeb38260b64b43d9d7ae59e27733b269"/><file name="Diagnostics.php" hash="e8fb26b980ead6d7ce9adaa0ccf391d2"/></dir><file name="Form.php" hash="59f4ae15758308ff52cd951d863f13ce"/></dir><file name="Details.php" hash="ccbce1ea6eb14476937df78c721cfba4"/><file name="Grid.php" hash="1155cba06b4d55f87461845e65f91e2c"/><file name="Status.php" hash="dd498f84c5f6beba1bfb465c5e5f9279"/><file name="Tabs.php" hash="ece0311585223168e00396c449e66c40"/></dir><dir name="Diagnostics"><dir name="Status"><file name="Abstract.php" hash="26a7456053abc173fbf8aaf3f68d7ab8"/></dir></dir><dir name="Latest"><file name="Grid.php" hash="fb6f191f0fd9d27f1550ff2caa75c229"/><file name="Status.php" hash="18c32fdc47887ea3231833ca6585362d"/></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="7d1f4659d72038a03281345bb7798ea1"/></dir><dir name="Form"><dir name="Field"><dir name="Signup"><file name="Test.php" hash="e4489f226eeef06c504b920847ff9593"/></dir><dir name="Smtp"><file name="Server.php" hash="3535455e2c04b70e9a52ef0bc9d00088"/><file name="Test.php" hash="933c8c06879a2e278b4757223fed1c53"/></dir><file name="Addressmapfields.php" hash="55c88d6e85ca0e73e54b842e0e7ab4ba"/><file name="Api.php" hash="549b18aaf277a7ae46408865f195ee81"/><file name="Common.php" hash="c421a4ca9e6bc2c1c64429f3640cc427"/><file name="Diagnostics.php" hash="05bdb6a63bc4742432af8dfb0ffd0a2a"/><file name="Info.php" hash="525c685749a05461e33f3f0df4f146c7"/><file name="Logging.php" hash="183cd28a3156a024455fd854730c859e"/><file name="Mapfields.php" hash="80c79d853273c16e3be073a18c2ec011"/><file name="Note.php" hash="7ba64e042e476f4b8ca6741f3880df23"/><file name="Shippingmapfields.php" hash="741d75b6e332151dba21befccd95ddc7"/><file name="Smtp.php" hash="93eabbd4c24a4001bb5808e51e9d43a0"/></dir></dir></dir></dir><dir name="Troubleshooting"><dir name="View"><dir name="Tab"><file name="Download.php" hash="8d47397381bc8286c22188c2f6e015e3"/><file name="Help.php" hash="192fd3cb04b720506a2d9ac89f267b6a"/><file name="Info.php" hash="6ce83e41898da9792868bc42e889a429"/><file name="Log.php" hash="a9281138b7791a6a4e5ad2a35623a61d"/><file name="Settings.php" hash="bd0b189a1b1cc313ed0bb96b869a04f8"/><file name="Submit.php" hash="7f5481630cd9f115aa801d16314b8edf"/></dir><file name="Form.php" hash="0809b7e09e2a932bab3f2c85e95516da"/></dir><file name="Status.php" hash="5032e69d110bc15a20ddabd492a2c9e3"/><file name="Tabs.php" hash="08299230ebb95078adf10bd9242b42cc"/><file name="View.php" hash="4e045d938bdddfd5af9917db56f2c8df"/></dir><file name="Abandoned.php" hash="a7d349903733493af5cd3713bad1ec70"/><file name="Latest.php" hash="48e49078842a436c7ce662f5ea745020"/></dir><dir name="Checkout"><file name="Subscribe.php" hash="2d31ac46504200508ffb142e35acb0b9"/></dir><dir name="Customer"><dir name="Account"><file name="Lists.php" hash="d3bdd16652fdf1021ab0045a6a9ac226"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><dir name="Abandoned"><file name="Minutes.php" hash="67c46d39f2824b0288974b6927a98dac"/></dir><file name="Action.php" hash="a8454d2d40609f2de12bdbc0a9f3a551"/></dir></dir></dir></dir><file name="Capture.php" hash="e2f1e84334b5e63fbac13399f76be136"/><file name="Signup.php" hash="3cfb414ed7fc6d6b866d38b296fad7cc"/></dir><dir name="Controller"><dir name="Front"><file name="Abstract.php" hash="1ec0fbe702b70b33cf21097f2472f165"/></dir></dir><dir name="Helper"><file name="Abandoned.php" hash="df7d7ffa97e4f69e9797fdefa18193cf"/><file name="Data.php" hash="f5f8f70143d2a1a4c714451125d4dbbc"/><file name="Diagnostic.php" hash="0382ce6337fc845fb099ff79507a64ef"/><file name="Email.php" hash="b23abe06562ae3bfc02093d56ea61807"/><file name="Fields.php" hash="059e0fda027abed6de66e3b039fc191b"/><file name="Order.php" hash="f58695b30fab463a5671bf79f596a149"/><file name="Troubleshooting.php" hash="48915a6a5b68c1b5d60a617e7b4cab8f"/></dir><dir name="Model"><dir name="Abandoned"><file name="Observer.php" hash="d5c951889ce943bb5b2a45d7d1f3fc3c"/></dir><dir name="Action"><file name="List.php" hash="ba8f9239b1c3aba92a870aec4c5e5fd3"/><file name="Observer.php" hash="3d74517e8d5548e06fc669634951b285"/></dir><dir name="Configuration"><file name="Observer.php" hash="582bd07b69dbee600036dbae40b1d5a1"/></dir><dir name="Customer"><file name="Observer.php" hash="f2810c6b274a23f3769c4f42e52454aa"/></dir><dir name="Email"><file name="Queue.php" hash="a755044d7d354ac2d3c31dba230eb005"/><file name="Template.php" hash="26096ed08f0339b836938abd7ecec2c5"/></dir><dir name="Latest"><file name="Order.php" hash="15cff0518a0e053bffaa2d8f6113778a"/></dir><dir name="Mysql4"><dir name="Abandoned"><file name="Collection.php" hash="4f984cd418b4a763967844657a554fd0"/></dir><dir name="Action"><dir name="List"><file name="Collection.php" hash="b901ec897893ace7b3a47b7ce63d1825"/></dir><file name="List.php" hash="d31fdb94086b8c2feca37384af08ae7a"/></dir><dir name="Latest"><dir name="Order"><file name="Collection.php" hash="487eab71efa04552566a1260012a5845"/></dir><file name="Order.php" hash="1b25cfbe2923690187bed3a982968d07"/></dir><dir name="Order"><file name="Collection.php" hash="f751237abc91e49544a473bdf2a5e35d"/></dir><dir name="Session"><file name="Collection.php" hash="629816a4bf1be669d1ed677744357f61"/></dir><file name="Abandoned.php" hash="cd4ca2dbc8f0758a3835a4b870fedcaa"/><file name="Order.php" hash="5bac34cb7dc1d4d2db838894438034fd"/><file name="Session.php" hash="123ec994fcc5b697ceacd370fe52a8af"/></dir><dir name="Newsletter"><file name="Observer.php" hash="d143215522958d1d4cdd4800cf49b224"/></dir><dir name="Observer"><file name="Abstract.php" hash="9ac37b03684b20cddcfd97b6a6f3170b"/></dir><dir name="Order"><file name="Observer.php" hash="0f566abaad6dc86719c75a0b2322b8dc"/></dir><dir name="Resource"><file name="Setup.php" hash="952230e5b0632c3441c20bbfc386ec4f"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Send"><file name="Field.php" hash="e4ea62f64f043668f00eb627837cc6d4"/></dir><dir name="Signup"><file name="Opacity.php" hash="bd3370611c9551efd53d84565e5cb234"/><file name="Recurrence.php" hash="aa42d1124016892bad804a43dbe0138e"/></dir><dir name="Smtp"><file name="Encryption.php" hash="5447e71037ae34960fff66479d7152c1"/></dir><file name="Abandonedlist.php" hash="64f11bdc40e02d614bb1282c6fb762b8"/><file name="Additionallist.php" hash="84454d9fd80e411efc8540d9dcb51888"/><file name="Checkoutsubscribe.php" hash="c4f2e403652fb6438ec993af3ba0c7b9"/><file name="List.php" hash="6c9784a917109e7b6812b147ffba733e"/><file name="Sequence.php" hash="fa9177180ccb4b91f3c16cbffe9d745d"/><file name="States.php" hash="b3bc4e2c3ee3caac578909b85962bf3d"/><file name="Statuses.php" hash="6cd4cd287608cd0ed30088ded5ee5c42"/><file name="Store.php" hash="e0a4863f576e202e66b6fe4bd1ddc12c"/><file name="Time.php" hash="3c402071ddd3dd01bd49717fe5d5016e"/></dir></dir></dir><dir name="Wrapper"><file name="Abandoned.php" hash="9fbd98b3d5150ba55d1bb5bd2a071c53"/><file name="Abstract.php" hash="0748d215889a2dfda1a164237ff01905"/><file name="Database.php" hash="164de5c78c9912225afed7192a1a3f7c"/><file name="Exception.php" hash="7e2f930f4106b5d91e595dcac75f6c62"/><file name="Execute.php" hash="f30674355173dd9dd27a69dada96ed61"/><file name="Lists.php" hash="38f8e6989bd6cba51e1f2a41b9529042"/><file name="Orders.php" hash="d741e48adf06eecbe76f92c342ce8cca"/><file name="Subscribers.php" hash="c1111e5b118b31e996564b696ea4d3c1"/><file name="Wishlist.php" hash="8139aaef7923f7e9313a85d7ecaed853"/></dir><file name="Abandoned.php" hash="3121570ce6e5faf0fcc7aeea98ffa562"/><file name="Observer.php" hash="8e69e0fe1d659a5413ac578dc72299ad"/><file name="Order.php" hash="9a66161a19226a724ebdaa0df847b847"/><file name="Session.php" hash="04606a68e8f07b19130dcca442bc3d57"/></dir><dir name="controllers"><dir name="Admin"><file name="AbandonedController.php" hash="5cd81b84fce7de2c486de200e5089d7d"/><file name="DiagnosticController.php" hash="bd40fae2dca04a935d1cac9dc3928c6c"/><file name="LatestController.php" hash="9e10c7a6273a6f0855233af85e2131c7"/><file name="TroubleshootingController.php" hash="696734e8d61cb6017e7c197767ca321b"/></dir><dir name="Customer"><file name="AccountController.php" hash="fd758fc7bf3885c6fb18898b1d8c23fe"/></dir><file name="AbandonedController.php" hash="115d5d946e3eb5f917f9e9066b54cd45"/><file name="CaptureController.php" hash="f4b3dbd7fed2ba835679a465999b6e8d"/><file name="SignupController.php" hash="9f22f1599ec5ca4159dca1f5597dc5b8"/></dir><dir name="etc"><file name="adminhtml.xml" hash="622748d98d7492dd22da1c290706b60c"/><file name="config.xml" hash="c3f586eb990d956fcac7b24874af8e86"/><file name="system.xml" hash="e028bf7ebbef652238fe455076c74a11"/></dir><dir name="sql"><dir name="campaigner_setup"><file name="mysql4-install-1.0.0.php" hash="80c1aae7aa0da201429e58f2990128c6"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="campaigner"><file name="campaigner-tab.png" hash="181849ccef5e616db6aae38a229a759a"/><file name="campaigner.css" hash="5d8ca056b8b65b04c90d7b6f4596f974"/><file name="logo.png" hash="d73185d0f531abdfb30c95b1305e9c3b"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="campaigner"><dir name="images"><file name="window_close.png" hash="3af14f053f360bf31f8ba2df73ec7f1e"/></dir><file name="campaigner.css" hash="57204bebe8e822a80be8ede51d0c0491"/><file name="integration.js" hash="027627a14bfe078ef56c34202d5c9a19"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="campaigner.xml" hash="0a6c410360dd033e295921873e539bb4"/></dir><dir name="template"><dir name="campaigner"><dir name="abandoned"><dir name="details"><dir name="tab"><dir name="diagnostics"><file name="status.phtml" hash="63544ef7009149845d4340dbbcea718e"/></dir><file name="cart.phtml" hash="be7ca2b147fc836c2ca547b290ffe841"/></dir><file name="form.phtml" hash="60633d212382770e99d11d24ae919e47"/></dir><file name="details.phtml" hash="9d467b97a2d773aec950bea7061c6730"/><file name="status.phtml" hash="9e7723dc1fe5f8693345db9cc7cda808"/></dir><dir name="latest"><file name="status.phtml" hash="ca4d0d10d06ba2d26e58720b6e7b6638"/></dir><dir name="order"><dir name="view"><dir name="tab"><dir name="diagnostics"><file name="status.phtml" hash="dbc795e2c4ae8ca1201a91b579a5974a"/></dir></dir></dir></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="35e9887ecb401021fc2927c6d8cb25f6"/></dir><dir name="form"><dir name="field"><dir name="export"><file name="date_range.phtml" hash="746bf1adb96eb46b4d43f9f4a39c2040"/><file name="orders.phtml" hash="6264bb43770229c38ce12e57886b4787"/><file name="products.phtml" hash="92deede7e13c573897b84262bb55e16d"/></dir><dir name="signup"><file name="test.phtml" hash="a9921c7483bbaf56c0bf98e41a672e1e"/></dir><dir name="smtp"><file name="test.phtml" hash="b5ed32a1e695c6fdf011dc6e1b5801fd"/></dir><file name="api.phtml" hash="8f406515a32962902a055554ac313261"/><file name="array.phtml" hash="082111176e5dac1d0e1f1eec1b1fc5d4"/><file name="diagnostics.phtml" hash="a6e51e54eade038052caa12542a1b163"/><file name="info.phtml" hash="9d3d76056542cb7ecdbbc03551cea432"/><file name="logging.phtml" hash="eafec906a6f3d67b48e138009b0134bb"/><file name="note.phtml" hash="8df6563e1e33c8047d3c399dbe43d476"/><file name="smtp.phtml" hash="0c3151b4d7f34d6cf96f9fd2bfe210fd"/></dir></dir><file name="setup_check.phtml" hash="74f11286e25cea96fdb87642b96d62ec"/></dir><dir name="convert"><dir name="profile"><file name="export.phtml" hash="c0cc0401d8a4b4cda36b3f28d09c98a8"/></dir></dir></dir><dir name="troubleshooting"><dir name="view"><dir name="tab"><file name="download.phtml" hash="72265504ae19264e31b3e0f5814b219b"/><file name="help.phtml" hash="18ca526a072679d938ff46cd14259a59"/><file name="info.phtml" hash="53d09908246eade525571ef809e40735"/><file name="log.phtml" hash="db325e68b0584162fa3c2c082a029421"/><file name="settings.phtml" hash="218160085bc1745971cb80216704816e"/><file name="submit.phtml" hash="650f228e6be47ed72a8dfd636fb85512"/></dir><file name="form.phtml" hash="d2338bfe3598e9315ca8f5ac8d9b5516"/></dir><file name="status.phtml" hash="2a11a1c817fdcc7ea8c402583a85bbf4"/><file name="view.phtml" hash="6ddfc8c6efe25d30e63f792b19a95c84"/></dir><file name="diagnostics.phtml" hash="ca3b12f1caf598a0006c7a17bc78ea18"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="campaigner.xml" hash="7d17fb72b199bfdededeeecca30df661"/></dir><dir name="template"><dir name="campaigner"><dir name="capture"><file name="email.phtml" hash="fa273ff1a48a12eb386f58f3e3e78f66"/></dir><dir name="checkout"><file name="subscribe.phtml" hash="fd0671d9d8186d7c93e2c2eb5dbffaeb"/></dir><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="6352daad22255345cc240a1806e04842"/></dir><file name="lists.phtml" hash="43045ece917bf50ae68bb60d40b7f867"/></dir></dir><dir name="signup"><file name="form.phtml" hash="d85e1fe515ad261609ea464c4715c1db"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="newsletter_subscr_success_campaigner.html" hash="f6afb69d207bbc3f8920e7a72ac9dd07"/><file name="newsletter_unsub_success_campaigner.html" hash="bd9f97e8f5485180d4420097b5200ef4"/><file name="campaigner_relay_test.html" hash="3e01c93e616154068ea4b841802acf2f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Campaigner_Integration.xml" hash="d7311dea93c926305f8ed67be1c1fc12"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Campaigner_Integration</name>
4
+ <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license/>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Campaigner integration for Magento</summary>
10
  <description>Campaigner integration for Magento</description>
11
+ <notes>Tailor the subscription management experience: Provide your Magento customers with specific subscription management options by selecting which Campaigner mailing lists they can sign up for or opt out of when they visit the newsletter subscription area in their Magento account. Please note that regardless of which lists you choose to expose, your main list will always appear in the newsletter subscription area.&#xD;
12
+ &#xD;
13
+ Track abandon behavior by contact or across all contacts: Share abandoned cart sequences across all contacts to capture a broad sample of abandons for a special promotion you plan to send to a subset of contacts, or track the sequence per-contact to trigger personalized, automated follow-up messages in Campaigner.&#xD;
14
+ &#xD;
15
+ Permissions updated to allow access to admin pages for specific roles.&#xD;
16
+ &#xD;
17
+ Improved custom field support.&#xD;
18
+ &#xD;
19
+ Added additional uninstall instructions.</notes>
20
  <authors><author><name>Mark Cerullo</name><user>auto-converted</user><email>integrations@campaigner.com</email></author></authors>
21
+ <date>2015-10-07</date>
22
+ <time>16:22:48</time>
23
+ <contents><target name="magecommunity"><dir name="Campaigner"><dir name="Integration"><dir name="Block"><dir name="Adminhtml"><dir name="Abandoned"><dir name="Details"><dir name="Tab"><dir name="Diagnostics"><file name="Status.php" hash="8a19e2e94944ca44fb36b1f1eea2c57e"/></dir><file name="Cart.php" hash="eeb38260b64b43d9d7ae59e27733b269"/><file name="Diagnostics.php" hash="e8fb26b980ead6d7ce9adaa0ccf391d2"/></dir><file name="Form.php" hash="59f4ae15758308ff52cd951d863f13ce"/></dir><file name="Details.php" hash="ccbce1ea6eb14476937df78c721cfba4"/><file name="Grid.php" hash="1155cba06b4d55f87461845e65f91e2c"/><file name="Status.php" hash="dd498f84c5f6beba1bfb465c5e5f9279"/><file name="Tabs.php" hash="ece0311585223168e00396c449e66c40"/></dir><dir name="Diagnostics"><dir name="Status"><file name="Abstract.php" hash="26a7456053abc173fbf8aaf3f68d7ab8"/></dir></dir><dir name="Latest"><file name="Grid.php" hash="fb6f191f0fd9d27f1550ff2caa75c229"/><file name="Status.php" hash="18c32fdc47887ea3231833ca6585362d"/></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="7d1f4659d72038a03281345bb7798ea1"/></dir><dir name="Form"><dir name="Field"><dir name="Signup"><file name="Test.php" hash="e4489f226eeef06c504b920847ff9593"/></dir><dir name="Smtp"><file name="Server.php" hash="3535455e2c04b70e9a52ef0bc9d00088"/><file name="Test.php" hash="933c8c06879a2e278b4757223fed1c53"/></dir><file name="Addressmapfields.php" hash="55c88d6e85ca0e73e54b842e0e7ab4ba"/><file name="Api.php" hash="549b18aaf277a7ae46408865f195ee81"/><file name="Common.php" hash="c421a4ca9e6bc2c1c64429f3640cc427"/><file name="Diagnostics.php" hash="05bdb6a63bc4742432af8dfb0ffd0a2a"/><file name="Info.php" hash="525c685749a05461e33f3f0df4f146c7"/><file name="Logging.php" hash="183cd28a3156a024455fd854730c859e"/><file name="Mapfields.php" hash="80c79d853273c16e3be073a18c2ec011"/><file name="Note.php" hash="7ba64e042e476f4b8ca6741f3880df23"/><file name="Shippingmapfields.php" hash="741d75b6e332151dba21befccd95ddc7"/><file name="Smtp.php" hash="93eabbd4c24a4001bb5808e51e9d43a0"/></dir></dir></dir></dir><dir name="Troubleshooting"><dir name="View"><dir name="Tab"><file name="Download.php" hash="8d47397381bc8286c22188c2f6e015e3"/><file name="Help.php" hash="90ec5834c9c198518bbab0536d60d945"/><file name="Info.php" hash="6ce83e41898da9792868bc42e889a429"/><file name="Log.php" hash="a9281138b7791a6a4e5ad2a35623a61d"/><file name="Settings.php" hash="bd0b189a1b1cc313ed0bb96b869a04f8"/><file name="Submit.php" hash="7f5481630cd9f115aa801d16314b8edf"/></dir><file name="Form.php" hash="0809b7e09e2a932bab3f2c85e95516da"/></dir><file name="Status.php" hash="5032e69d110bc15a20ddabd492a2c9e3"/><file name="Tabs.php" hash="08299230ebb95078adf10bd9242b42cc"/><file name="View.php" hash="4e045d938bdddfd5af9917db56f2c8df"/></dir><file name="Abandoned.php" hash="a7d349903733493af5cd3713bad1ec70"/><file name="Latest.php" hash="48e49078842a436c7ce662f5ea745020"/></dir><dir name="Checkout"><file name="Subscribe.php" hash="2d31ac46504200508ffb142e35acb0b9"/></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><dir name="Abandoned"><file name="Minutes.php" hash="67c46d39f2824b0288974b6927a98dac"/></dir><file name="Action.php" hash="a8454d2d40609f2de12bdbc0a9f3a551"/></dir></dir></dir></dir><file name="Capture.php" hash="e2f1e84334b5e63fbac13399f76be136"/><file name="Signup.php" hash="3cfb414ed7fc6d6b866d38b296fad7cc"/></dir><dir name="Controller"><dir name="Front"><file name="Abstract.php" hash="1ec0fbe702b70b33cf21097f2472f165"/></dir></dir><dir name="Helper"><file name="Abandoned.php" hash="e05cf79f7862f6e22c675737e97e8474"/><file name="Data.php" hash="52d9de4457d78d89094be8e34cd2a31b"/><file name="Diagnostic.php" hash="0382ce6337fc845fb099ff79507a64ef"/><file name="Email.php" hash="b23abe06562ae3bfc02093d56ea61807"/><file name="Fields.php" hash="87e4067a0bf8091593af31f6978e704d"/><file name="Order.php" hash="822946957285c469a70c1a48c143abee"/><file name="Troubleshooting.php" hash="48915a6a5b68c1b5d60a617e7b4cab8f"/></dir><dir name="Model"><dir name="Abandoned"><file name="Observer.php" hash="582d143f0c57d80f17c82c8312860d94"/></dir><dir name="Action"><file name="List.php" hash="ba8f9239b1c3aba92a870aec4c5e5fd3"/><file name="Observer.php" hash="3d74517e8d5548e06fc669634951b285"/></dir><dir name="Configuration"><file name="Observer.php" hash="71d2841a4f68c3f344e73bd69bf5b363"/></dir><dir name="Customer"><file name="Observer.php" hash="f49389ad3ba057dad9b11e79c28ba88b"/></dir><dir name="Email"><file name="Queue.php" hash="a755044d7d354ac2d3c31dba230eb005"/><file name="Template.php" hash="26096ed08f0339b836938abd7ecec2c5"/></dir><dir name="Latest"><file name="Order.php" hash="15cff0518a0e053bffaa2d8f6113778a"/></dir><dir name="Mysql4"><dir name="Abandoned"><file name="Collection.php" hash="3f68e0ebf3ca9293473ed52551834a0f"/></dir><dir name="Action"><dir name="List"><file name="Collection.php" hash="b901ec897893ace7b3a47b7ce63d1825"/></dir><file name="List.php" hash="d31fdb94086b8c2feca37384af08ae7a"/></dir><dir name="Latest"><dir name="Order"><file name="Collection.php" hash="487eab71efa04552566a1260012a5845"/></dir><file name="Order.php" hash="1b25cfbe2923690187bed3a982968d07"/></dir><dir name="Order"><file name="Collection.php" hash="f751237abc91e49544a473bdf2a5e35d"/></dir><dir name="Session"><file name="Collection.php" hash="629816a4bf1be669d1ed677744357f61"/></dir><file name="Abandoned.php" hash="cd4ca2dbc8f0758a3835a4b870fedcaa"/><file name="Order.php" hash="5bac34cb7dc1d4d2db838894438034fd"/><file name="Session.php" hash="cafb42130e54bea5461e0f709bb09214"/></dir><dir name="Newsletter"><file name="Observer.php" hash="d143215522958d1d4cdd4800cf49b224"/></dir><dir name="Observer"><file name="Abstract.php" hash="9ac37b03684b20cddcfd97b6a6f3170b"/></dir><dir name="Order"><file name="Observer.php" hash="0f566abaad6dc86719c75a0b2322b8dc"/></dir><dir name="Resource"><file name="Setup.php" hash="952230e5b0632c3441c20bbfc386ec4f"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Send"><file name="Field.php" hash="e4ea62f64f043668f00eb627837cc6d4"/></dir><dir name="Sequence"><file name="Scope.php" hash="bcf820524f3a9ce5a62569767c8248e3"/></dir><dir name="Signup"><file name="Opacity.php" hash="bd3370611c9551efd53d84565e5cb234"/><file name="Recurrence.php" hash="aa42d1124016892bad804a43dbe0138e"/></dir><dir name="Smtp"><file name="Encryption.php" hash="5447e71037ae34960fff66479d7152c1"/></dir><file name="Abandonedlist.php" hash="64f11bdc40e02d614bb1282c6fb762b8"/><file name="Additionallist.php" hash="84454d9fd80e411efc8540d9dcb51888"/><file name="Checkoutsubscribe.php" hash="c4f2e403652fb6438ec993af3ba0c7b9"/><file name="List.php" hash="6c9784a917109e7b6812b147ffba733e"/><file name="Sequence.php" hash="705c04c54e730c5feadad07d7a01e050"/><file name="States.php" hash="b3bc4e2c3ee3caac578909b85962bf3d"/><file name="Statuses.php" hash="6cd4cd287608cd0ed30088ded5ee5c42"/><file name="Store.php" hash="e0a4863f576e202e66b6fe4bd1ddc12c"/><file name="Time.php" hash="3c402071ddd3dd01bd49717fe5d5016e"/></dir></dir></dir><dir name="Wrapper"><file name="Abandoned.php" hash="9fbd98b3d5150ba55d1bb5bd2a071c53"/><file name="Abstract.php" hash="0748d215889a2dfda1a164237ff01905"/><file name="Database.php" hash="164de5c78c9912225afed7192a1a3f7c"/><file name="Exception.php" hash="7e2f930f4106b5d91e595dcac75f6c62"/><file name="Execute.php" hash="f30674355173dd9dd27a69dada96ed61"/><file name="Lists.php" hash="38f8e6989bd6cba51e1f2a41b9529042"/><file name="Orders.php" hash="d741e48adf06eecbe76f92c342ce8cca"/><file name="Subscribers.php" hash="ef30903cc31ce2e0e75c7d1219afa124"/><file name="Wishlist.php" hash="8139aaef7923f7e9313a85d7ecaed853"/></dir><file name="Abandoned.php" hash="3121570ce6e5faf0fcc7aeea98ffa562"/><file name="Observer.php" hash="8e69e0fe1d659a5413ac578dc72299ad"/><file name="Order.php" hash="9a66161a19226a724ebdaa0df847b847"/><file name="Session.php" hash="f25cc2990b4baca8a1265165938f3592"/></dir><dir name="controllers"><dir name="Admin"><file name="AbandonedController.php" hash="f04a9d6af44e95d6dfbcef01c1529142"/><file name="DiagnosticController.php" hash="4f9a5b21d482a9e717887dbccb4bc113"/><file name="LatestController.php" hash="2342b1ecd3003e2340281ad391b5dad3"/><file name="TroubleshootingController.php" hash="be5d0064879d8aa639dbb783feede0a6"/></dir><dir name="Customer"><file name="AccountController.php" hash="948146143dad1495cf5770d5b26df5e5"/></dir><file name="AbandonedController.php" hash="348d8e52d4d439695ecb35c3707345f9"/><file name="CaptureController.php" hash="f4b3dbd7fed2ba835679a465999b6e8d"/><file name="SignupController.php" hash="9f22f1599ec5ca4159dca1f5597dc5b8"/></dir><dir name="etc"><file name="adminhtml.xml" hash="68e19d887bf7ca5641222a68fbd6c8dd"/><file name="config.xml" hash="6c40e0024dd443032312a4e8a8ad948c"/><file name="system.xml" hash="c02822a1f889fdaae5b63a4404da6803"/></dir><dir name="sql"><dir name="campaigner_setup"><file name="mysql4-install-1.0.0.php" hash="80c1aae7aa0da201429e58f2990128c6"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="65b76f1e85f2ab9f4b17f985fc7be0b8"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="campaigner"><file name="campaigner-tab.png" hash="181849ccef5e616db6aae38a229a759a"/><file name="campaigner.css" hash="84bd6e6afaa0f225faf403046416a5f8"/><file name="logo.png" hash="d73185d0f531abdfb30c95b1305e9c3b"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="campaigner"><dir name="images"><file name="window_close.png" hash="3af14f053f360bf31f8ba2df73ec7f1e"/></dir><file name="campaigner.css" hash="57204bebe8e822a80be8ede51d0c0491"/><file name="integration.js" hash="027627a14bfe078ef56c34202d5c9a19"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="campaigner.xml" hash="0a6c410360dd033e295921873e539bb4"/></dir><dir name="template"><dir name="campaigner"><dir name="abandoned"><dir name="details"><dir name="tab"><dir name="diagnostics"><file name="status.phtml" hash="89eb5aeb29d09d7cc31f33c8d0d9573a"/></dir><file name="cart.phtml" hash="e826e27563af99f9217477b59208853a"/></dir><file name="form.phtml" hash="60633d212382770e99d11d24ae919e47"/></dir><file name="details.phtml" hash="a0569efc165c9435e53c036d468d05ca"/><file name="status.phtml" hash="cfe2fa838e1c68522fa018a17db1c5c2"/></dir><dir name="latest"><file name="status.phtml" hash="3a322cbe915c3252e69ed2e6b1e39a42"/></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="313fedffa1c7c9079ea4f09387e58eef"/></dir><dir name="form"><dir name="field"><dir name="export"><file name="date_range.phtml" hash="746bf1adb96eb46b4d43f9f4a39c2040"/><file name="orders.phtml" hash="6264bb43770229c38ce12e57886b4787"/><file name="products.phtml" hash="92deede7e13c573897b84262bb55e16d"/></dir><dir name="signup"><file name="test.phtml" hash="a9921c7483bbaf56c0bf98e41a672e1e"/></dir><dir name="smtp"><file name="test.phtml" hash="b5ed32a1e695c6fdf011dc6e1b5801fd"/></dir><file name="api.phtml" hash="8f406515a32962902a055554ac313261"/><file name="array.phtml" hash="082111176e5dac1d0e1f1eec1b1fc5d4"/><file name="diagnostics.phtml" hash="a6e51e54eade038052caa12542a1b163"/><file name="info.phtml" hash="9d3d76056542cb7ecdbbc03551cea432"/><file name="logging.phtml" hash="eafec906a6f3d67b48e138009b0134bb"/><file name="note.phtml" hash="8df6563e1e33c8047d3c399dbe43d476"/><file name="smtp.phtml" hash="0c3151b4d7f34d6cf96f9fd2bfe210fd"/></dir></dir><file name="setup_check.phtml" hash="74f11286e25cea96fdb87642b96d62ec"/></dir><dir name="convert"><dir name="profile"><file name="export.phtml" hash="c0cc0401d8a4b4cda36b3f28d09c98a8"/></dir></dir></dir><dir name="troubleshooting"><dir name="view"><dir name="tab"><file name="download.phtml" hash="72265504ae19264e31b3e0f5814b219b"/><file name="help.phtml" hash="40398a7ac0d4617956815d627fe086ca"/><file name="info.phtml" hash="53d09908246eade525571ef809e40735"/><file name="log.phtml" hash="db325e68b0584162fa3c2c082a029421"/><file name="settings.phtml" hash="218160085bc1745971cb80216704816e"/><file name="submit.phtml" hash="650f228e6be47ed72a8dfd636fb85512"/></dir><file name="form.phtml" hash="d2338bfe3598e9315ca8f5ac8d9b5516"/></dir><file name="status.phtml" hash="2a11a1c817fdcc7ea8c402583a85bbf4"/><file name="view.phtml" hash="6ddfc8c6efe25d30e63f792b19a95c84"/></dir><file name="diagnostics.phtml" hash="ca3b12f1caf598a0006c7a17bc78ea18"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="campaigner.xml" hash="5c81b7e0468c3c5d411cfede758f9311"/></dir><dir name="template"><dir name="campaigner"><dir name="capture"><file name="email.phtml" hash="fa273ff1a48a12eb386f58f3e3e78f66"/></dir><dir name="checkout"><file name="subscribe.phtml" hash="fd0671d9d8186d7c93e2c2eb5dbffaeb"/></dir><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="eb8b4743f1a37ac4e9d2d71dae71f65d"/></dir><file name="lists.phtml" hash="e20050217381c740bcffe3dfddff222a"/><file name="unsubscribed.phtml" hash="66a0e1ae8f7fa7e7770c931e2bb73244"/></dir></dir><dir name="signup"><file name="form.phtml" hash="87f1ced5f634d2816a37bca3797ecacf"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="newsletter_subscr_success_campaigner.html" hash="f6afb69d207bbc3f8920e7a72ac9dd07"/><file name="newsletter_unsub_success_campaigner.html" hash="bd9f97e8f5485180d4420097b5200ef4"/><file name="campaigner_relay_test.html" hash="3e01c93e616154068ea4b841802acf2f"/></dir></dir><file name="Campaigner_Integration.csv" hash="d107a2ee0ccd206831a19e21f0e13ad6"/></dir></target><target name="mageetc"><dir name="modules"><file name="Campaigner_Integration.xml" hash="d7311dea93c926305f8ed67be1c1fc12"/></dir></target></contents>
24
  <compatible/>
25
  <dependencies/>
26
  </package>
skin/adminhtml/default/default/campaigner/campaigner.css CHANGED
@@ -154,4 +154,9 @@ table.map_field_custom tr td:last-child { width: 80%; }
154
  clear:both;
155
  }
156
 
157
- .smtp_disable { color: red; margin-left: 5px; }
 
 
 
 
 
154
  clear:both;
155
  }
156
 
157
+ .smtp_disable { color: red; margin-left: 5px; }
158
+
159
+ .campaigner_uninstall_files { margin-bottom: 15px; }
160
+ .campaigner_uninstall_files tr td { padding: 2px 0; }
161
+
162
+ .campaigner_uninstall_files td:first-child { padding-right: 15px; }