Engine - Version 1.1.0

Version Notes

# 1.1.0
First release of the E-ngine Magento plugin with support for:

- Signup using using box
- Signup using while ordering
- Signup through account
- Setup E-ngine marketing pixel
- Send transactional mail through E-ngine
- Added language packs
- Newsletter subscriber sync is now optional

Download this release

Release Info

Developer M. van de Vis
Extension Engine
Version 1.1.0
Comparing to
See all releases


Version 1.1.0

app/code/community/Engine/Engine/Block/Ecommerce.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Engine_Engine_Block_Ecommerce extends Mage_Core_Block_Template
3
+ {
4
+ public $_order;
5
+
6
+ public function isEcommerce()
7
+ {
8
+ $successPath = Mage::getStoreConfig('engine/ecommerce/success_url') != "" ? Mage::getStoreConfig('engine/ecommerce/success_url') : '/checkout/onepage/success';
9
+
10
+ if($this->getParentBlock()->getNameInLayout() == 'before_body_end'
11
+ && Mage::getStoreConfigFlag('engine/ecommerce/engine_marketing')
12
+ && strpos($this->getRequest()->getPathInfo(), $successPath) !== false
13
+ ){
14
+ return true;
15
+ }
16
+ return false;
17
+ }
18
+
19
+ /**
20
+ * @return Mage_Sales_Model_Order
21
+ */
22
+ public function getOrder()
23
+ {
24
+ if(!isset($this->_order)){
25
+ $orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
26
+ $this->_order = Mage::getModel('sales/order')->load($orderId);
27
+ }
28
+ return $this->_order;
29
+ }
30
+
31
+ public function getTransactionIdField()
32
+ {
33
+ return Mage::getStoreConfig('engine/ecommerce/transaction_id') != false ? Mage::getStoreConfig('engine/ecommerce/transaction_id') : 'entity_id';
34
+ }
35
+
36
+ public function getENgineID()
37
+ {
38
+ return Mage::getStoreConfig('engine/ecommerce/engine_id');
39
+ }
40
+
41
+ public function getENgineSubdomain()
42
+ {
43
+ return Mage::getStoreConfig('engine/ecommerce/engine_subdomain');
44
+ }
45
+
46
+ public function getENgineCustomer()
47
+ {
48
+ return Mage::getStoreConfig('engine/login/engine_customer');
49
+ }
50
+
51
+ public function getIncludeShipping()
52
+ {
53
+ return (bool) Mage::getStoreConfig('engine/ecommerce/engine_include_shipping');
54
+ }
55
+
56
+ public function getIncludeTax()
57
+ {
58
+ return (bool) Mage::getStoreConfig('engine/ecommerce/engine_include_tax');
59
+ }
60
+ }
app/code/community/Engine/Engine/Block/Extrafields.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * E-ngine Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com and you will be sent a copy immediately.
14
+ *
15
+ * @category Engine
16
+ * @package Engine_Engine
17
+ * @author Michiel van de Vis
18
+ * @copyright Copyright (c) 2014 Engine BV (www.e-ngine.nl)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class Engine_Engine_Block_Extrafields extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
22
+ {
23
+ protected $_magentoFields;
24
+
25
+ public function __construct()
26
+ {
27
+ $this->addColumn('magentoFieldName', array(
28
+ 'label' => Mage::helper('engine')->__('Magento field name'),
29
+ 'size' => 30,
30
+ ));
31
+ $this->addColumn('engineFieldName', array(
32
+ 'label' => Mage::helper('engine')->__('E-ngine field name'),
33
+ 'size' => 30
34
+ ));
35
+ $this->_addAfter = false;
36
+ $this->_addButtonLabel = Mage::helper('engine')->__('Add extra field');
37
+
38
+ parent::__construct();
39
+ $this->setTemplate('engine/field/extra_field.phtml');
40
+
41
+ // customer options
42
+ $magentoAttributes = Mage::getModel('customer/customer')->getAttributes();
43
+ $this->_magentoFields = array();
44
+ $invalidAttr = array(
45
+ 'updated_at', 'created_at', 'email',
46
+ 'default_billing', 'default_shipping',
47
+ 'entity_type_id', 'entity_id',
48
+ 'attribute_set_id', 'password_hash', 'increment_id'
49
+ );
50
+ foreach(array_keys($magentoAttributes) as $attr) {
51
+ if(array_search($attr, $invalidAttr) === false) {
52
+ $this->_magentoFields[$attr] = $attr;
53
+ }
54
+ }
55
+ }
56
+
57
+ protected function _renderCellTemplate($columnName)
58
+ {
59
+ if (empty($this->_columns[$columnName])) {
60
+ throw new Exception(Mage::helper('engine')->__('Wrong column name specified.'));
61
+ }
62
+ $column = $this->_columns[$columnName];
63
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
64
+
65
+ if ($columnName == 'magentoFieldName'){
66
+ asort($this->_magentoFields);
67
+
68
+ $rendered = '<select name="'.$inputName.'">';
69
+ foreach ($this->_magentoFields as $att => $name) {
70
+ $rendered .= '<option value="'.$att.'">'.$name.'</option>';
71
+ }
72
+ $rendered .= '</select>';
73
+
74
+ return $rendered;
75
+ } else {
76
+ return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}" ' .
77
+ ($column['size'] ? 'size="' . $column['size'] . '"' : '') . ' class="' .
78
+ (isset($column['class']) ? $column['class'] : 'input-text') . '"'.
79
+ (isset($column['style']) ? ' style="'.$column['style'] . '"' : '') . '/>';
80
+ }
81
+ }
82
+ }
app/code/community/Engine/Engine/Block/Newsletter.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Engine_Engine_Block_Newsletter extends Mage_Checkout_Block_Onepage_Abstract
3
+ {
4
+ /**
5
+ * Allow using of E-ngine / newsletter block to be used when allowing signup from order form.
6
+ */
7
+ public function __construct()
8
+ {
9
+ parent::__construct();
10
+ $this->setTemplate('engine/newsletter.phtml');
11
+ }
12
+ }
app/code/community/Engine/Engine/Helper/Connect.php ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * E-ngine Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com and you will be sent a copy immediately.
14
+ *
15
+ * @category Engine
16
+ * @package Engine_Engine
17
+ * @author Michiel van de Vis
18
+ * @copyright Copyright (c) 2014 Engine BV (www.e-ngine.nl)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Engine_Engine_Helper_Connect extends Mage_Core_Helper_Abstract
23
+ {
24
+ private $_client = null;
25
+ private $_mlid = null;
26
+ private $_confirm = null;
27
+
28
+ /**
29
+ * Get boolean whether we should confirm subscription
30
+ * @return bool
31
+ */
32
+ private function _getENgineConfirm($storeID=null)
33
+ {
34
+ if (!$this->_confirm) {
35
+ $this->_confirm = (bool) trim(Mage::getStoreConfig('newsletter/confirm', $storeID));
36
+ }
37
+ return $this->_confirm;
38
+ }
39
+
40
+ /**
41
+ * Get the mailinglistID in which to insert subscriptions.
42
+ * @return int
43
+ */
44
+ private function _getENgineMLID($storeID=null)
45
+ {
46
+ if (!$this->_mlid) {
47
+ $this->_mlid = (int) trim(Mage::getStoreConfig('engine/login/engine_mlid', $storeID));
48
+ }
49
+ return $this->_mlid;
50
+ }
51
+
52
+ /**
53
+ * Setup a connection to E-ngine with the configured credentials
54
+ *
55
+ * @return SoapClient
56
+ */
57
+ public function connectToENgine($storeID=null)
58
+ {
59
+ if (!$this->_client) {
60
+ $engineCustomer = trim(Mage::getStoreConfig('engine/login/engine_customer', $storeID));
61
+ $engineUsername = trim(Mage::getStoreConfig('engine/login/engine_username', $storeID));
62
+ $enginePassword = trim(Mage::getStoreConfig('engine/login/engine_password', $storeID));
63
+
64
+ if (
65
+ $engineCustomer!=='' &&
66
+ $engineUsername!=='' &&
67
+ $enginePassword!=='' &&
68
+ $this->_getENgineMLID($storeID) > 0
69
+ ) {
70
+ try {
71
+ $loc = "https://" . $engineCustomer . ".e-ngine.nl/soap/server.live.php";
72
+ $this->_client = new SoapClient(null,
73
+ array(
74
+ "location" => $loc,
75
+ "uri" => $loc,
76
+ "login" => $engineCustomer . "__" . $engineUsername,
77
+ "password" => $enginePassword,
78
+ "trace" => 1
79
+ )
80
+ );
81
+ return $this->_client;
82
+ } catch(Exception $e) {
83
+ Mage::log("E-ngine: Error connecting to Engine server: ".$e->getMessage());
84
+ }
85
+ }
86
+ return false;
87
+ } else {
88
+ return $this->_client;
89
+ }
90
+ }
91
+
92
+ /**
93
+ * Subscribe an user (with additonal data) to E-ngine using the provided action ID.
94
+ * This action will be used to send a confirmation e-mail if configured.
95
+ *
96
+ * @param string $email
97
+ * @param array $data
98
+ * @param int $actionID
99
+ * @return boolean
100
+ */
101
+ public function subscribeENgine($email, array $data, $actionID)
102
+ {
103
+ $client = $this->connectToENgine();
104
+
105
+ if ($client !== false) {
106
+ Mage::log("E-ngine: Subscribing new email address: $email");
107
+ try {
108
+ $data['email'] = $email;
109
+ $data['actieid'] = (int) $actionID;
110
+ $result = $client->Subscriber_set($data, $this->_getENgineConfirm(), $this->_getENgineMLID());
111
+ return $result;
112
+ } catch(Exception $e) {
113
+ Mage::log("E-ngine: An error occured: " . $e->getMessage());
114
+ }
115
+ }
116
+ return false;
117
+ }
118
+
119
+ /**
120
+ * Unsubscribe an emailaddress in E-ngine
121
+ *
122
+ * @param string $email
123
+ * @return boolean
124
+ */
125
+ public function unsubscribeENgine($email)
126
+ {
127
+ $client = $this->connectToENgine();
128
+
129
+ if ($client !== false) {
130
+ Mage::log("E-ngine: Unsubscribing old email address: $email");
131
+ try {
132
+ $result = $client->Subscriber_unsubscribe($email, $this->_getENgineConfirm(), $this->_getENgineMLID());
133
+ return $result;
134
+ } catch(Exception $e) {
135
+ Mage::log("E-ngine: An error occured: " . $e->getMessage());
136
+ return;
137
+ }
138
+ }
139
+ return false;
140
+ }
141
+
142
+ /**
143
+ * Is E-ngine currently configured?
144
+ *
145
+ * @return boolean
146
+ */
147
+ public function isENgineSetup($storeID=null)
148
+ {
149
+ $engineCustomer = trim(Mage::getStoreConfig('engine/login/engine_customer', $storeID));
150
+ $engineUsername = trim(Mage::getStoreConfig('engine/login/engine_username', $storeID));
151
+ $enginePassword = trim(Mage::getStoreConfig('engine/login/engine_password', $storeID));
152
+
153
+ if (
154
+ $engineCustomer!=='' &&
155
+ $engineUsername!=='' &&
156
+ $enginePassword!=='' &&
157
+ $this->_getENgineMLID($storeID) > 0
158
+ ) {
159
+ return true;
160
+ }
161
+ return false;
162
+ }
163
+
164
+ /**
165
+ * Is E-ngine currently configured to be used to send transactional mails?
166
+ *
167
+ * @return boolean
168
+ */
169
+ public function isENgineSetupForTransactionalMail($storeID=null)
170
+ {
171
+ $triggersEnabled = trim(Mage::getStoreConfig('engine/mails/engine_enable_trigger', $storeID));
172
+
173
+ if (
174
+ $this->isENgineSetup($storeID) &&
175
+ $triggersEnabled
176
+ ) {
177
+ return true;
178
+ }
179
+ return false;
180
+ }
181
+
182
+ public function getENgineTestForTransactionalMail($storeID=null)
183
+ {
184
+ $testEnabled = trim(Mage::getStoreConfig('engine/mails/engine_enable_test', $storeID));
185
+ $testAddress = trim(Mage::getStoreConfig('engine/mails/engine_testaddress', $storeID));
186
+
187
+ if (
188
+ $this->isENgineSetup($storeID) &&
189
+ $testEnabled &&
190
+ $testAddress != ''
191
+ ) {
192
+ return $testAddress;
193
+ }
194
+ return false;
195
+ }
196
+
197
+ public function getENgineMailingIDFromContent($content, $title, $subject, $from_name, $from_mail, $reply_mail=null)
198
+ {
199
+ $cacheId = 'engine_template_' . $title;
200
+ $helper = Mage::helper('engine/data');
201
+ $mailingID = $helper->loadCacheData($cacheId);
202
+ if ($mailingID !== false) {
203
+ return $mailingID;
204
+ }
205
+
206
+ $this->connectToENgine();
207
+
208
+ $mailingID = $this->_client->Mailing_createFromContent(
209
+ $content,
210
+ '',
211
+ $title,
212
+ $subject,
213
+ $from_name,
214
+ $from_mail,
215
+ $reply_mail,
216
+ $this->_getENgineMLID()
217
+ );
218
+
219
+ $helper->saveCacheData($mailingID, $cacheId);
220
+
221
+ return $mailingID;
222
+ }
223
+
224
+ public function getENgineBounces($from, $till, $storeID=null)
225
+ {
226
+ $this->connectToENgine($storeID);
227
+
228
+ $bounces = $this->_client->Mailinglist_getUnsubscriptions(
229
+ $from,
230
+ $till,
231
+ array('email'),
232
+ null,
233
+ $this->_getENgineMLID($storeID)
234
+ );
235
+
236
+ return $bounces;
237
+ }
238
+
239
+ public function sendMailing($mailingID, $subscribers, $send_date=null)
240
+ {
241
+ $this->connectToENgine();
242
+
243
+ if (is_null($send_date)) {
244
+ $send_date = date("Y-m-d H:i:s");
245
+ }
246
+
247
+ $subsMailed = $this->_client->Subscriber_sendMailingToSubscribers($mailingID, $send_date, $subscribers, $this->_getENgineMLID());
248
+
249
+ return $subsMailed;
250
+ }
251
+
252
+
253
+ }
app/code/community/Engine/Engine/Helper/Data.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * E-ngine Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com and you will be sent a copy immediately.
14
+ *
15
+ * @category Engine
16
+ * @package Engine_Engine
17
+ * @author Michiel van de Vis
18
+ * @copyright Copyright (c) 2014 Engine BV (www.e-ngine.nl)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Engine_Engine_Helper_Data extends Mage_Core_Helper_Abstract
23
+ {
24
+ /**
25
+ * @const CACHE_TAG General cache tag
26
+ */
27
+ const CACHE_TAG = 'ENGINE_CACHE';
28
+ const CACHE_ID = 'engine_template';
29
+
30
+ private $_cache = null;
31
+
32
+ /**
33
+ * Class constructor
34
+ */
35
+ public function __construct() {
36
+ $this->_isEnabled = Mage::app()->useCache(self::CACHE_ID);
37
+ }
38
+
39
+ /**
40
+ * Check if E-ngine cache is enabled
41
+ *
42
+ * @return bool
43
+ */
44
+ public function isCacheEnabled() {
45
+ return (bool) $this->_isEnabled;
46
+ }
47
+
48
+ /**
49
+ * Save data to cache
50
+ *
51
+ * @param string $data Data to be cached
52
+ * @param string $cacheId
53
+ * @return bool
54
+ */
55
+ public function saveCacheData($data, $cacheRecordID) {
56
+ if (!$this->isCacheEnabled()) {
57
+ return false;
58
+ }
59
+
60
+ if (!isset($this->_cache[$cacheRecordID]) || $this->_cache[$cacheRecordID] != $data) {
61
+ if (!is_array($this->_cache)) {
62
+ $this->_cache = array();
63
+ }
64
+ $this->_cache[$cacheRecordID] = $data;
65
+
66
+ $result = Mage::app()->saveCache(json_encode($this->_cache), self::CACHE_ID, array(self::CACHE_TAG));
67
+ return $result;
68
+ }
69
+
70
+ return false;
71
+ }
72
+
73
+ /**
74
+ * Retrieve data from Cache
75
+ *
76
+ * @param string $cacheRecordID Cache ID
77
+ * @return mixed Cache data
78
+ */
79
+ public function loadCacheData($cacheRecordID) {
80
+ if (!$this->isCacheEnabled()) {
81
+ return false;
82
+ }
83
+
84
+ if (is_null($this->_cache)) {
85
+ $cacheData = Mage::app()->loadCache(self::CACHE_ID);
86
+ $this->_cache = json_decode($cacheData, true);
87
+ }
88
+
89
+ if (isset($this->_cache[$cacheRecordID])) {
90
+ return $this->_cache[$cacheRecordID];
91
+ }
92
+ return false;
93
+ }
94
+
95
+ /**
96
+ * Remove data from Cache
97
+ *
98
+ * @return int
99
+ */
100
+ public function removeCacheData() {
101
+ if (!$this->isCacheEnabled()) {
102
+ return false;
103
+ }
104
+
105
+ Mage::app()->removeCache(self::CACHE_ID);
106
+
107
+ return $this;
108
+ }
109
+
110
+ /**
111
+ * Invalidate E-ngine cache
112
+ *
113
+ * @return void
114
+ */
115
+ public function invalidateCache() {
116
+ Mage::app()->getCacheInstance()->invalidateType(self::CACHE_ID);
117
+ }
118
+
119
+
120
+ }
app/code/community/Engine/Engine/Model/Checkout/Type/Onepage.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * E-ngine Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com and you will be sent a copy immediately.
14
+ *
15
+ * @category Engine
16
+ * @package Engine_Engine
17
+ * @author Michiel van de Vis
18
+ * @copyright Copyright (c) 2014 Engine BV (www.e-ngine.nl)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Engine_Engine_Model_Checkout_Type_Onepage extends Mage_Checkout_Model_Type_Onepage
23
+ {
24
+ public function saveBilling($postData, $customerAddressId)
25
+ {
26
+ $isSubscribed = (isset($postData['is_subscribed']) && !empty($postData['is_subscribed']));
27
+ $this->getCheckout()->setCustomerIsSubscribed($isSubscribed);
28
+
29
+ return parent::saveBilling($postData, $customerAddressId);
30
+ }
31
+ }
app/code/community/Engine/Engine/Model/Core/Email/Template.php ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Core
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Template model
29
+ *
30
+ * Example:
31
+ *
32
+ * // Loading of template
33
+ * $emailTemplate = Mage::getModel('core/email_template')
34
+ * ->load(Mage::getStoreConfig('path_to_email_template_id_config'));
35
+ * $variables = array(
36
+ * 'someObject' => Mage::getSingleton('some_model')
37
+ * 'someString' => 'Some string value'
38
+ * );
39
+ * $emailTemplate->send('some@domain.com', 'Name Of User', $variables);
40
+ *
41
+ * @method Mage_Core_Model_Resource_Email_Template _getResource()
42
+ * @method Mage_Core_Model_Resource_Email_Template getResource()
43
+ * @method string getTemplateCode()
44
+ * @method Mage_Core_Model_Email_Template setTemplateCode(string $value)
45
+ * @method string getTemplateText()
46
+ * @method Mage_Core_Model_Email_Template setTemplateText(string $value)
47
+ * @method string getTemplateStyles()
48
+ * @method Mage_Core_Model_Email_Template setTemplateStyles(string $value)
49
+ * @method int getTemplateType()
50
+ * @method Mage_Core_Model_Email_Template setTemplateType(int $value)
51
+ * @method string getTemplateSubject()
52
+ * @method Mage_Core_Model_Email_Template setTemplateSubject(string $value)
53
+ * @method string getTemplateSenderName()
54
+ * @method Mage_Core_Model_Email_Template setTemplateSenderName(string $value)
55
+ * @method string getTemplateSenderEmail()
56
+ * @method Mage_Core_Model_Email_Template setTemplateSenderEmail(string $value)
57
+ * @method string getAddedAt()
58
+ * @method Mage_Core_Model_Email_Template setAddedAt(string $value)
59
+ * @method string getModifiedAt()
60
+ * @method Mage_Core_Model_Email_Template setModifiedAt(string $value)
61
+ * @method string getOrigTemplateCode()
62
+ * @method Mage_Core_Model_Email_Template setOrigTemplateCode(string $value)
63
+ * @method string getOrigTemplateVariables()
64
+ * @method Mage_Core_Model_Email_Template setOrigTemplateVariables(string $value)
65
+ *
66
+ * @category Mage
67
+ * @package Mage_Core
68
+ * @author Magento Core Team <core@magentocommerce.com>
69
+ */
70
+ class Engine_Engine_Model_Core_Email_Template extends Mage_Core_Model_Email_Template
71
+ {
72
+ protected $replyTo = null;
73
+
74
+ private $_engineReplacements = array();
75
+ private $_personalizeArray = array();
76
+
77
+ /**
78
+ * Send mail to recipient
79
+ *
80
+ * @param array|string $email E-mail(s)
81
+ * @param array|string|null $name receiver name(s)
82
+ * @param array $variables template variables
83
+ * @return boolean
84
+ **/
85
+ public function send($email, $name = null, array $variables = array())
86
+ {
87
+ $helper = Mage::helper('engine/connect');
88
+
89
+ //Should we use E-ngine for transactional emails?
90
+ if (!$helper->isENgineSetupForTransactionalMail()){
91
+ return parent::send($email, $name, $variables);
92
+ }
93
+ $testAddress = $helper->getENgineTestForTransactionalMail();
94
+
95
+ if ($testAddress !== false) {
96
+ // Send mail via Magento and overwrite email by test address
97
+ parent::send($email, $name, $variables);
98
+
99
+ $email = array($testAddress);
100
+ }
101
+
102
+ if (!$this->isValidForSend()) {
103
+ Mage::logException(new Exception('This letter cannot be sent.')); // translation is intentionally omitted
104
+ return false;
105
+ }
106
+
107
+ $emails = array_values((array) $email);
108
+
109
+ $variables['email'] = reset($emails);
110
+
111
+ $this->setUseAbsoluteLinks(true);
112
+
113
+ try {
114
+ $connected = $helper->connectToENgine();
115
+
116
+ if ($connected) {
117
+ $fromEmail = $this->getSenderEmail();
118
+ $fromName = $this->getSenderName();
119
+
120
+ $data = $this->getTemplateDataForENgine($variables, $this->getTemplateSubject());
121
+
122
+ $mailingID = $helper->getENgineMailingIDFromContent(
123
+ $data['html'],
124
+ 'Magento - ' . $this->getTemplateCode(),
125
+ $data['subject'],
126
+ $fromName,
127
+ $fromEmail,
128
+ $this->replyTo
129
+ );
130
+
131
+ if (is_numeric($mailingID)) {
132
+ $subscribers = array();
133
+ $replace = array();
134
+ // Replace tags inside tags.
135
+ foreach ($this->_personalizeArray as $k => $v) {
136
+ $replace['{{' . $k . '}}'] = $v;
137
+ }
138
+ foreach ($this->_personalizeArray as $k => $v) {
139
+ $this->_personalizeArray[$k] = str_replace(array_keys($replace), $replace, $v);
140
+ }
141
+ foreach ($emails as $key => $email) {
142
+ $this->_personalizeArray['email'] = $email;
143
+ $subscribers[] = $this->_personalizeArray;
144
+ }
145
+
146
+ $subsMailed = $helper->sendMailing($mailingID, $subscribers);
147
+
148
+ if ($subsMailed == 0) {
149
+ return false;
150
+ }
151
+ } else {
152
+ return false;
153
+ }
154
+ }
155
+
156
+ } catch (Exception $e) {
157
+ Mage::logException($e);
158
+ return false;
159
+ }
160
+
161
+ return true;
162
+ }
163
+
164
+ public function getTemplateDataForENgine($variables, $oldSubject)
165
+ {
166
+ $optionsArray = $this->getVariablesOptionArray();
167
+
168
+ $engineDelimiter = '--ENGINESEPERATOR--';
169
+ $opts = array();
170
+ foreach ($optionsArray as $v) {
171
+ $opts[] = $v['value'];
172
+ }
173
+
174
+ $oldText = $this->getTemplateText();
175
+ $oldType = $this->getTemplateType();
176
+
177
+ if (preg_match_all('/\{\{([^{]*)\}\}/', $oldText.$oldSubject, $matches)) {
178
+ foreach ($matches[0] as $match) {
179
+ if (array_search($match, $opts) === false) {
180
+ $noBracket = trim($match, '{}');
181
+ $opts[] = $match;
182
+ $optionsArray[] = array('value' => $match, 'label' => $noBracket);
183
+ }
184
+ }
185
+ }
186
+
187
+ // Parse the generated TXT to retrieve customized variables
188
+ $this->setTemplateType(self::TYPE_TEXT);
189
+ $this->setTemplateText(implode($engineDelimiter, $opts));
190
+ $generatedTxt = $this->getProcessedTemplate($variables, true);
191
+ $values = explode($engineDelimiter, $generatedTxt);
192
+ $this->setTemplateText($oldText);
193
+ $this->setTemplateType($oldType);
194
+
195
+ $this->_personalizeArray = array();
196
+ $this->_engineReplacements = array();
197
+ foreach ($values as $k => $v) {
198
+ if (isset($optionsArray[$k])) {
199
+ if (!is_array($optionsArray[$k])) {
200
+ $label = $optionsArray[$k];
201
+ $value = $optionsArray[$k];
202
+ } else if (isset($optionsArray[$k]['replacement'])) {
203
+ $label = $optionsArray[$k]['replacement'];
204
+ $value = $optionsArray[$k]['value'];
205
+ } else {
206
+ $label = preg_replace('/[^a-z0-9_]/i', '', strtolower(str_replace(' ', '_', $optionsArray[$k]['label'])));
207
+ $value = $optionsArray[$k]['value'];
208
+ }
209
+
210
+ $this->_engineReplacements[$value] = '{{' . $label . '}}';
211
+ $this->_personalizeArray[$label] = str_replace(array("\r", "\n"), ' ', $v);
212
+ }
213
+ }
214
+
215
+ // Append config variables to be used as replacement tags.
216
+ preg_match_all('/\{\{depend (.*)\}\}(.*)\{\{\/depend\}\}/sU', $oldText.$oldSubject, $matches);
217
+ if (count($matches[0]) > 0) {
218
+ foreach ($matches[1] as $k => $ifMatch)
219
+ {
220
+ $trueValue = '1';
221
+ if ($ifMatch == 'salable') {
222
+ $trueValue = 'yes';
223
+ } else if(preg_match('/([a-z0-9A-Z]*)\.([a-zA-Z0-9]*)\(\)/', $ifMatch, $match)) {
224
+ // item exists
225
+ $tagValue = strtolower($match[1] . '_' . $match[2]);
226
+ if (isset($variables[$match[1]])) {
227
+ $object = $variables[$match[1]];
228
+ $function = $match[2];
229
+ // Valid method
230
+ if (method_exists($object, $function)) {
231
+ $this->_personalizeArray[$tagValue] = str_replace(array("\r", "\n"), ' ', $object->$function());
232
+ }
233
+ }
234
+ $ifMatch = $tagValue;
235
+ }
236
+
237
+ $trueText = str_replace(array("\r", "\n"), ' ', $matches[2][$k]);
238
+
239
+ $oldText = str_replace($matches[0][$k], '{{{if($' . $ifMatch . ' = \'' . $trueValue . '\',[' . $trueText . '],[])}}}', $oldText);
240
+ $oldSubject = str_replace($matches[0][$k], '{{{if($' . $ifMatch . ' = \'' . $trueValue . '\',[' . $trueText . '],[])}}}', $oldSubject);
241
+
242
+ //$this->_engineReplacements[$matches[0][$k]] = '{{' . $tagValue . '}}';
243
+ //$this->_personalizeArray[$tagValue] = str_replace(array("\r", "\n"), ' ', $configValue);
244
+ }
245
+ }
246
+
247
+ foreach ($variables as $tagValue => $v) {
248
+ if (!is_object($v) && !is_array($v) && strpos($oldText.$oldSubject, $tagValue)!==false && !isset($this->_personalizeArray[$tagValue])) {
249
+ $this->_personalizeArray[$tagValue] = str_replace(array("\r", "\n"), ' ', $v);
250
+ }
251
+ }
252
+
253
+ $this->_engineReplacements[urldecode('%C2%A0')] = ' ';
254
+
255
+ $engineText = str_replace(array_keys($this->_engineReplacements), $this->_engineReplacements, $oldText);
256
+ $engineSubject = str_replace(array_keys($this->_engineReplacements), $this->_engineReplacements, $oldSubject);
257
+
258
+ return array('html' => $engineText, 'subject' => $engineSubject, 'replacements' => $this->_engineReplacements, 'personalize' => $this->_personalizeArray);
259
+ }
260
+
261
+ public function getTemplateSubjectForENgine($subj=null)
262
+ {
263
+ if (is_null($subj)) {
264
+ $subj = $this->getTemplateSubject();
265
+ }
266
+ return str_replace(array_keys($this->_engineReplacements), $this->_engineReplacements, $subj);
267
+ }
268
+
269
+ public function setReplyTo($email) {
270
+ $this->replyTo = $email;
271
+ return parent::setReplyTo($email);
272
+ }
273
+ }
app/code/community/Engine/Engine/Model/Cron.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * E-ngine Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com and you will be sent a copy immediately.
14
+ *
15
+ * @category Engine
16
+ * @package Engine_Engine
17
+ * @author Michiel van de Vis
18
+ * @copyright Copyright (c) 2014 Engine BV (www.e-ngine.nl)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Engine_Engine_Model_Cron
23
+ {
24
+ /**
25
+ * Cronjob to process bounces. We unsubscribe all bounces in the last 24h in Magento.
26
+ */
27
+ public function processBounces()
28
+ {
29
+ $stores = array_keys(Mage::app()->getStores());
30
+ foreach ($stores as $storeID) {
31
+ $helper = Mage::helper('engine/connect');
32
+ if ($helper->isENgineSetup($storeID)) {
33
+ $this->_processBounces($storeID);
34
+ }
35
+ }
36
+ }
37
+
38
+ /**
39
+ * Process bounces for a specific store
40
+ *
41
+ * @param $storeID
42
+ */
43
+ protected function _processBounces($storeID)
44
+ {
45
+ $helper = Mage::helper('engine/connect');
46
+
47
+ $from = date("Y-m-d 00:00:00", strtotime('yesterday'));
48
+ $till = date("Y-m-d 23:59:59", strtotime('yesterday'));
49
+
50
+ $bounces = $helper->getENgineBounces($from, $till, $storeID);
51
+ foreach ($bounces as $bounce)
52
+ {
53
+ if (isset($bounce['email']) && $bounce['email']!='') {
54
+ $subscriber = Mage::getModel('newsletter/subscriber')
55
+ ->loadByEmail($bounce['email']);
56
+
57
+ // Did we find an valid subscriber?
58
+ if (!is_null($subscriber->getSubscriberEmail())) {
59
+ // Don't push to E-ngine
60
+ $subscriber->unsubscribe(false);
61
+ }
62
+ }
63
+ }
64
+
65
+ }
66
+ }
app/code/community/Engine/Engine/Model/Observer.php ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * E-ngine Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com and you will be sent a copy immediately.
14
+ *
15
+ * @category Engine
16
+ * @package Engine_Engine
17
+ * @author Michiel van de Vis
18
+ * @copyright Copyright (c) 2014 Engine BV (www.e-ngine.nl)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Engine_Engine_Model_Observer
23
+ {
24
+ /**
25
+ * This function checks the currect subscription status for a customer and subscribes it when necessary.
26
+ *
27
+ * - Subscribe from user profile
28
+ * - Subscribe as customer when ordering
29
+ *
30
+ * @param type $observer
31
+ * @return void
32
+ */
33
+ public function checkSubscriptionStatus($observer)
34
+ {
35
+ $event = $observer->getEvent();
36
+ $customer = $event->getCustomer();
37
+
38
+ $newEmail = $customer->getEmail();
39
+ $subscribed = $customer->getIsSubscribed();
40
+
41
+ $oldEmail = Mage::getModel('customer/customer')->load($customer->getId())->getEmail();
42
+ // if subscribed is NULL (i.e. because the form didn't set it one way
43
+ // or the other), get the existing value from the database
44
+ if ($subscribed === null) {
45
+ $subscribed = Mage::getModel('newsletter/subscriber')->loadByCustomer($customer)->isSubscribed();
46
+ }
47
+
48
+ try {
49
+ $helper = Mage::helper('engine/connect');
50
+ if (!$subscribed || ($oldEmail && $newEmail != $oldEmail)) {
51
+ // Not subscribed or changing email? Unsubscribe old email address
52
+ $result = $helper->unsubscribeENgine($oldEmail);
53
+ } else if ($subscribed) {
54
+ // Should we subscribe the customer?
55
+ $data = Engine_Engine_Model_Observer::generateCustomFields($customer);
56
+ $actionID = (int) trim(Mage::getStoreConfig('engine/actions/engine_actionid_account'));
57
+
58
+ $data['campaign'] = 'subscribe_account';
59
+ $data['source'] = 'website';
60
+
61
+ $result = $helper->subscribeENgine($newEmail, $data, $actionID);
62
+ }
63
+ return $result;
64
+ } catch(Exception $e) {
65
+ Mage::log("E-ngine: An error occured: ".$e->getMessage());
66
+ }
67
+ return;
68
+ }
69
+
70
+ /**
71
+ * This function deletes/unsubscribed an customer.
72
+ *
73
+ * - Unsubscribe from user profile
74
+ *
75
+ * @param type $observer
76
+ * @return void
77
+ */
78
+ public function customerDeleted($observer)
79
+ {
80
+ $event = $observer->getEvent();
81
+ $customer = $event->getCustomer();
82
+
83
+ $email = $customer->getEmail();
84
+
85
+ $helper = Mage::helper('engine/connect');
86
+
87
+ Mage::log("E-ngine: Customer deleted, unsubscribing: $email");
88
+ try {
89
+ $result = $helper->unsubscribeENgine($email);
90
+ return $result;
91
+ } catch(Exception $e) {
92
+ Mage::log("E-ngine: An error occured: ".$e->getMessage());
93
+ }
94
+ return;
95
+ }
96
+
97
+ /**
98
+ * Store subscription state in checkout object
99
+ *
100
+ * - Allow signup while ordering
101
+ *
102
+ * @param type $observer
103
+ */
104
+ public function setCustomerIsSubscribed($observer)
105
+ {
106
+ if ((bool) Mage::getSingleton('checkout/session')->getCustomerIsSubscribed()) {
107
+ $quote = $observer->getEvent()->getQuote();
108
+ $customer = $quote->getCustomer();
109
+ switch ($quote->getCheckoutMethod()) {
110
+ case Mage_Sales_Model_Quote::CHECKOUT_METHOD_REGISTER:
111
+ case Mage_Sales_Model_Quote::CHECKOUT_METHOD_LOGIN_IN:
112
+ $customer->setIsSubscribed(1);
113
+
114
+ // Also subscribe in Magento
115
+ Mage::getModel('newsletter/subscriber')->subscribe($customer->getEmail(), false);
116
+ break;
117
+ case Mage_Sales_Model_Quote::CHECKOUT_METHOD_GUEST:
118
+ $session = Mage::getSingleton('core/session');
119
+ try {
120
+ $data = Engine_Engine_Model_Observer::generateCustomFields($quote->getBillingAddress());
121
+ $email = $quote->getBillingAddress()->getEmail();
122
+ $actionID = (int) trim(Mage::getStoreConfig('engine/actions/engine_actionid_order'));
123
+
124
+ $data['campaign'] = 'subscribe_order';
125
+ $data['source'] = 'website';
126
+
127
+ $helper = Mage::helper('engine/connect');
128
+ $status = $helper->subscribeENgine($email, $data, $actionID);
129
+ if ($status == 'OK_CONFIRM'){
130
+ $session->addSuccess(Mage::helper('engine')->__('You will receive a confirmation email to confirm your subscription.'));
131
+ }
132
+
133
+ // Also subscribe in Magento
134
+ Mage::getModel('newsletter/subscriber')->subscribe($quote->getBillingAddress()->getEmail(), false);
135
+ } catch (Mage_Core_Exception $e) {
136
+ $session->addException($e, Mage::helper('engine')->__('There was a problem with the newsletter subscription: %s', $e->getMessage()));
137
+ } catch (Exception $e) {
138
+ $session->addException($e, Mage::helper('engine')->__('There was a problem with the newsletter subscription'));
139
+ }
140
+ break;
141
+ }
142
+
143
+ Mage::getSingleton('checkout/session')->setCustomerIsSubscribed(0);
144
+ }
145
+ }
146
+
147
+
148
+
149
+ // get array of linked attributes from the config settings and
150
+ // populate it
151
+ public static function generateCustomFields($customer)
152
+ {
153
+ $attrConversion = @unserialize(
154
+ Mage::getStoreConfig('engine/actions/engine_extrafields', Mage::app()->getStore()->getStoreId())
155
+ );
156
+ $customFields = array();
157
+ if (count($attrConversion) > 0) {
158
+ $customerData = $customer->getData();
159
+ foreach ($attrConversion as $fieldConvert) {
160
+ $magentoAtt = $fieldConvert['magentoFieldName'];
161
+ $translateTo = $fieldConvert['engineFieldName'];
162
+
163
+ if (isset($customerData[$magentoAtt])) {
164
+ $customFields[$translateTo] = self::convertColumn($customer, $magentoAtt, $customerData[$magentoAtt]);
165
+ }
166
+ }
167
+ }
168
+
169
+ return $customFields;
170
+ }
171
+
172
+ /**
173
+ * Convert column value to E-ngine can manage it.
174
+ * @param type $name
175
+ * @param type $value
176
+ * @return string
177
+ */
178
+ public static function convertColumn($customer, $name, $value)
179
+ {
180
+ switch ($name) {
181
+ case 'gender':
182
+ if ($value === '1') {
183
+ return 'm';
184
+ } else if ($value === '2') {
185
+ return 'f';
186
+ }
187
+ return 'u';
188
+ case 'dob':
189
+ return date("Y-m-d", strtotime($value));
190
+ case 'website_id':
191
+ return self::retrieveValueFromModel($customer->getWebsiteId(), 'core/website', 'name', $value);
192
+ case 'store_id':
193
+ return self::retrieveValueFromModel($customer->getStoreId(), 'core/store', 'name', $value);
194
+ case 'group_id':
195
+ return self::retrieveValueFromModel($customer->getGroupId(), 'customer/group', 'customer_group_code', $value);
196
+ }
197
+ return $value;
198
+ }
199
+
200
+ /**
201
+ * Retrieve a column from a model
202
+ *
203
+ * @param int $siteID
204
+ * @param string $model
205
+ * @param string $column
206
+ * @return string value
207
+ */
208
+ public static function retrieveValueFromModel($modelID, $model, $column, $default)
209
+ {
210
+ $d = Mage::getModel($model)->load($modelID)->getData();
211
+ if (isset($d[$column])) {
212
+ return $d[$column];
213
+ }
214
+ return $default;
215
+ }
216
+ }
app/code/community/Engine/Engine/Model/Subscriber.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * E-ngine Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com and you will be sent a copy immediately.
14
+ *
15
+ * @category Engine
16
+ * @package Engine_Engine
17
+ * @author Michiel van de Vis
18
+ * @copyright Copyright (c) 2014 Engine BV (www.e-ngine.nl)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Engine_Engine_Model_Subscriber extends Mage_Newsletter_Model_Subscriber
23
+ {
24
+ /**
25
+ * This function subscribes an emailadress in the Magento DB and also in the E-ngine DB
26
+ *
27
+ * - Newsletter signup box on homepage
28
+ *
29
+ * @param string $email
30
+ * @param bool $pushToENgine
31
+ * @return int
32
+ */
33
+ public function subscribe($email, $pushToENgine=true)
34
+ {
35
+ $isEnabled = Mage::getStoreConfig('engine/actions/engine_syncsubscribers');
36
+ if ($pushToENgine && $isEnabled) {
37
+ $helper = Mage::helper('engine/connect');
38
+ $actionID = (int) trim(Mage::getStoreConfig('engine/actions/engine_actionid_signup'));
39
+
40
+ $data['campaign'] = 'subscribe_form';
41
+ $data['source'] = 'website';
42
+
43
+ $helper->subscribeENgine($email, array(), $actionID);
44
+ }
45
+
46
+ return parent::subscribe($email);
47
+ }
48
+
49
+ /**
50
+ * This function unsubscribes an emailadress in the Magento DB and also in the E-ngine DB
51
+ *
52
+ * - Admin mass delete / unsubscribe
53
+ *
54
+ * @param bool $pushToENgine
55
+ * @return int
56
+ */
57
+ public function unsubscribe($pushToENgine=true)
58
+ {
59
+ $isEnabled = Mage::getStoreConfig('engine/actions/engine_syncsubscribers');
60
+ if ($pushToENgine && $isEnabled) {
61
+ $helper = Mage::helper('engine/connect');
62
+ $helper->unsubscribeENgine($this->getSubscriberEmail());
63
+ }
64
+
65
+ return parent::unsubscribe();
66
+ }
67
+
68
+ /**
69
+ * Prevent sending of an Magento confirmation mail if E-ngine is setup correctly.
70
+ * @return boolean
71
+ */
72
+ public function sendConfirmationSuccessEmail()
73
+ {
74
+ $isEnabled = Mage::getStoreConfig('engine/actions/engine_syncsubscribers');
75
+ $helper = Mage::helper('engine/connect');
76
+ // ENgine setup? Then let E-ngine send confirmation mails based on actionID
77
+ if ($isEnabled && $helper->isENgineSetup()) {
78
+ return $this;
79
+ } else {
80
+ return parent::sendConfirmationSuccessEmail();
81
+ }
82
+ }
83
+
84
+ /**
85
+ * Prevent sending of an Magento confirmation mail if E-ngine is setup correctly.
86
+ * @return boolean
87
+ */
88
+ public function sendUnsubscriptionEmail()
89
+ {
90
+ $isEnabled = Mage::getStoreConfig('engine/actions/engine_syncsubscribers');
91
+ $helper = Mage::helper('engine/connect');
92
+ // ENgine setup? Then let E-ngine send confirmation mails based on actionID
93
+ if ($isEnabled && $helper->isENgineSetup()) {
94
+ return $this;
95
+ } else {
96
+ return parent::sendUnsubscriptionEmail();
97
+ }
98
+ }
99
+
100
+ }
app/code/community/Engine/Engine/controllers/Admin/Newsletter/SubscriberController.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Engine
16
+ * @package Engine_Engine
17
+ * @author Michiel van de Vis
18
+ * @copyright Copyright (c) 2014 Engine BV (www.e-ngine.nl)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ include_once('Mage/Adminhtml/controllers/Newsletter/SubscriberController.php');
22
+
23
+ class Engine_Engine_Admin_Newsletter_SubscriberController extends Mage_Adminhtml_Newsletter_SubscriberController
24
+ {
25
+ /**
26
+ * Also unsubscribe users when performing an mass delete from admin
27
+ */
28
+ public function massDeleteAction()
29
+ {
30
+ // Also unsubscribe users while deleting
31
+ parent::massUnsubscribeAction();
32
+
33
+ parent::massDeleteAction();
34
+ }
35
+ }
app/code/community/Engine/Engine/controllers/Admin/System/Email/TemplateController.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * @category Engine
16
+ * @package Engine_Engine
17
+ * @author Michiel van de Vis
18
+ * @copyright Copyright (c) 2014 Engine BV (www.e-ngine.nl)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ include_once('Mage/Adminhtml/controllers/System/Email/TemplateController.php');
22
+
23
+ class Engine_Engine_Admin_System_Email_TemplateController extends Mage_Adminhtml_System_Email_TemplateController
24
+ {
25
+ /**
26
+ * Invalidate cache after saving template
27
+ */
28
+ public function saveAction()
29
+ {
30
+ $helper = Mage::helper('engine/data');
31
+ $helper->invalidateCache();
32
+
33
+ // redirect to parent action
34
+ parent::saveAction();
35
+ }
36
+ }
app/code/community/Engine/Engine/etc/config.xml ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Engine Extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com and you will be sent a copy immediately.
15
+ *
16
+ * @category Engine
17
+ * @package Engine_Engine
18
+ * @author M. van de Vis
19
+ * @copyright Copyright (c) 2014 Engine (www.engine.nl)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+ -->
23
+ <config>
24
+
25
+ <modules>
26
+ <Engine_Engine>
27
+ <version>1.1.0</version>
28
+ </Engine_Engine>
29
+ </modules>
30
+
31
+ <global>
32
+ <models>
33
+ <!--
34
+ Allow custom models
35
+ -->
36
+ <engine>
37
+ <class>Engine_Engine_Model</class>
38
+ </engine>
39
+
40
+ <!--
41
+ Rewrite model to we can:
42
+ - subscribe
43
+ - prevent sending (un)confirmation mails
44
+ -->
45
+ <newsletter>
46
+ <rewrite>
47
+ <subscriber>Engine_Engine_Model_Subscriber</subscriber>
48
+ </rewrite>
49
+ </newsletter>
50
+
51
+ <!--
52
+ Inject saving of isSubscribed state while processing billing info.
53
+ -->
54
+ <checkout>
55
+ <rewrite>
56
+ <type_onepage>Engine_Engine_Model_Checkout_Type_Onepage</type_onepage>
57
+ </rewrite>
58
+ </checkout>
59
+
60
+ <core>
61
+ <rewrite>
62
+ <email_template>Engine_Engine_Model_Core_Email_Template</email_template>
63
+ </rewrite>
64
+ </core>
65
+ </models>
66
+
67
+ <!--
68
+ Our helper which connects to E-ngine and actually subscribes/unsubscribes the users.
69
+ -->
70
+ <helpers>
71
+ <engine>
72
+ <class>Engine_Engine_Helper</class>
73
+ </engine>
74
+ </helpers>
75
+
76
+ <!--
77
+ The blocks which handle:
78
+ - Checkbox 'subscribe' while ordering
79
+ - Processing extra fields while signing up.
80
+ -->
81
+ <blocks>
82
+ <engine>
83
+ <class>Engine_Engine_Block</class>
84
+ </engine>
85
+ </blocks>
86
+
87
+ <events>
88
+ <!--
89
+ Check subscription state while saving customer
90
+ - updating customer profile (admin/frontend)
91
+ -->
92
+ <customer_save_before>
93
+ <observers>
94
+ <engine_engine_observer_save>
95
+ <type>singleton</type>
96
+ <class>engine/observer</class>
97
+ <method>checkSubscriptionStatus</method>
98
+ </engine_engine_observer_save>
99
+ </observers>
100
+ </customer_save_before>
101
+
102
+ <!--
103
+ Check subscription state while saving customer
104
+ - updating customer profile (admin/frontend)
105
+ -->
106
+ <customer_delete_before>
107
+ <observers>
108
+ <engine_engine_observer_delete>
109
+ <type>singleton</type>
110
+ <class>engine/observer</class>
111
+ <method>customerDeleted</method>
112
+ </engine_engine_observer_delete>
113
+ </observers>
114
+ </customer_delete_before>
115
+
116
+ <!--
117
+ Process signup in order process
118
+ - allow signup while ordering
119
+ -->
120
+ <checkout_type_onepage_save_order>
121
+ <observers>
122
+ <engine_engine_observer_issubscribed>
123
+ <type>singleton</type>
124
+ <class>engine/observer</class>
125
+ <method>setCustomerIsSubscribed</method>
126
+ </engine_engine_observer_issubscribed>
127
+ </observers>
128
+ </checkout_type_onepage_save_order>
129
+ </events>
130
+
131
+
132
+ <cache>
133
+ <types>
134
+ <engine_template module="engine" translate="label,description">
135
+ <label>E-ngine transactional e-mail cache</label>
136
+ <description>The E-ngine mailing IDs are cached to prevent redundant calls to E-ngine. Refresh this cache after changing a template in E-ngine or the subject in the settings.</description>
137
+ <tags>ENGINE_CACHE</tags>
138
+ </engine_template>
139
+ </types>
140
+ </cache>
141
+ </global>
142
+
143
+ <admin>
144
+ <routers>
145
+ <!--
146
+ Overrides admin controllers
147
+ - mass delete will also unsubscribe addresses
148
+ -->
149
+ <adminhtml>
150
+ <use>admin</use>
151
+ <args>
152
+ <module>Mage_Adminhtml</module>
153
+ <frontName>admin</frontName>
154
+ <modules>
155
+ <Engine_Engine before="Mage_Adminhtml">Engine_Engine_Admin</Engine_Engine>
156
+ </modules>
157
+ </args>
158
+ </adminhtml>
159
+ </routers>
160
+ </admin>
161
+
162
+ <adminhtml>
163
+ <acl>
164
+ <resources>
165
+ <admin>
166
+ <children>
167
+ <system>
168
+ <children>
169
+ <config>
170
+ <children>
171
+ <engine translate="title" module="engine">
172
+ <title>E-ngine Config Section</title>
173
+ </engine>
174
+ </children>
175
+ </config>
176
+ </children>
177
+ </system>
178
+ </children>
179
+ </admin>
180
+ </resources>
181
+ </acl>
182
+
183
+ <translate>
184
+ <modules>
185
+ <engine>
186
+ <files>
187
+ <default>Engine_Engine.csv</default>
188
+ </files>
189
+ </engine>
190
+ </modules>
191
+ </translate>
192
+ </adminhtml>
193
+
194
+ <frontend>
195
+ <layout>
196
+ <!--
197
+ Inject layout updates to:
198
+ - show checkbox while ordering.
199
+ -->
200
+ <updates>
201
+ <engine>
202
+ <file>engine.xml</file>
203
+ </engine>
204
+ </updates>
205
+ </layout>
206
+ </frontend>
207
+
208
+ <default>
209
+ <engine>
210
+ <ecommerce>
211
+ <engine_success_url>/checkout/onepage/success</engine_success_url>
212
+ <engine_include_shipping>1</engine_include_shipping>
213
+ <engine_include_tax>1</engine_include_tax>
214
+ </ecommerce>
215
+ </engine>
216
+ </default>
217
+
218
+ <crontab>
219
+ <jobs>
220
+ <!--
221
+ Process E-ngine bounces and unsubscribe them from the newsletter in Magento.
222
+ -->
223
+ <engine_engine_process_bounces>
224
+ <schedule><cron_expr>15 0 * * *</cron_expr></schedule>
225
+ <run><model>engine/cron::processBounces</model></run>
226
+ </engine_engine_process_bounces>
227
+ </jobs>
228
+ </crontab>
229
+ </config>
app/code/community/Engine/Engine/etc/system.xml ADDED
@@ -0,0 +1,283 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * E-ngine Extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com and you will be sent a copy immediately.
15
+ *
16
+ * @category Engine
17
+ * @package Engine_Engine
18
+ * @author Michiel van de Vis
19
+ * @copyright Copyright (c) 2014 Engine BV (www.e-ngine.nl)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+ -->
23
+ <config>
24
+ <tabs>
25
+ <engine translate="label" module="engine">
26
+ <label>E-ngine</label>
27
+ <sort_order>1</sort_order>
28
+ </engine>
29
+ </tabs>
30
+ <sections>
31
+ <engine translate="label">
32
+ <label>E-ngine Configuration</label>
33
+ <tab>engine</tab>
34
+ <sort_order>100</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>1</show_in_store>
38
+ <groups>
39
+ <login translate="label" module="engine">
40
+ <label>Login settings</label>
41
+ <frontend_type>text</frontend_type>
42
+ <sort_order>0</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>1</show_in_store>
46
+ <fields>
47
+ <engine_customer translate="label,comment">
48
+ <label>E-ngine Customer</label>
49
+ <frontend_type>text</frontend_type>
50
+ <sort_order>1</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ <comment>This is the name of your E-ngine account which also can be found in the URL when you login to E-ngine.</comment>
55
+ </engine_customer>
56
+ <engine_username translate="label,comment">
57
+ <label>E-ngine Username</label>
58
+ <frontend_type>text</frontend_type>
59
+ <sort_order>2</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ <comment>This is the E-ngine username which can be used to login. Please create a SOAP user in E-ngine.</comment>
64
+ </engine_username>
65
+ <engine_password translate="label,comment">
66
+ <label>E-ngine Password</label>
67
+ <frontend_type>password</frontend_type>
68
+ <sort_order>3</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>1</show_in_website>
71
+ <show_in_store>1</show_in_store>
72
+ <comment>This is the E-ngine password which can be used to login. Please create a SOAP user in E-ngine.</comment>
73
+ </engine_password>
74
+ <engine_mlid translate="label,comment">
75
+ <label>Mailinglist ID</label>
76
+ <frontend_type>text</frontend_type>
77
+ <sort_order>4</sort_order>
78
+ <show_in_default>1</show_in_default>
79
+ <show_in_website>1</show_in_website>
80
+ <show_in_store>1</show_in_store>
81
+ <comment>This is the E-ngine mailinglist for which the users should be subscribed.</comment>
82
+ </engine_mlid>
83
+ </fields>
84
+ </login>
85
+ <actions translate="label" module="engine">
86
+ <label>Campaign management</label>
87
+ <frontend_type>text</frontend_type>
88
+ <sort_order>1</sort_order>
89
+ <show_in_default>1</show_in_default>
90
+ <show_in_website>1</show_in_website>
91
+ <show_in_store>1</show_in_store>
92
+ <fields>
93
+ <engine_syncsubscribers translate="label,comment">
94
+ <label>Synchronize subscribers</label>
95
+ <frontend_type>select</frontend_type>
96
+ <source_model>adminhtml/system_config_source_yesno</source_model>
97
+ <sort_order>0</sort_order>
98
+ <show_in_default>1</show_in_default>
99
+ <show_in_website>1</show_in_website>
100
+ <show_in_store>1</show_in_store>
101
+ <comment>Should Magento synchronize the subscribers to E-ngine? This will automatically subscribe/unsubscribe users in E-ngine if a user subscribers to your store its newsletter through a signup box or their account.</comment>
102
+ </engine_syncsubscribers>
103
+ <engine_extrafields translate="label,comment">
104
+ <label>Extra fields</label>
105
+ <frontend_model>engine_engine_block_extrafields</frontend_model>
106
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
107
+ <sort_order>8</sort_order>
108
+ <show_in_default>1</show_in_default>
109
+ <show_in_website>1</show_in_website>
110
+ <show_in_store>1</show_in_store>
111
+ <comment>These extra fields will be added to the subscriber data while syncing to E-ngine.</comment>
112
+ </engine_extrafields>
113
+ <engine_actionid_signup translate="label,comment">
114
+ <label>Action ID - Signup form</label>
115
+ <frontend_type>text</frontend_type>
116
+ <sort_order>0</sort_order>
117
+ <show_in_default>1</show_in_default>
118
+ <show_in_website>1</show_in_website>
119
+ <show_in_store>1</show_in_store>
120
+ <comment>This is the E-ngine action ID which should be used when the signup form is used.</comment>
121
+ <depends>
122
+ <engine_syncsubscribers>1</engine_syncsubscribers>
123
+ </depends>
124
+ </engine_actionid_signup>
125
+ <engine_actionid_order translate="label,comment">
126
+ <label>Action ID - Order</label>
127
+ <frontend_type>text</frontend_type>
128
+ <sort_order>1</sort_order>
129
+ <show_in_default>1</show_in_default>
130
+ <show_in_website>1</show_in_website>
131
+ <show_in_store>1</show_in_store>
132
+ <comment>This is the E-ngine action ID which should be used when a subscriber signs up during an order.</comment>
133
+ <depends>
134
+ <engine_syncsubscribers>1</engine_syncsubscribers>
135
+ </depends>
136
+ </engine_actionid_order>
137
+ <engine_actionid_account translate="label,comment">
138
+ <label>Action ID - Account</label>
139
+ <frontend_type>text</frontend_type>
140
+ <sort_order>2</sort_order>
141
+ <show_in_default>1</show_in_default>
142
+ <show_in_website>1</show_in_website>
143
+ <show_in_store>1</show_in_store>
144
+ <comment>This is the E-ngine action ID which should be used when a users subscribes from their account.</comment>
145
+ <depends>
146
+ <engine_syncsubscribers>1</engine_syncsubscribers>
147
+ </depends>
148
+ </engine_actionid_account>
149
+ </fields>
150
+ </actions>
151
+ <ecommerce translate="label" module="engine">
152
+ <label>Marketing</label>
153
+ <frontend_type>text</frontend_type>
154
+ <sort_order>2</sort_order>
155
+ <show_in_default>1</show_in_default>
156
+ <show_in_website>1</show_in_website>
157
+ <show_in_store>1</show_in_store>
158
+ <fields>
159
+ <engine_marketing translate="label,comment">
160
+ <label>Enable ecommerce pixel</label>
161
+ <frontend_type>select</frontend_type>
162
+ <source_model>adminhtml/system_config_source_yesno</source_model>
163
+ <sort_order>0</sort_order>
164
+ <show_in_default>1</show_in_default>
165
+ <show_in_website>1</show_in_website>
166
+ <show_in_store>1</show_in_store>
167
+ <comment>Should an pixel be placed on the 'success' page after completing an order? This makes the turnover from your newsletter visible in E-ngine.</comment>
168
+ </engine_marketing>
169
+ <engine_id translate="label,comment">
170
+ <label>E-ngine client/mailinglist ID</label>
171
+ <frontend_type>text</frontend_type>
172
+ <sort_order>2</sort_order>
173
+ <show_in_default>1</show_in_default>
174
+ <show_in_website>1</show_in_website>
175
+ <show_in_store>1</show_in_store>
176
+ <comment>This is the E-ngine client/mailinglist ID which can be found in the marketing pixel example on the page Marketing > Lead Tracking API.</comment>
177
+ <depends>
178
+ <engine_marketing>1</engine_marketing>
179
+ </depends>
180
+ </engine_id>
181
+ <engine_subdomain translate="label,comment">
182
+ <label>E-ngine subdomain</label>
183
+ <frontend_type>text</frontend_type>
184
+ <sort_order>3</sort_order>
185
+ <show_in_default>1</show_in_default>
186
+ <show_in_website>1</show_in_website>
187
+ <show_in_store>1</show_in_store>
188
+ <comment>This is the E-ngine subdomain which is setup for the specified mailinglist.</comment>
189
+ <depends>
190
+ <engine_marketing>1</engine_marketing>
191
+ </depends>
192
+ </engine_subdomain>
193
+ <engine_success_url translate="label,comment">
194
+ <label>Checkout Success Page URL</label>
195
+ <frontend_type>text</frontend_type>
196
+ <sort_order>4</sort_order>
197
+ <show_in_default>1</show_in_default>
198
+ <show_in_website>1</show_in_website>
199
+ <show_in_store>1</show_in_store>
200
+ <comment>Please type in the relative URL of your checkout success page url. Standard is /checkout/onepage/success</comment>
201
+ <depends>
202
+ <engine_marketing>1</engine_marketing>
203
+ </depends>
204
+ </engine_success_url>
205
+ <engine_include_shipping translate="label,comment">
206
+ <label>Include shipping costs?</label>
207
+ <frontend_type>select</frontend_type>
208
+ <source_model>adminhtml/system_config_source_yesno</source_model>
209
+ <sort_order>5</sort_order>
210
+ <show_in_default>1</show_in_default>
211
+ <show_in_website>1</show_in_website>
212
+ <show_in_store>1</show_in_store>
213
+ <comment>If enabled, the value in the marketing pixel will also include the shipping costs and the shipping costs will be added as a seperate product in the pixel.</comment>
214
+ <depends>
215
+ <engine_marketing>1</engine_marketing>
216
+ </depends>
217
+ </engine_include_shipping>
218
+ <engine_include_tax translate="label,comment">
219
+ <label>Include tax?</label>
220
+ <frontend_type>select</frontend_type>
221
+ <source_model>adminhtml/system_config_source_yesno</source_model>
222
+ <sort_order>6</sort_order>
223
+ <show_in_default>1</show_in_default>
224
+ <show_in_website>1</show_in_website>
225
+ <show_in_store>1</show_in_store>
226
+ <comment>If enabled, the value in the marketing pixel will also include tax.</comment>
227
+ <depends>
228
+ <engine_marketing>1</engine_marketing>
229
+ </depends>
230
+ </engine_include_tax>
231
+ </fields>
232
+ </ecommerce>
233
+
234
+ <mails translate="label" module="engine">
235
+ <label>Transactional e-mail</label>
236
+ <frontend_type>text</frontend_type>
237
+ <sort_order>3</sort_order>
238
+ <show_in_default>1</show_in_default>
239
+ <show_in_website>1</show_in_website>
240
+ <show_in_store>1</show_in_store>
241
+ <fields>
242
+ <engine_enable_trigger translate="label,comment">
243
+ <label>Enable transactional e-mail via E-ngine</label>
244
+ <frontend_type>select</frontend_type>
245
+ <source_model>adminhtml/system_config_source_yesno</source_model>
246
+ <sort_order>0</sort_order>
247
+ <show_in_default>1</show_in_default>
248
+ <show_in_website>1</show_in_website>
249
+ <show_in_store>1</show_in_store>
250
+ <comment>Should the transactional emails (order confirmation / new signups / etc.) be sent by E-ngine?</comment>
251
+ </engine_enable_trigger>
252
+ <engine_enable_test translate="label,comment">
253
+ <label>Enable testing mode?</label>
254
+ <frontend_type>select</frontend_type>
255
+ <source_model>adminhtml/system_config_source_yesno</source_model>
256
+ <sort_order>2</sort_order>
257
+ <show_in_default>1</show_in_default>
258
+ <show_in_website>1</show_in_website>
259
+ <show_in_store>1</show_in_store>
260
+ <comment>Should the transactional mails be sent to specified test addresses? In this case, the regular subscribers will receive the mail via the Magento default setup.</comment>
261
+ <depends>
262
+ <engine_enable_trigger>1</engine_enable_trigger>
263
+ </depends>
264
+ </engine_enable_test>
265
+ <engine_testaddress translate="label,comment">
266
+ <label>Test address</label>
267
+ <frontend_type>text</frontend_type>
268
+ <sort_order>3</sort_order>
269
+ <show_in_default>1</show_in_default>
270
+ <show_in_website>1</show_in_website>
271
+ <show_in_store>1</show_in_store>
272
+ <comment>This test address will receive the transactional mails sent by E-ngine</comment>
273
+ <depends>
274
+ <engine_enable_test>1</engine_enable_test>
275
+ </depends>
276
+ </engine_testaddress>
277
+ </fields>
278
+ </mails>
279
+
280
+ </groups>
281
+ </engine>
282
+ </sections>
283
+ </config>
app/design/adminhtml/default/default/template/engine/field/extra_field.phtml ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * E-ngine Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com and you will be sent a copy immediately.
14
+ *
15
+ * @category Engine
16
+ * @package Engine_Engine
17
+ * @author Michiel van de Vis
18
+ * @copyright Copyright (c) 2014 E-ngine BV (www.e-ngine.nl)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ ?>
22
+
23
+ <?php
24
+ $_htmlId = $this->getHtmlId() ? $this->getHtmlId() : '_' . uniqid();
25
+
26
+ $_colspan = 2;
27
+ if (!$this->_addAfter) {
28
+ $_colspan -= 1;
29
+ }
30
+ $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : '';
31
+ ?>
32
+
33
+ <div class="grid" id="grid<?php echo $_htmlId ?>">
34
+ <table cellpadding="0" cellspacing="0" class="border">
35
+ <tbody>
36
+
37
+ <tr class="headings" id="headings<?php echo $_htmlId ?>">
38
+ <?php foreach ($this->_columns as $columnName => $column):?>
39
+ <th><?php echo $column['label'] ?></th>
40
+ <?php endforeach;?>
41
+ <th <?php echo $_colspan?>></th>
42
+ </tr>
43
+
44
+ <tr id="addRow<?php echo $_htmlId ?>">
45
+ <td colspan="<?php echo count($this->_columns) ?>"></td>
46
+ <td <?php echo $_colspan?>>
47
+ <button style="" onclick="" class="scalable add" type="button" id="addToEndBtn<?php echo $_htmlId ?>">
48
+ <span><span><span><?php echo $this->_addButtonLabel ?></span></span></span>
49
+ </button>
50
+ </td>
51
+ </tr>
52
+
53
+ </tbody>
54
+ </table>
55
+ <input type="hidden" name="<?php echo $this->getElement()->getName() ?>[__empty]" value="" />
56
+ </div>
57
+ <div id="empty<?php echo $_htmlId ?>">
58
+ <button style="" onclick="" class="scalable add" type="button" id="emptyAddBtn<?php echo $_htmlId ?>">
59
+ <span><span><span><?php echo $this->_addButtonLabel ?></span></span></span>
60
+ </button>
61
+ </div>
62
+
63
+ <script type="text/javascript">
64
+ //<![CDATA[
65
+ // create row creator
66
+ var arrayRow<?php echo $_htmlId ?> = {
67
+ // define row prototypeJS template
68
+ template : new Template(
69
+ '<tr id="#{_id}">'
70
+ <?php foreach ($this->_columns as $columnName => $column):?>
71
+ +'<td class="#{_id}-<?php echo $columnName?>">'
72
+ +'<?php echo $this->_renderCellTemplate($columnName)?>'
73
+ +'<\/td>'
74
+ <?php endforeach;?>
75
+ <?php if ($this->_addAfter):?>
76
+ +'<td><button onclick="" class="scalable add" type="button" id="addAfterBtn#{_id}"><span><span><span><?php echo Mage::helper('adminhtml')->__('Add after') ?><\/span><\/span><\/span><\/button><\/td>'
77
+ <?php endif;?>
78
+ +'<td><button onclick="arrayRow<?php echo $_htmlId ?>.del(\'#{_id}\')" class="scalable delete" type="button"><span><span><span><?php echo Mage::helper('adminhtml')->__('Delete') ?><\/span><\/span><\/span><\/button><\/td>'
79
+ +'<\/tr>'
80
+ ),
81
+
82
+ rowsCount : 0,
83
+
84
+ add : function(templateData, insertAfterId)
85
+ {
86
+ // generate default template data
87
+ if ('' == templateData) {
88
+ var d = new Date();
89
+ var templateData = {
90
+ <?php foreach ($this->_columns as $columnName => $column):?>
91
+ <?php echo $columnName ?> : '',
92
+ <?php endforeach;?>
93
+ _id : '_' + d.getTime() + '_' + d.getMilliseconds()
94
+ };
95
+ }
96
+
97
+ // insert before last row
98
+ if ('' == insertAfterId) {
99
+ Element.insert($('addRow<?php echo $_htmlId ?>'), {before: this.template.evaluate(templateData)});
100
+ }
101
+ // insert after specified row
102
+ else {
103
+ Element.insert($(insertAfterId), {after: this.template.evaluate(templateData)});
104
+ }
105
+ // set the selected drop-down list item
106
+ var options = $$('td.' + templateData._id + '-magentoFieldName option[value=' + templateData.magentoFieldName + ']');
107
+ if (options[0]) {
108
+ options[0].selected = "selected";
109
+ }
110
+
111
+ <?php if ($this->_addAfter):?>
112
+ Event.observe('addAfterBtn' + templateData._id, 'click', this.add.bind(this, '', templateData._id));
113
+ <?php endif;?>
114
+
115
+ this.rowsCount += 1;
116
+ },
117
+
118
+ del : function(rowId)
119
+ {
120
+ $(rowId).remove();
121
+ this.rowsCount -= 1;
122
+ if (0 == this.rowsCount) {
123
+ this.showButtonOnly();
124
+ }
125
+ },
126
+
127
+ showButtonOnly : function()
128
+ {
129
+ $('grid<?php echo $_htmlId ?>').hide();
130
+ $('empty<?php echo $_htmlId ?>').show();
131
+ }
132
+ }
133
+
134
+ // bind add action to "Add" button in last row
135
+ Event.observe('addToEndBtn<?php echo $_htmlId ?>', 'click', arrayRow<?php echo $_htmlId ?>.add.bind(arrayRow<?php echo $_htmlId ?>, '', ''));
136
+
137
+ // add existing rows
138
+ <?php
139
+ $_addAfterId = "headings{$_htmlId}";
140
+ foreach ($this->getArrayRows() as $_rowId => $_row) {
141
+ echo "arrayRow{$_htmlId}.add(" . $_row->toJson() . ", '{$_addAfterId}');\n";
142
+ $_addAfterId = $_rowId;
143
+ }
144
+ ?>
145
+
146
+ // initialize standalone button
147
+ $('empty<?php echo $_htmlId ?>').hide();
148
+ Event.observe('emptyAddBtn<?php echo $_htmlId ?>', 'click', function () {
149
+ $('grid<?php echo $_htmlId ?>').show();
150
+ $('empty<?php echo $_htmlId ?>').hide();
151
+ arrayRow<?php echo $_htmlId ?>.add('', '');
152
+ });
153
+
154
+ // if no rows, hide grid and show button only
155
+ <?php if (!$this->getArrayRows()):?>
156
+ arrayRow<?php echo $_htmlId ?>.showButtonOnly();
157
+ <?php endif;?>
158
+
159
+ // toggle the grid, if element is disabled (depending on scope)
160
+ <?php if ($this->getElement()->getDisabled()):?>
161
+ toggleValueElements({checked:true}, $('grid<?php echo $_htmlId ?>').parentNode);
162
+ <?php endif;?>
163
+ //]]>
164
+ </script>
app/design/frontend/base/default/layout/engine.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+
4
+ <!--
5
+ Disable this block if you'd like to use your own billing template
6
+
7
+ Include this code on your template to include the signup box:
8
+ <code>
9
+ echo $this->getLayout()->createBlock('engine/newsletter')->toHtml();
10
+ </code>
11
+ -->
12
+ <checkout_onepage_index>
13
+ <reference name="checkout.onepage.billing">
14
+ <action method="setTemplate"><template>engine/default-checkout-onepage-billing.phtml</template></action>
15
+ </reference>
16
+ </checkout_onepage_index>
17
+
18
+ <default>
19
+ <!--
20
+ Include ecommerce pixel before body end
21
+ -->
22
+ <reference name="before_body_end">
23
+ <block type="engine/ecommerce" name="engine_ecommerce_pixel" template="engine/ecommerce_pixel.phtml" />
24
+ </reference>
25
+ </default>
26
+
27
+ </layout>
app/design/frontend/base/default/template/engine/default-checkout-onepage-billing.phtml ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <form id="co-billing-form" action="">
28
+ <fieldset>
29
+ <ul class="form-list">
30
+ <?php if ($this->customerHasAddresses()): ?>
31
+ <li class="wide">
32
+ <label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
33
+ <div class="input-box">
34
+ <?php echo $this->getAddressesHtmlSelect('billing') ?>
35
+ </div>
36
+ </li>
37
+ <?php endif; ?>
38
+ <li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
39
+ <fieldset>
40
+ <input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
41
+ <ul>
42
+ <li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getQuote()->getCustomer())->setForceUseCustomerRequiredAttributes(!$this->isCustomerLoggedIn())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?></li>
43
+ <li class="fields">
44
+ <div class="field">
45
+ <label for="billing:company"><?php echo $this->__('Company') ?></label>
46
+ <div class="input-box">
47
+ <input type="text" id="billing:company" name="billing[company]" value="<?php echo $this->escapeHtml($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
48
+ </div>
49
+ </div>
50
+ <?php if(!$this->isCustomerLoggedIn()): ?>
51
+ <div class="field">
52
+ <label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
53
+ <div class="input-box">
54
+ <input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->escapeHtml($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
55
+ </div>
56
+ </div>
57
+ <?php endif; ?>
58
+ </li>
59
+ <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
60
+ <li class="wide">
61
+ <label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
62
+ <div class="input-box">
63
+ <input type="text" title="<?php echo $this->__('Street Address') ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
64
+ </div>
65
+ </li>
66
+ <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
67
+ <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
68
+ <li class="wide">
69
+ <div class="input-box">
70
+ <input type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>" name="billing[street][]" id="billing:street<?php echo $_i ?>" value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>" class="input-text <?php echo $_streetValidationClass ?>" />
71
+ </div>
72
+ </li>
73
+ <?php endfor; ?>
74
+ <?php if ($this->helper('customer/address')->isVatAttributeVisible()) : ?>
75
+ <li class="wide">
76
+ <label for="billing:vat_id"><?php echo $this->__('VAT Number') ?></label>
77
+ <div class="input-box">
78
+ <input type="text" id="billing:vat_id" name="billing[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('vat_id') ?>" />
79
+ </div>
80
+ </li>
81
+ <?php endif; ?>
82
+ <li class="fields">
83
+ <div class="field">
84
+ <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
85
+ <div class="input-box">
86
+ <input type="text" title="<?php echo $this->__('City') ?>" name="billing[city]" value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="billing:city" />
87
+ </div>
88
+ </div>
89
+ <div class="field">
90
+ <label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
91
+ <div class="input-box">
92
+ <select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
93
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
94
+ </select>
95
+ <script type="text/javascript">
96
+ //<![CDATA[
97
+ $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
98
+ //]]>
99
+ </script>
100
+ <input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
101
+ </div>
102
+ </div>
103
+ </li>
104
+ <li class="fields">
105
+ <div class="field">
106
+ <label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
107
+ <div class="input-box">
108
+ <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
109
+ </div>
110
+ </div>
111
+ <div class="field">
112
+ <label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
113
+ <div class="input-box">
114
+ <?php echo $this->getCountryHtmlSelect('billing') ?>
115
+ </div>
116
+ </div>
117
+ </li>
118
+ <li class="fields">
119
+ <div class="field">
120
+ <label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
121
+ <div class="input-box">
122
+ <input type="text" name="billing[telephone]" value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" id="billing:telephone" />
123
+ </div>
124
+ </div>
125
+ <div class="field">
126
+ <label for="billing:fax"><?php echo $this->__('Fax') ?></label>
127
+ <div class="input-box">
128
+ <input type="text" name="billing[fax]" value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('fax') ?>" id="billing:fax" />
129
+ </div>
130
+ </div>
131
+ </li>
132
+ <?php if(!$this->isCustomerLoggedIn()): ?>
133
+
134
+ <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
135
+ <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
136
+ <?php if ($_dob->isEnabled() || $_gender->isEnabled()): ?>
137
+ <li class="fields">
138
+ <?php if ($_dob->isEnabled()): ?>
139
+ <div class="field">
140
+ <?php echo $_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
141
+ </div>
142
+ <?php endif; ?>
143
+ <?php if ($_gender->isEnabled()): ?>
144
+ <div class="field">
145
+ <?php echo $_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
146
+ </div>
147
+ <?php endif ?>
148
+ </li>
149
+ <?php endif ?>
150
+
151
+ <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
152
+ <?php if ($_taxvat->isEnabled()): ?>
153
+ <li>
154
+ <?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
155
+ </li>
156
+ <?php endif ?>
157
+
158
+ <li class="fields" id="register-customer-password">
159
+ <div class="field">
160
+ <label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
161
+ <div class="input-box">
162
+ <input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
163
+ </div>
164
+ </div>
165
+ <div class="field">
166
+ <label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
167
+ <div class="input-box">
168
+ <input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
169
+ </div>
170
+ </div>
171
+ </li>
172
+ <?php endif; ?>
173
+ <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
174
+ <li class="control">
175
+ <input type="checkbox" name="billing[save_in_address_book]" value="1" title="<?php echo $this->__('Save in address book') ?>" id="billing:save_in_address_book" onchange="if(window.shipping) shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()):?> checked="checked"<?php endif;?> class="checkbox" /><label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
176
+ </li>
177
+ <?php else:?>
178
+ <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
179
+ <?php endif; ?>
180
+ <?php echo $this->getChildHtml('form.additional.info'); ?>
181
+ <?php echo $this->getLayout()->createBlock('engine/newsletter')->toHtml(); ?>
182
+ </ul>
183
+ </fieldset>
184
+ </li>
185
+ <?php /* Extensions placeholder */ ?>
186
+ <?php echo $this->getChildHtml('checkout.onepage.billing.extra')?>
187
+ <?php if ($this->canShip()): ?>
188
+ <li class="control">
189
+ <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1"<?php if ($this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo $this->__('Ship to this address') ?>" onclick="$('shipping:same_as_billing').checked = true;" class="radio" /><label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label></li>
190
+ <li class="control">
191
+ <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0"<?php if (!$this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> title="<?php echo $this->__('Ship to different address') ?>" onclick="$('shipping:same_as_billing').checked = false;" class="radio" /><label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address') ?></label>
192
+ </li>
193
+ <?php endif; ?>
194
+ </ul>
195
+ <?php if (!$this->canShip()): ?>
196
+ <input type="hidden" name="billing[use_for_shipping]" value="1" />
197
+ <?php endif; ?>
198
+ <div class="buttons-set" id="billing-buttons-container">
199
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
200
+ <button type="button" title="<?php echo $this->__('Continue') ?>" class="button" onclick="billing.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
201
+ <span class="please-wait" id="billing-please-wait" style="display:none;">
202
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
203
+ </span>
204
+ </div>
205
+ </fieldset>
206
+ </form>
207
+ <script type="text/javascript">
208
+ //<![CDATA[
209
+ var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
210
+ var billingForm = new VarienForm('co-billing-form');
211
+
212
+ //billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
213
+ $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
214
+
215
+ var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
216
+ //]]>
217
+ </script>
app/design/frontend/base/default/template/engine/ecommerce_pixel.phtml ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Is the module activated?
3
+ if ($this->isEcommerce()) {
4
+ // Do we have an order?
5
+ $_order = $this->getOrder();
6
+ if ($_order !== false) {
7
+ $orderID = $_order->getData($this->getTransactionIdField());
8
+ $clientID = $this->getENgineID();
9
+ $subdomain = $this->getENgineSubdomain();
10
+ $customer = $this->getENgineCustomer();
11
+ $addShipping = $this->getIncludeShipping();
12
+ $includeTax = $this->getIncludeTax();
13
+
14
+ $isSecure = Mage::app()->getStore()->isCurrentlySecure();
15
+ $pixelURL = $isSecure ? 'https://' . $customer . '.e-ngine.nl/' : $subdomain;
16
+
17
+ $shipping = $_order->getShippingAmount() * 100;
18
+ if ($includeTax) {
19
+ $shipping = $_order->getShippingInclTax () * 100;
20
+ }
21
+
22
+ //$grandTotal = $_order->getGrandTotal() * 100;
23
+ $grandTotal = 0;
24
+
25
+ echo '<script type="text/javascript">' . PHP_EOL;
26
+ echo 'function ENgine_tracker_initialized()' . PHP_EOL;
27
+ echo '{' . PHP_EOL;
28
+ echo ' ENgine_tracker._setLeadData("' . $clientID . '", "sale", "' . $orderID . '");' . PHP_EOL;
29
+ if ($shipping > 0 && $addShipping) {
30
+ $name = $_order->getShippingDescription();
31
+ $category = 'Shipping costs';
32
+
33
+ $grandTotal += $shipping;
34
+ echo ' ENgine_tracker._addRow("' . $name . '", "' . $category . '", "' . $shipping . '", "1");' . PHP_EOL;
35
+ }
36
+ foreach($_order->getAllVisibleItems() as $_item) {
37
+ if($_item->getParentItem()) continue;
38
+ $name = str_replace('\'','', $_item->getName());
39
+ $category = 'Products';
40
+ $price = $_item->getPrice() * 100;
41
+ if ($includeTax) {
42
+ $price = $_item->getPriceInclTax () * 100;
43
+ }
44
+ $nr = (int) $_item->getQtyOrdered();
45
+
46
+ $grandTotal += $price * $nr;
47
+ echo ' ENgine_tracker._addRow("' . $name . '", "' . $category . '", "' . $price . '", "' . $nr . '");' . PHP_EOL;
48
+ }
49
+ echo ' ENgine_tracker._process();' . PHP_EOL;
50
+ echo '}' . PHP_EOL;
51
+ echo '</script>' . PHP_EOL;
52
+ echo '<script type="text/javascript">' . PHP_EOL;
53
+ echo 'var ENgine_tracker_hostname = "' . $pixelURL . '";' . PHP_EOL;
54
+ echo 'document.write(unescape("%3Cscript src=\'" + ENgine_tracker_hostname + "mail/ENgine_tracker.js\' type=\'text/javascript\'%3E%3C/script%3E"));' . PHP_EOL;
55
+ echo '</script>' . PHP_EOL;
56
+ echo '<noscript><img src="' . $pixelURL . 'mail/lead.php?cid=' . $clientID . '&amp;type=sale&amp;uid=' . $orderID . '&amp;total=' . $grandTotal . '" width="1" height="1" alt="" /></noscript>';
57
+
58
+ echo $this->getChildHtml();
59
+ }
60
+ }
app/design/frontend/base/default/template/engine/newsletter.phtml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * You can also use this block on your own billing page.
4
+ * Use this snippet to include the file:
5
+ *
6
+ * echo $this->getLayout()->createBlock('engine/newsletter')->toHtml();
7
+ */
8
+
9
+
10
+ $helper = Mage::helper('engine/connect');
11
+ if ($helper->isENgineSetup()) {
12
+ $checked = false;
13
+ ?>
14
+ <li id="engine-register" class="control">
15
+ <input type="checkbox" <?php echo $checked ? ' checked="checked"' : ''; ?> name="billing[is_subscribed]" value="1" title="<?php echo Mage::helper('customer')->__('Sign up for newsletter') ?>" id="billing:is_subscribed" />
16
+ <label for="billing:is_subscribed"><?php echo Mage::helper('customer')->__('Sign up for newsletter') ?></label>
17
+ </li>
18
+ <?php
19
+ }
app/etc/modules/Engine_Engine.xml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * E-ngine Extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Engine
17
+ * @package Engine_Engine
18
+ * @author Michiel van de Vis
19
+ * @copyright Copyright (c) 2014 E-ngine BV (www.e-ngine.nl)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+ -->
23
+ <config>
24
+ <modules>
25
+ <Engine_Engine>
26
+ <active>true</active>
27
+ <codePool>community</codePool>
28
+ </Engine_Engine>
29
+ </modules>
30
+ </config>
app/locale/en_US/Engine_Engine.csv ADDED
@@ -0,0 +1 @@
 
1
+ "Engine","E-ngine"
app/locale/nl_NL/Engine_Engine.csv ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Engine","E-ngine"
2
+ "You will receive a confirmation email to confirm your subscription","U zult een mail ontvangen waarmee u uw lidmaatschap kunt bevestigen."
3
+ "There was a problem with the newsletter subscription: %s","Er was een probleem bij het doorvoeren van de nieuwsbrief aanmelding: %s"
4
+ "There was a problem with the newsletter subscription","Er was een probleem bij het doorvoeren van de nieuwsbrief aanmelding"
5
+ "Magento field name","Magento veldnaam"
6
+ "E-ngine field name","E-ngine veldnaam"
7
+ "Add extra field","Extra veld toevoegen"
8
+ "Wrong column name specified.","Foutieve kolom opgegeven."
9
+ "E-ngine transactional e-mail cache","E-ngine transactionele e-mail cache"
10
+ "The E-ngine mailing IDs are cached to prevent redundant calls to E-ngine. Refresh this cache after changing a template in E-ngine or the subject in the settings.","De IDs van de E-ngine mailings worden in een cache opgeslagen om onnodige calls naar E-ngine te voorkomen. Reset de E-ngine cache nadat de inhoud of onderwerpen van mailings zijn aangepast via Magento."
11
+ "E-ngine Configuration","E-ngine configuratie"
12
+ "Login settings","Inloggegevens"
13
+ "E-ngine Customer","E-ngine Klant"
14
+ "This is the name of your E-ngine account which also can be found in the URL when you login to E-ngine.","Dit is de naam van uw E-ngine klant account. Deze waarde kan ook worden teruggevonden in de URL wanneer u inlogt in E-ngine."
15
+ "E-ngine Username","E-ngine Gebruikersnaam"
16
+ "This is the E-ngine username which can be used to login. Please create a SOAP user in E-ngine.","Dit is de E-ngine gebruikersnaam die wordt gebruikt om in te loggen. Creeer een SOAP gebruiker in E-ngine voor dit doel."
17
+ "E-ngine Password","E-ngine Wachtwoord"
18
+ "This is the E-ngine password which can be used to login. Please create a SOAP user in E-ngine.","Dit is het E-ngine wachtwoord dat wordt gebruikt om in te loggen. Creeer een SOAP gebruiker in E-ngine voor dit doel."
19
+ "Mailinglist ID","Mailinglijst ID"
20
+ "This is the E-ngine mailinglist for which the users should be subscribed.","Geef het ID van de mailinglijst op waar de abonnees lid van moeten worden."
21
+ "Extra fields","Extra velden"
22
+ "These extra fields will be added to the subscriber data while syncing to E-ngine.","Deze extra velden worden toegevoegd aan de abonnees wanneer ze worden doorgegeven aan E-ngine."
23
+ "Campaign management","Campagne beheer"
24
+ "Action ID - Signup form","Actieflow ID - Aanmeld formulier"
25
+ "This is the E-ngine action ID which should be used when the signup form is used.","Deze actieflow ID wordt gebruikt wanneer abonnees zich via het aanmeldformulier aanmelden."
26
+ "Action ID - Order","Actieflow ID - Aankoop"
27
+ "This is the E-ngine action ID which should be used when a subscriber signs up during an order.","Deze actieflow ID wordt gebruikt wanneer abonnees zich aanmelden tijden het doen van een aankoop."
28
+ "Action ID - Account","Actieflow ID - Account"
29
+ "This is the E-ngine action ID which should be used when a users subscribes from their account.","Deze actieflow ID wordt gebruikt wanneer abonnees zich aanmelden bij het bewerken van hun profiel."
30
+ "Marketing","Marketing"
31
+ "Enable ecommerce pixel","Marketing module activeren"
32
+ "Should an pixel be placed on the 'success' page after completing an order? This makes the turnover from your newsletter visible in E-ngine.","Dient er een meetpixel te worden geplaatst op de 'bedankt' pagina na het voltooien van een aankoop. Dit zorgt er voordat de omzet van uw nieuwsbrief in E-ngine zichtbaar wordt."
33
+ "E-ngine client/mailinglist ID","E-ngine klant/mailinglijst ID"
34
+ "This is the E-ngine client/mailinglist ID which can be found in the marketing pixel example on the page Marketing > Lead Tracking API.","Dit is een combinatie van uw E-ngine klant/mailinglijst ID. U kunt dit terugvinden op de pagina Marketing > Lead Tracking API (formaat: 1a2b3c4d5e__1a2b3c4d5e)"
35
+ "E-ngine subdomain","E-ngine subdomein"
36
+ "This is the E-ngine subdomain which is setup for the specified mailinglist.","Het E-ngine subdomein dat staat ingesteld voor de aangegeven mailinglijst in E-ngine (bv http://newsletter.uwdomein.nl)"
37
+ "Checkout Success Page URL","Bedankt pagina URL"
38
+ "Please type in the relative URL of your checkout success page url. Standard is /checkout/onepage/success","Dit is de relatieve URL van uw bedankt pagina. Standaard is dit /checkout/onepage/succes"
39
+ "Include shipping costs?","Verzendkosten opnemen?"
40
+ "If enabled, the value in the marketing pixel will also include the shipping costs and the shipping costs will be added as a seperate product in the pixel.","Indien geactiveerd worden in de meetpixel ook de verzendkosten opgenomen. Er wordt een aparte regel toegevoegd zodat de verzendkosten afzondelijk in E-ngine terug komen."
41
+ "Include tax?","BTW opnemen?"
42
+ "If enabled, the value in the marketing pixel will also include tax.","Indien geactiveerd worden de prijzen in de meetpixel inclusief BTW doorgegeven."
43
+ "Transactional e-mail","Transactionele e-mail"
44
+ "Enable transactional e-mail via E-ngine","Verstuur transactionele e-mail via E-ngine"
45
+ "Should the transactional emails (order confirmation / new signups / etc.) be sent by E-ngine?","Indien geactiveerd worden transactionele emails (order bevestigingen / nieuwe klanten / etc.) via E-ngine verzonden."
46
+ "Enable testing mode?","Test modus actief?"
47
+ "Should the transactional mails be sent to specified test addresses? In this case, the regular subscribers will receive the mail via the Magento default setup.","Als de test modus actief is, wordt enkel het opgegeven adres via E-ngine gemaild. De klanten ontvangen de mails op de reguliere wijze via Magento."
48
+ "Test address","Test e-mailadres"
49
+ "This test address will receive the transactional mails sent by E-ngine","Dit e-mailadres zal een kopie van alle transactionele e-mail ontvangen via E-ngine."
50
+ "E-ngine Config Section","E-ngine Configuratie Sectie"
51
+ "Synchronize subscribers","Abonnees synchroniseren"
52
+ "Should Magento synchronize the subscribers to E-ngine? This will automatically subscribe/unsubscribe users in E-ngine if a user subscribers to your store its newsletter through a signup box or their account.","Dient Magento de abonnees naar E-ngine te synchroniseren? Dit zal abonnees automatisch aan/afmelden in E-ngine wanneer ze zich aanmelden via een box of via hun account."
package.xml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Engine</name>
4
+ <version>1.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This extension will link Magento to E-ngine</summary>
10
+ <description>The extension has the following features:&#xD;
11
+ - automatically subscribe users using the 'sign up' box&#xD;
12
+ - automatically (un-) subscribe users when they change their status in the account&#xD;
13
+ - adds checkbox to order process to have clients subscribe to the newsletter&#xD;
14
+ - insert marketing pixel after an order has been placed&#xD;
15
+ - automatically send all transational mail through E-ngine</description>
16
+ <notes># 1.1.0&#xD;
17
+ First release of the E-ngine Magento plugin with support for:&#xD;
18
+ &#xD;
19
+ - Signup using using box&#xD;
20
+ - Signup using while ordering&#xD;
21
+ - Signup through account&#xD;
22
+ - Setup E-ngine marketing pixel&#xD;
23
+ - Send transactional mail through E-ngine&#xD;
24
+ - Added language packs&#xD;
25
+ - Newsletter subscriber sync is now optional&#xD;
26
+ </notes>
27
+ <authors><author><name>M. van de Vis</name><user>enginenl</user><email>m.vandevis@e-ngine.nl</email></author></authors>
28
+ <date>2014-10-02</date>
29
+ <time>07:30:13</time>
30
+ <contents><target name="magecommunity"><dir name="Engine"><dir name="Engine"><dir name="Block"><file name="Ecommerce.php" hash="88ea3d0710e17a9045f17c61f84ce9c4"/><file name="Extrafields.php" hash="befa463ac7060d97b99c54baaee42c61"/><file name="Newsletter.php" hash="26d76a49cd5d0bf3838d46ebedd94f92"/></dir><dir name="Helper"><file name="Connect.php" hash="aa0e398907c56af8d0976427f567c95a"/><file name="Data.php" hash="075e5242e0b5ff0d678fccbf18548742"/></dir><dir name="Model"><dir name="Checkout"><dir name="Type"><file name="Onepage.php" hash="19c9e3f325e6c91b4db5ba56764304c2"/></dir></dir><dir name="Core"><dir name="Email"><file name="Template.php" hash="9873c4f6a9f3c1e915f41b0bfb6344ea"/></dir></dir><file name="Cron.php" hash="d554f144f816b05b8b3d4190dc5237f7"/><file name="Observer.php" hash="a6026edb5c9008b90ae4c51001b6fe9f"/><file name="Subscriber.php" hash="6eaee6af43c8f29736cf7cbe14178cc4"/></dir><dir name="controllers"><dir name="Admin"><dir name="Newsletter"><file name="SubscriberController.php" hash="a6a536209e38612815f979d456166f02"/></dir><dir name="System"><dir name="Email"><file name="TemplateController.php" hash="2ddc7f92c2d934ea25bdd0ab78e617cb"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="62d552b7eb0a876f74c7969101bdfc7e"/><file name="system.xml" hash="96ad5731b376f2db2d85da633d1d0a02"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="engine"><dir><dir name="field"><file name="extra_field.phtml" hash="a29bce9f955b3512e3b368b29e0f057f"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="engine.xml" hash="43416b891659bc33fac78231f2e622af"/></dir><dir name="template"><dir name="engine"><file name="default-checkout-onepage-billing.phtml" hash="bef746845a6b7f2f2e5c028954556265"/><file name="ecommerce_pixel.phtml" hash="df46aa0cf685c19ccca3113d19c5e11f"/><file name="newsletter.phtml" hash="f3e7164fb569bc0690532ce161ca84c2"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Engine_Engine.xml" hash="850b7e1f8ce6af9e8dd39584e819da0e"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Engine_Engine.csv" hash="0a7c622392cd7b5af66bbec45d32ebb7"/></dir><dir name="nl_NL"><file name="Engine_Engine.csv" hash="1aecf8be32f55b4745463a45e1033497"/></dir></target></contents>
31
+ <compatible/>
32
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name/><channel>connect.magentocommerce.com/core</channel><min/><max/></package></required></dependencies>
33
+ </package>