eDialogEnterprise - Version 1.0.0

Version Notes

Initial Release.

Download this release

Release Info

Developer True Action Edialog
Extension eDialogEnterprise
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (71) hide show
  1. app/code/community/TrueAction/EDialogMarketing/Block/Adminhtml/System/Form/Renderer/Config/HeadingComment.php +25 -0
  2. app/code/community/TrueAction/EDialogMarketing/Block/Adminhtml/System/Form/Renderer/Config/RegisterButton.php +60 -0
  3. app/code/community/TrueAction/EDialogMarketing/Block/Beacon.php +97 -0
  4. app/code/community/TrueAction/EDialogMarketing/Block/Checkout/Onepage/Billing.php +37 -0
  5. app/code/community/TrueAction/EDialogMarketing/Block/Customer/Newsletter.php +20 -0
  6. app/code/community/TrueAction/EDialogMarketing/Block/Newsletter/Subscribe.php +20 -0
  7. app/code/community/TrueAction/EDialogMarketing/Block/Unsubscribe.php +70 -0
  8. app/code/community/TrueAction/EDialogMarketing/Helper/Data.php +58 -0
  9. app/code/community/TrueAction/EDialogMarketing/Helper/Xfabric.php +71 -0
  10. app/code/community/TrueAction/EDialogMarketing/LICENSE.TXT +81 -0
  11. app/code/community/TrueAction/EDialogMarketing/Model/Container/Beacon.php +16 -0
  12. app/code/community/TrueAction/EDialogMarketing/Model/Observer.php +136 -0
  13. app/code/community/TrueAction/EDialogMarketing/controllers/Adminhtml/Edialogmarketing/RegisterController.php +15 -0
  14. app/code/community/TrueAction/EDialogMarketing/controllers/SubscriberController.php +89 -0
  15. app/code/community/TrueAction/EDialogMarketing/etc/adminhtml.xml +29 -0
  16. app/code/community/TrueAction/EDialogMarketing/etc/cache.xml +18 -0
  17. app/code/community/TrueAction/EDialogMarketing/etc/config.xml +175 -0
  18. app/code/community/TrueAction/EDialogMarketing/etc/system.xml +95 -0
  19. app/code/community/TrueAction/EDialogTransactional/Block/Adminhtml/Productiontoggle.php +37 -0
  20. app/code/community/TrueAction/EDialogTransactional/Helper/Data.php +279 -0
  21. app/code/community/TrueAction/EDialogTransactional/LICENSE.TXT +81 -0
  22. app/code/community/TrueAction/EDialogTransactional/Model/Core/Email/Template.php +190 -0
  23. app/code/community/TrueAction/EDialogTransactional/Model/Message.php +239 -0
  24. app/code/community/TrueAction/EDialogTransactional/Model/Message/Accountconfirm.php +33 -0
  25. app/code/community/TrueAction/EDialogTransactional/Model/Message/Accountconfirmed.php +23 -0
  26. app/code/community/TrueAction/EDialogTransactional/Model/Message/Accountnew.php +24 -0
  27. app/code/community/TrueAction/EDialogTransactional/Model/Message/Creditmemoupdate.php +33 -0
  28. app/code/community/TrueAction/EDialogTransactional/Model/Message/Giftregistryshare.php +29 -0
  29. app/code/community/TrueAction/EDialogTransactional/Model/Message/Giftregistryupdate.php +31 -0
  30. app/code/community/TrueAction/EDialogTransactional/Model/Message/Invite.php +24 -0
  31. app/code/community/TrueAction/EDialogTransactional/Model/Message/Invoiceupdate.php +33 -0
  32. app/code/community/TrueAction/EDialogTransactional/Model/Message/Newcreditmemo.php +46 -0
  33. app/code/community/TrueAction/EDialogTransactional/Model/Message/Newgiftcardadmin.php +23 -0
  34. app/code/community/TrueAction/EDialogTransactional/Model/Message/Newgiftcardcustomer.php +29 -0
  35. app/code/community/TrueAction/EDialogTransactional/Model/Message/Newgiftregistry.php +29 -0
  36. app/code/community/TrueAction/EDialogTransactional/Model/Message/Newinvoice.php +46 -0
  37. app/code/community/TrueAction/EDialogTransactional/Model/Message/Neworder.php +40 -0
  38. app/code/community/TrueAction/EDialogTransactional/Model/Message/Newpassword.php +24 -0
  39. app/code/community/TrueAction/EDialogTransactional/Model/Message/Newrma.php +40 -0
  40. app/code/community/TrueAction/EDialogTransactional/Model/Message/Newshipment.php +52 -0
  41. app/code/community/TrueAction/EDialogTransactional/Model/Message/Orderupdate.php +29 -0
  42. app/code/community/TrueAction/EDialogTransactional/Model/Message/Pointsexpiring.php +29 -0
  43. app/code/community/TrueAction/EDialogTransactional/Model/Message/Pointsupdate.php +32 -0
  44. app/code/community/TrueAction/EDialogTransactional/Model/Message/Resetpassword.php +31 -0
  45. app/code/community/TrueAction/EDialogTransactional/Model/Message/Rmaauth.php +39 -0
  46. app/code/community/TrueAction/EDialogTransactional/Model/Message/Rmaupdate.php +32 -0
  47. app/code/community/TrueAction/EDialogTransactional/Model/Message/Sendfriend.php +26 -0
  48. app/code/community/TrueAction/EDialogTransactional/Model/Message/Shipmentupdate.php +33 -0
  49. app/code/community/TrueAction/EDialogTransactional/Model/Message/Storecredit.php +20 -0
  50. app/code/community/TrueAction/EDialogTransactional/Model/Message/Wishlistshare.php +29 -0
  51. app/code/community/TrueAction/EDialogTransactional/Model/Mysql4/Queue.php +14 -0
  52. app/code/community/TrueAction/EDialogTransactional/Model/Mysql4/Queue/Collection.php +14 -0
  53. app/code/community/TrueAction/EDialogTransactional/Model/Observer.php +72 -0
  54. app/code/community/TrueAction/EDialogTransactional/Model/Queue.php +14 -0
  55. app/code/community/TrueAction/EDialogTransactional/controllers/Adminhtml/EdialogtransactionalController.php +28 -0
  56. app/code/community/TrueAction/EDialogTransactional/etc/config.xml +134 -0
  57. app/code/community/TrueAction/EDialogTransactional/etc/system.xml +126 -0
  58. app/code/community/TrueAction/EDialogTransactional/sql/edialog_transactional_setup/mysql4-install-0.1.0.php +19 -0
  59. app/design/adminhtml/default/default/layout/edialogmarketing.xml +15 -0
  60. app/design/adminhtml/default/default/template/edialogmarketing/beacon.phtml +18 -0
  61. app/design/adminhtml/default/default/template/edialogmarketing/checkout/onepage/billing.phtml +214 -0
  62. app/design/adminhtml/default/default/template/edialogmarketing/register/view.phtml +24 -0
  63. app/design/adminhtml/default/default/template/edialogmarketing/system/config/register_button.phtml +52 -0
  64. app/design/adminhtml/default/default/template/edialogmarketing/unsubscribe.phtml +30 -0
  65. app/design/frontend/base/default/layout/edialogmarketing.xml +29 -0
  66. app/design/frontend/base/default/template/edialogmarketing/beacon.phtml +18 -0
  67. app/design/frontend/base/default/template/edialogmarketing/checkout/onepage/billing.phtml +214 -0
  68. app/design/frontend/base/default/template/edialogmarketing/unsubscribe.phtml +30 -0
  69. app/etc/modules/TrueAction_EDialogMarketing.xml +19 -0
  70. app/etc/modules/TrueAction_EDialogTransactional.xml +16 -0
  71. package.xml +35 -0
app/code/community/TrueAction/EDialogMarketing/Block/Adminhtml/System/Form/Renderer/Config/HeadingComment.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogMarketing
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogMarketing_Block_Adminhtml_System_Form_Renderer_Config_HeadingComment
9
+ extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
10
+ {
11
+ /**
12
+ * Render element html
13
+ *
14
+ * @param Varien_Data_Form_Element_Abstract $element
15
+ * @return string
16
+ */
17
+ public function render(Varien_Data_Form_Element_Abstract $element)
18
+ {
19
+ return sprintf('<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5">'
20
+ . '<h4 id="%s">%s</h4><div id="system-fieldset-sub-head-comment">%s</div></td></tr>',
21
+ $element->getHtmlId(), $element->getHtmlId(),
22
+ $element->getLabel(), $element->getComment()
23
+ );
24
+ }
25
+ }
app/code/community/TrueAction/EDialogMarketing/Block/Adminhtml/System/Form/Renderer/Config/RegisterButton.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogMarketing
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogMarketing_Block_Adminhtml_System_Form_Renderer_Config_RegisterButton
9
+ extends Mage_Adminhtml_Block_System_Config_Form_Field
10
+ implements Varien_Data_Form_Element_Renderer_Interface
11
+ {
12
+
13
+ protected $_template = 'edialogmarketing/system/config/register_button.phtml';
14
+
15
+ /**
16
+ * Unset scope label and pass further to parent render()
17
+ *
18
+ * @param Varien_Data_Form_Element_Abstract $element
19
+ * @return string
20
+ */
21
+ public function render(Varien_Data_Form_Element_Abstract $element)
22
+ {
23
+ /* only show this button if the capability has not yet been onboarded
24
+ if ($capabilityIsOnboarded) {
25
+ return '';
26
+ }
27
+ */
28
+ // Unset the scope label near the button
29
+ $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
30
+ $html = sprintf(
31
+ '<tr class="system-fieldset-sub-head" id="row_%1$s">
32
+ <td colspan="5">
33
+ %2$s
34
+ </td>
35
+ </tr>',
36
+ $element->getHtmlId(),
37
+ $this->_getElementHtml($element)
38
+ );
39
+ return $html;
40
+ }
41
+
42
+ /**
43
+ * Get the button and scripts contents
44
+ *
45
+ * @param Varien_Data_Form_Element_Abstract $element
46
+ * @return string
47
+ */
48
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
49
+ {
50
+ $originalData = $element->getOriginalData();
51
+ $this->addData(array(
52
+ 'button_label' => Mage::helper('edialogmarketing')->__($originalData['button_label']),
53
+ 'html_id' => $element->getHtmlId(),
54
+ 'button_url' => trim($originalData['button_url']),
55
+ 'element_label' => $element->getLabel(),
56
+ 'element_comment' => $element->getComment(),
57
+ ));
58
+ return $this->_toHtml();
59
+ }
60
+ }
app/code/community/TrueAction/EDialogMarketing/Block/Beacon.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogMarketing
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ *
7
+ * The web beacon added for tracking subscription changes and pinging e-Dialog
8
+ */
9
+ class TrueAction_EDialogMarketing_Block_Beacon extends Mage_Core_Block_Template
10
+ {
11
+ /**
12
+ * Object representing the user/subscriber
13
+ *
14
+ * Mage_Newsletter_Model_Subscriber
15
+ */
16
+ protected $_subscriber;
17
+
18
+ /**
19
+ * Set default template
20
+ */
21
+ public function _construct()
22
+ {
23
+ $this->setTemplate('edialogmarketing/beacon.phtml');
24
+ }
25
+
26
+ /**
27
+ * Should the web beacon be added
28
+ * Ensures edialogmarketing is enabled and merchant id is set
29
+ *
30
+ * @return bool
31
+ */
32
+ public function showBeacon()
33
+ {
34
+ $helper = Mage::helper('edialogmarketing');
35
+ $merchantChannel = $helper->getMerchantChannel();
36
+ return ($helper->isEnabled() && !empty($merchantChannel));
37
+ }
38
+
39
+ /**
40
+ * Sets subscriber object
41
+ *
42
+ * @param $subscriber Mage_Newsletter_Model_Subscriber
43
+ * @return TrueAction_EDialogMarketing_Block_Beacon
44
+ */
45
+ public function setSubscriber(Mage_Newsletter_Model_Subscriber $subscriber)
46
+ {
47
+ $this->_subscriber = $subscriber;
48
+ return $this;
49
+ }
50
+
51
+ /**
52
+ * Returns subscription channel
53
+ */
54
+ public function getCreationSource()
55
+ {
56
+ if ($this->hasData('subscription_source')) {
57
+ return $this->getSubscriptionSource();
58
+ } else {
59
+ return Mage::helper('edialogmarketing')->getDefaultSource();
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Retrieves URL for the web beacon
65
+ * Assemble URL from subscriber and config
66
+ *
67
+ * @return string
68
+ */
69
+ public function getBeaconUrl()
70
+ {
71
+ if (!empty($this->_subscriber)) {
72
+ $subscriber = $this->_subscriber;
73
+ $helper = Mage::helper('edialogmarketing');
74
+ $optIn = $subscriber->isSubscribed() ? 'Y' : 'N';
75
+
76
+ $ln = null;
77
+ $fn = null;
78
+ if ($subscriber->hasData('customer_id')) {
79
+ $customer = Mage::getModel('customer/customer')->load($subscriber->getCustomerId());
80
+ $fn = $customer->getFirstname();
81
+ $ln = $customer->getLastname();
82
+ }
83
+ $params = array(
84
+ 'e' => $subscriber->getEmail(),
85
+ 'ch' => $helper->getMerchantChannel(),
86
+ 'fn' => $fn,
87
+ 'ln' => $ln,
88
+ 'cs' => $this->getCreationSource(),
89
+ 'of' => $optIn,
90
+ );
91
+ // https://magento.ed4.net/dualpost/unsub/?e=<email>&ch=<channelid>&fn=<firstname>&ln=<lastname>&cs=<creationsource>&of=<Y/N>
92
+ return 'https://magento.ed4.net/dualpost/unsub/?' . http_build_query($params);
93
+ }
94
+ return '';
95
+ }
96
+
97
+ }
app/code/community/TrueAction/EDialogMarketing/Block/Checkout/Onepage/Billing.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogMarketing
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogMarketing_Block_Checkout_Onepage_Billing extends Mage_Checkout_Block_Onepage_Billing
9
+ {
10
+
11
+ /**
12
+ * e-Dialog Marketing opt in checkbox in checkout
13
+ * Determines if the opt in checkbox should be show during checkout
14
+ *
15
+ * @return bool
16
+ */
17
+ public function showNewsletterOptIn()
18
+ {
19
+ // don't show if extension if off
20
+ if (!Mage::helper('edialogmarketing')->isEnabled()) {
21
+ return false;
22
+ }
23
+ // don't show if signup in checkout config is off
24
+ if (!Mage::helper('edialogmarketing')->isCheckoutSignupEnabled()) {
25
+ return false;
26
+ }
27
+ // don't show for already subscribed customers
28
+ if ($this->isCustomerLoggedIn()) {
29
+ $subscriber = Mage::getModel('newsletter/subscriber')->loadByCustomer($this->getCustomer());
30
+ if ($subscriber->isSubscribed()) {
31
+ return false;
32
+ }
33
+ }
34
+ return true;
35
+ }
36
+
37
+ }
app/code/community/TrueAction/EDialogMarketing/Block/Customer/Newsletter.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogMarketing
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogMarketing_Block_Customer_Newsletter extends Mage_Customer_Block_Newsletter
9
+ {
10
+
11
+ public function getCreationSource()
12
+ {
13
+ if ($this->hasData('creation_source')) {
14
+ return $this->getCreationSource();
15
+ } else {
16
+ return Mage::helper('edialogmarketing')->getDefaultSource();
17
+ }
18
+ }
19
+
20
+ }
app/code/community/TrueAction/EDialogMarketing/Block/Newsletter/Subscribe.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogMarketing
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogMarketing_Block_Newsletter_Subscribe extends Mage_Newsletter_Block_Subscribe
9
+ {
10
+
11
+ public function getCreationSource()
12
+ {
13
+ if ($this->hasData('creation_source')) {
14
+ return $this->getCreationSource();
15
+ } else {
16
+ return Mage::helper('edialogmarketing')->getDefaultSource();
17
+ }
18
+ }
19
+
20
+ }
app/code/community/TrueAction/EDialogMarketing/Block/Unsubscribe.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogMarketing
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogMarketing_Block_Unsubscribe extends Mage_Core_Block_Template
9
+ {
10
+
11
+ /**
12
+ * Mage_Newsletter_Model_Subscriber
13
+ */
14
+ protected $_subscriber;
15
+
16
+ /**
17
+ * Sets subscriber
18
+ *
19
+ * @param Mage_Newsletter_Model_Subscriber $subscriber
20
+ * @return TrueAction_EDialogMarketing_Block_Unsubscribe
21
+ */
22
+ public function setSubscriber(Mage_Newsletter_Model_Subscriber $subscriber)
23
+ {
24
+ $this->_subscriber = $subscriber;
25
+ return $this;
26
+ }
27
+
28
+ /**
29
+ * Get an instance of a newsletter subscriber
30
+ * If one has not been set will attempt to load from the logged in customer
31
+ *
32
+ * return Mage_Newsletter_Model_Subscriber
33
+ */
34
+ public function getSubscriber()
35
+ {
36
+ if (empty($this->_subscriber)) {
37
+ $customerSession = Mage::getSingleton('customer/session');
38
+ if ($customerSession->isLoggedIn()) {
39
+ $this->_subscriber = Mage::getModel('newsletter/subscriber')->loadByCustomer($customerSession->getCustomer());
40
+ }
41
+ }
42
+ return $this->_subscriber;
43
+ }
44
+
45
+ /**
46
+ * Gets the subscribers email address
47
+ * Calls getSubscriber which will attempt to set the subscriber to the currently logged in user if subscriber hasn't been set yet
48
+ *
49
+ * @return string
50
+ */
51
+ public function getSubscriberEmail()
52
+ {
53
+ $subscriber = $this->getSubscriber();
54
+ if ($subscriber) {
55
+ return $subscriber->getEmail();
56
+ }
57
+ return '';
58
+ }
59
+
60
+ /**
61
+ * Get the location the unsubscribe form should be POST'ed to
62
+ *
63
+ * @return string
64
+ */
65
+ public function getFormActionUrl()
66
+ {
67
+ return $this->getUrl('subscriptions/subscriber/unsubscribePost');
68
+ }
69
+
70
+ }
app/code/community/TrueAction/EDialogMarketing/Helper/Data.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogMarketing
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ *
7
+ * Helper methods for working with e-Dialog
8
+ * Provides shortcuts to config settings
9
+ */
10
+ class TrueAction_EDialogMarketing_Helper_Data extends Mage_Core_Helper_Abstract
11
+ {
12
+
13
+ const EDIALOGMARKETING_CONFIG_ENABLED = 'email_marketing/edialogmarketing/enabled';
14
+ const EDIALOGMARKETING_CONFIG_DEFAULT_SOURCE = 'email_marketing/edialogmarketing/default_source';
15
+ const EDIALOGMARKETING_CONFIG_MERCHANT_CHANNEL = 'email_marketing/edialogmarketing/merchant_channel';
16
+ const EDIALOG_MARKETING_CONFIG_CHECKOUT_SIGNUP = 'email_marketing/edialogmarketing/checkout_signup';
17
+
18
+ /**
19
+ * Get config flag indicating if e-Dialog Marketing integration is enabled
20
+ *
21
+ * @return bool
22
+ */
23
+ public function isEnabled()
24
+ {
25
+ return Mage::getStoreConfigFlag(self::EDIALOGMARKETING_CONFIG_ENABLED);
26
+ }
27
+
28
+ /**
29
+ * Get config value for e-Dialog default creation source
30
+ *
31
+ * @return string
32
+ */
33
+ public function getDefaultSource()
34
+ {
35
+ return Mage::getStoreConfig(self::EDIALOGMARKETING_CONFIG_DEFAULT_SOURCE);
36
+ }
37
+
38
+ /**
39
+ * Get config value for e-Dialog merchant channel
40
+ *
41
+ * @return string
42
+ */
43
+ public function getMerchantChannel()
44
+ {
45
+ return Mage::getStoreConfig(self::EDIALOGMARKETING_CONFIG_MERCHANT_CHANNEL);
46
+ }
47
+
48
+ /**
49
+ * Get config flag for e-Dialog checkout signup
50
+ *
51
+ * @return bool
52
+ */
53
+ public function isCheckoutSignupEnabled()
54
+ {
55
+ return Mage::getStoreConfigFlag(self::EDIALOG_MARKETING_CONFIG_CHECKOUT_SIGNUP);
56
+ }
57
+
58
+ }
app/code/community/TrueAction/EDialogMarketing/Helper/Xfabric.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogMarketing
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogMarketing_Helper_XFabric extends Mage_Core_Helper_Data
9
+ {
10
+
11
+ const XML_PATH_EDIALOGMARKETING_CHANNEL_REGISTRATION_TARGET_CAPABILITY_NAME
12
+ = 'email_marketing/edialogmarketing/registration/target_capability_name';
13
+ const XML_PATH_EDIALOGMARKETING_CHANNEL_REGISTRATION_STORE_ENDPOINT_URL
14
+ = 'email_marketing/edialogmarketing/registration/store_endpoint_url';
15
+ const XML_PATH_EDIALOGMARKETING_CHANNEL_REGISTRATION_IS_REGISTERED
16
+ = 'email_marketing/edialogmarketing/registration/is_registered';
17
+ const XML_PATH_EDIALOGMARKETING_CHANNEL_REGISTRATION_REQUEST_URL
18
+ = 'email_marketing/edialogmarketing/registration/registration_url';
19
+ const XML_PATH_EDIALOGMARKETING_CHANNEL_REGISTRATION_LEGAL_AGREEMENT_URL
20
+ = 'email_marketing/edialogmarketing/registration/legal_agreement_url';
21
+
22
+
23
+ /**
24
+ * Check xFabric registration status
25
+ * @return bool
26
+ */
27
+ public function isXfabricRegistered()
28
+ {
29
+ return (bool)Mage::helper('xcom_xfabric')->getResponseAuthorizationKey();
30
+ }
31
+
32
+ public function getRegistrationRequestUrl()
33
+ {
34
+ return Mage::getStoreConfig(self::XML_PATH_EDIALOGMARKETING_CHANNEL_REGISTRATION_REQUEST_URL);
35
+ }
36
+
37
+ public function getRegistrationTargetCapabilityName()
38
+ {
39
+ return Mage::getStoreConfig(self::XML_PATH_EDIALOGMARKETING_CHANNEL_REGISTRATION_TARGET_CAPABILITY_NAME);
40
+ }
41
+
42
+ public function getRegistrationStoreEndpointUrl()
43
+ {
44
+ return Mage::getStoreConfig(self::XML_PATH_EDIALOGMARKETING_CHANNEL_REGISTRATION_STORE_ENDPOINT_URL);
45
+ }
46
+
47
+ public function getRegistrationLegalAgreementUrl()
48
+ {
49
+ return Mage::getStoreConfig(self::XML_PATH_EDIALOGMARKETING_CHANNEL_REGISTRATION_LEGAL_AGREEMENT_URL);
50
+ }
51
+
52
+ /**
53
+ * Retrieve registration request
54
+ *
55
+ * @return Varien_Object
56
+ */
57
+ public function getRegistrationRequest()
58
+ {
59
+ $request = new Varien_Object();
60
+ $postData = array(
61
+ 'target_capability_name' => $this->getRegistrationTargetCapabilityName(),
62
+ 'store_endpoint_url' => $this->getRegistrationStoreEndpointUrl(),
63
+ 'is_registered' => $this->isXfabricRegistered(),
64
+ 'legal_agreement_url' => $this->getRegistrationLegalAgreementUrl(),
65
+ );
66
+ $jsonData = Zend_Json::encode($postData);
67
+ $request->setOnboardingInfo(urlencode($jsonData));
68
+ return $request;
69
+ }
70
+
71
+ }
app/code/community/TrueAction/EDialogMarketing/LICENSE.TXT ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GSI COMMERCE
2
+ MAGENTO CONNECT EXTENSIONS
3
+ END USER LICENSE AGREEMENT
4
+ This End User License Agreement ("Agreement") is made as of July 10, 2012 (the "Effective Date") by and between GSI Interactive, Inc. (dba "TrueAction") ("TrueAction"), a Pennsylvania corporation having its principal place of business at 935 1st Avenue, King of Prussia, PA 19406 USA and the Licensee executing this Agreement.
5
+
6
+ WHEREAS, TrueAction along with its affiliates owned or controlled by GSI Commerce, Inc. (each, a "GSI Company") offer various e-commerce and marketing technology and services to its clients, including, among other things, fulfillment and customer call center services, various marketing technology platform services, and account management and marketing agency services (together, the "GSI Services").
7
+
8
+ WHEREAS, TrueAction desires to grant Licensee a limited licensee to use the applicable Magento Connect integration extension (including the associated documentation, the "Extension") in connection with Licensee's purchase and use of the corresponding GSI Services pursuant to an executed services agreement between Licensee and the applicable GSI Company ("Service Agreement").
9
+
10
+ The parties agree as follows:
11
+ TERMS AND CONDITIONS
12
+ 1. License
13
+ 1.1. Subject to Licensee's payment for the applicable GSI Services pursuant to a Service Agreement and Licensee's compliance with other terms and conditions of a Service Agreement and this Agreement, TrueAction hereby grants Licensee a non-transferable, non-assignable, non-sublicensable, worldwide license to use the Extension, solely for internal purposes, in accordance with the Extension's technical documentation and solely during the term of a Service Agreement.
14
+ 1.2. Licensee shall implement reasonable controls to ensure that it does not use the Extension except as permitted hereunder. TrueAction reserves the right to audit Licensee's use of the Extension during normal business hours and with reasonable notice and to include means within the Extension to limit Licensee's use of the Extension to the use permitted hereunder.
15
+ 1.3. TrueAction shall provide the Extension to Licensee, including the associated technical documentation, for use by Licensee in accordance with this Agreement.
16
+ 1.4. TrueAction may modify the terms of this Agreement at any time upon notice to Licensee, which notice shall be deemed given thirty (30) days following the posting of the modified agreement on the applicable Magento website or other website where the Extension is made available. Continued use of the Extension shall be deemed Licensee's consent and agreement with the modified agreement.
17
+
18
+ 2. License Exclusions and Restrictions
19
+ 2.1. Except as expressly authorized herein, Licensee shall not:
20
+ a. use or deploy the Extension in any manner except in connection with its purchase and use of the GSI Services pursuant to a Service Agreement;
21
+ b. reverse engineer, disassemble, decompile or otherwise attempt to derive the source code or functionality of the Extension, except to the extent allowed under any applicable law;
22
+ c. distribute, sublicense, disclose, market, rent, lease, or offer remote computing services, networking, batch processing or transfer of, the Extension to any third party, or permit any person or entity to have access to the Extension by means of a time sharing, remote computing services, networking, batch processing, service bureau or time sharing arrangement;
23
+ d. export the Extension in violation of U.S. Department of Commerce export administration regulations.
24
+ 2.2. No license, right or interest in any TrueAction or any other GSI Company trademark, trade name or service mark is granted hereunder.
25
+
26
+ 3. Fees
27
+ The Extension is made available to Licensee at no additional charge, subject to Licensee's timely payment for the GSI Services and compliance with a Service Agreement and this Agreement.
28
+
29
+ 4. Title and Protection
30
+ 4.1. TrueAction (or its third party providers) retains title to all portions of the Extension and any copies thereof. The Extension contains valuable proprietary information, and Licensee shall not disclose the Extension to anyone other than those of its employees or consultants under written nondisclosure obligations at least as restrictive as those contained in this Agreement, having a need to know for purposes consistent with this Agreement. Licensee shall be responsible for the compliance of such employees or consultants. Licensee shall affix, to each full or partial copy of the Extension made by Licensee, all copyright and proprietary information notices as were affixed to the original. The obligations set forth in this Section shall survive termination of this Agreement.
31
+ 4.2. If the Extension is acquired by or on behalf of a unit or agency of the U.S. Government (the "Government"), the Government agrees that such Product is "commercial computer software" or "commercial computer software documentation" and that, absent a written agreement to the contrary, the Government's rights with respect to such Product are limited by the terms of this Agreement, pursuant to applicable FAR and/or DFARS and successor regulations.
32
+
33
+ 5. Patent and Copyright Indemnity
34
+ For such time as Licensee is receiving Services pursuant to a Service Agreement, TrueAction shall indemnify and defend Licensee against any claims that the Extension infringes any United States patent or copyright; provided that TrueAction is given prompt notice of such claim and is given information, reasonable assistance and sole authority to defend or settle the claim. In the defense or settlement of the claim, TrueAction shall obtain for Licensee the right to continue using the Extension, replace or modify the Extension so that it becomes non-infringing while giving equivalent performance or, if TrueAction determines that such remedies are not reasonably available, remove the infringing portion of the Extension. TrueAction shall have no liability if the alleged infringement is based on (i) a modification of the Extension by anyone other than, or a combination of the Extension with any product or service not provided by, TrueAction; (ii) use of the Extension other than in accordance with the documentation of this Agreement; or (iii) use of the Extension not in connection with the GSI Services. This Section 5 states TrueAction's entire liability and Licensee's exclusive remedy for infringement.
35
+
36
+ 6. Default and Termination
37
+ 6.1. An event of default shall be deemed to occur if: (i) Licensee fails to perform any of its obligations under this Agreement or is otherwise in breach of this Agreement or a Service Agreement.
38
+ 6.2. If an event of default occurs, the non-defaulting party, in addition to any other rights available to it under the law, may terminate this Agreement and all licenses granted hereunder by written notice to the defaulting party. Remedies shall be cumulative and there shall be no obligation to exercise a particular remedy.
39
+ 6.3. This Agreement and all licenses granted herein shall automatically terminate upon the termination or expiration of the applicable Service Agreement.
40
+ 6.4. Within thirty (30) days after termination of this Agreement, Licensee shall certify in writing to TrueAction that Licensee has ceased use of the Extension and that all copies of the Extension in any form, including partial copies, have been destroyed.
41
+
42
+ 7. Warranty
43
+ 7.1. Warranty. TrueAction warrants for a single period of ninety (90) days commencing upon TrueAction's electronic delivery of the Extension to Licensee that the Extension will in all material respects perform the functions described in the specifications contained in the documentation provided with the Extension. TrueAction will use commercially reasonable efforts to undertake to correct any reported and verifiable error, which shall be TrueAction's entire liability and Licensee's exclusive remedy for errors. TrueAction does not warrant that the Extension will meet Licensee's requirements, that the Extension will operate in the combinations which Licensee may select for use, that the operation of the Extension will be uninterrupted or error-free, or that all error conditions will be corrected. EXCEPT AS PROVIDED IN THIS SECTION ALL SOFTWARE PROVIDED HEREUNDER IS PROVIDED "AS IS".
44
+ 7.2. DISCLAIMER . THE EXPRESS WARRANTIES SET FORTH IN THIS SECTION 7 ARE THE ONLY WARRANTIES MADE BY TRUEACTION WITH RESPECT TO THE EXTENSION PROVIDED BY TRUEACTION. TRUEACTION MAKES NO OTHER WARRANTIES, EXPRESS, IMPLIED OR ARISING BY CUSTOM OR TRADE USAGE, AND, SPECIFICALLY, MAKES NO WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. TRUEACTION'S EXPRESS WARRANTIES SHALL NOT BE ENLARGED, DIMINISHED OR AFFECTED BY, AND NO OBLIGATION OR LIABILITY SHALL ARISE OUT OF, TRUEACTION RENDERING TECHNICAL OR OTHER ADVICE OR SERVICE IN CONNECTION WITH THE EXTENSION.
45
+
46
+ 8. Limitation of Liability
47
+ 8.1. LIABILITY EXCLUSIONS. NOTHING IN THIS AGREEMENT SHALL EXCLUDE OR LIMIT EITHER PARTY'S LIABILITY FOR BREACH OF THE LICENSES OR RELATED RESTRICTIONS CONTAINED HEREIN OR ANY LIABILITY WHICH CANNOT BE EXCLUDED OR LIMITED BY APPLICABLE LAW. SAVE FOR THE FOREGOING, NEITHER PARTY ACCEPTS AND EACH PARTY HEREBY EXCLUDES ANY LIABILITY FOR LOSS OF OR DAMAGE TO TANGIBLE PROPERTY OTHER THAN THAT CAUSED BY ITS NEGLIGENCE AND HEREBY EXCLUDES ANY OTHER LIABILITY FOR NEGLIGENCE ARISING PURSUANT TO THE TERMS OF THIS AGREEMENT. UNDER NO CIRCUMSTANCES WILL EITHER PARTY BE LIABLE FOR: LOSS OF REVENUE; LOSS OF ACTUAL OR ANTICIPATED PROFITS; LOSS OF CONTRACTS; LOSS OF THE USE OF MONEY; LOSS OF ANTICIPATED SAVINGS; LOSS OF BUSINESS; LOSS OF OPPORTUNITY; LOSS OF GOODWILL; LOSS OF REPUTATION; LOSS OF, DAMAGE TO OR CORRUPTION OF DATA; OR CONSEQUENTIAL OR INDIRECT LOSS OR SPECIAL, PUNITIVE, OR INCIDENTAL DAMAGES (INCLUDING, FOR THE AVOIDANCE OF DOUBT, WHERE SUCH LOSS OR DAMAGE IS ALSO OF A CATEGORY OF LOSS OR DAMAGE ALREADY LISTED), WHETHER FORESEEABLE OR UNFORESEEABLE, BASED ON CLAIMS OF LICENSEE, TRUEACTION OR ANY THIRD PARTY ARISING OUT OF ANY BREACH OR FAILURE OF EXPRESS OR IMPLIED WARRANTY CONDITIONS OR OTHER TERM, BREACH OF CONTRACT, MISREPRESENTATION, NEGLIGENCE, OTHER LIABILITY IN TORT, FAILURE OF ANY REMEDY TO ACHIEVE ITS ESSENTIAL PURPOSE, OR OTHERWISE.
48
+
49
+ 8.2. LIABILITY CAP. NOTWITHSTANDING THE FORM (E.G., CONTRACT, TORT, OR OTHERWISE) IN WHICH ANY LEGAL OR EQUITABLE ACTION MAY BE BROUGHT, IN NO EVENT WILL TRUEACTION OR ITS SUPPLIERS BE LIABLE FOR DAMAGES, RESTITUTION OR LOSSES, THAT EXCEED, IN THE AGGREGATE, FOR EACH RESPECTIVE BREACH OR SERIES OF RELATED BREACHES, THE LESSER OF $5,000 OR THE AMOUNT OF FEES PAID BY LICENSEE FOR THE EXTENSION LICENSE IN THE TWELVE (12) MONTH PERIOD PRIOR TO THE DATE ON WHICH THE EVENT GIVING RISE TO SUCH DAMAGES OR LOSSES OCCURRED.
50
+
51
+ 9. Support Services
52
+ No support services are provided under this Agreement. Any support services provided to Licensee will be provided pursuant to a Service Agreement through the applicable GSI Company.
53
+
54
+ 10. Joint Marketing Activities
55
+ The parties agree to undertake the joint marketing activities set forth in Schedule A (Joint Marketing Activities).
56
+
57
+ 11. Notices
58
+ All notices shall be in writing and sent by first class mail or overnight mail (or courier), transmitted by facsimile (if confirmed by such mailing), or email, to the addresses indicated on the first page of this Agreement, or such other address as either party may indicate by at least ten (10) days prior written notice to the other party. Notices to TrueAction shall be sent to the attention of the General Counsel.
59
+
60
+ 12. Assignment
61
+ Licensee may not assign this Agreement without the prior written consent of TrueAction; provided that such consent shall not be required for assignment to a purchaser of all or substantially all of the assets or equity securities of Licensee who undertakes in writing to be bound by all the terms and conditions of this Agreement. Any prohibited assignment shall be null and void.
62
+
63
+ 13. Entire Agreement
64
+ This Agreement is the complete and exclusive agreement between the parties, which supersedes all proposals or prior agreements, oral or written, including any other online (click-through) agreement which Licensee may have accepted in conjunction with the downloading of the Extension, and all other communications between the parties relating to the subject matter hereof. No purchase order, other ordering document or any hand written or typewritten text or email which purports to modify or supplement the printed text hereof or any executed agreement with any GSI Company other than TrueAction shall add to or vary the terms thereof. Except as contained in a writing signed by both parties, all such proposed variations or additions are objected to and shall have no force or effect.
65
+
66
+ 14. General
67
+ This Agreement is made in and shall be governed by the laws of the State of New York, excluding choice of law principles. All proceedings shall be conducted in English. Venue for all proceedings shall be the state and federal courts located in New York, New York, provided that TrueAction may seek injunctive relief in any court of competent jurisdiction. The United Nations Convention for the International Sale of Goods shall not apply. The section headings herein are provided for convenience only and have no substantive effect on the construction of this Agreement. Except for Licensee's license restrictions herein, neither party shall be liable for any failure to perform due to causes beyond its reasonable control. If any provision of this Agreement is held to be unenforceable, this Agreement shall be construed without such provision. The failure by a party to exercise any right hereunder shall not operate as a waiver of such party's right to exercise such right or any other right in the future. This Agreement may be amended only by a written document executed by a duly authorized representative of each of the parties. The parties agree to receive electronic documents and accept electronic signatures (information attached or logically associated with such document and clicked or otherwise adopted with an intent to sign) including in counterparts which shall be valid substitutes for paper-based documents and signatures, and the legal validity of a transaction will not be denied on the ground that it is not in writing.
68
+
69
+ 15. Definitions
70
+ "Updates" means all published revisions and corrections to the printed documentation and corrections and new releases of the Extension which are generally made available to TrueAction's supported customers at no additional cost or for media and handling charges only. Updates shall not include any options or future products which TrueAction sells separately.
71
+
72
+ SCHEDULE A
73
+ TRUEACTION EXTENSION
74
+ JOINT MARKETING ACTIVITIES
75
+ These Joint Marketing Activities are referenced in and incorporated into the End User License Agreement between GSI Interactive, Inc. ("TrueAction") and ("Licensee"), dated July 10, 2012 (the "Agreement").
76
+ 1. Press Releases. Licensee agrees to permit TrueAction to issue a press releases at (i) contract execution announcing the selection of the Extension(s), and (ii) at launch of GSI Services. Licensee will have the right to approve the release in advance, but such approval will not be unreasonably delayed or withheld.
77
+ 2. Use of Licensee Logo. TrueAction shall be permitted to include Licensee's logo on TrueAction's website (including its social media pages) as well as in connection with the Magento Connect website and in printed marketing material.
78
+ 3. Interview. Licensee agrees to designate one of its founders and/or executives to participate in a video and/or written interview to promote the TrueAction Extension.
79
+ 4. Case Study. The parties shall jointly issue a case study based on such use. Licensee's site may be showcased on TrueAction's website.
80
+ 5. Reference. Licensee's employees shall make themselves available to be a reference for the Extension and will provide quotations about how the Extension has contributed to the success of their site or product.
81
+ 6. Other. Additional joint marketing activities may be developed based upon mutual agreement.
app/code/community/TrueAction/EDialogMarketing/Model/Container/Beacon.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogMarketing
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogMarketing_Model_Container_Beacon extends Enterprise_PageCache_Model_Container_Abstract
9
+ {
10
+
11
+ protected function _getCacheId()
12
+ {
13
+ return false;
14
+ }
15
+
16
+ }
app/code/community/TrueAction/EDialogMarketing/Model/Observer.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogMarketing
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ *
7
+ * Observer for TrueAction_EDialogMarketing
8
+ * Observers for newsletter/subscriber saves to set the subscriber change in the session
9
+ * Observers layout generate blocks after to add beacon block to layout after a newsletter/subscriber has been changed
10
+ */
11
+ class TrueAction_EDialogMarketing_Model_Observer {
12
+
13
+ protected function _cleanUpSession()
14
+ {
15
+ Mage::getSingleton('core/session')
16
+ ->unsetData('newsletter_subscription_changed')
17
+ ->unsetData('newsletter_subscription_source')
18
+ ->unsetData('newsletter_will_subscribe');
19
+ }
20
+
21
+ /**
22
+ * Observer for deleted subscribers, ensure they are unsubscribed after deletion
23
+ */
24
+ public function newletterSubscriptionDeleted($observer)
25
+ {
26
+ $subscriber = $observer->getEvent()->getDataObject();
27
+ // Just set status. Don't call unsubscribe as that would have the side effect re-saving the deleted record
28
+ $subscriber->setStatus(Mage_Newsletter_Model_Subscriber::STATUS_UNSUBSCRIBED);
29
+ $this->newsletterSubscriptionChanged($observer);
30
+ }
31
+
32
+ /**
33
+ * Watch for subscriptions to change and add subscriber and signup source to session
34
+ */
35
+ public function newsletterSubscriptionChanged($observer)
36
+ {
37
+ $subscriber = $observer->getEvent()->getDataObject();
38
+ $session = Mage::getSingleton('core/session');
39
+ $subscribersInSession = $session->getNewsletterSubscriptionChanged();
40
+ if (is_array($subscribersInSession)) {
41
+ array_push($subscribersInSession, $subscriber);
42
+ } else {
43
+ $subscribersInSession = array($subscriber);
44
+ }
45
+ $session->setNewsletterSubscriptionChanged($subscribersInSession);
46
+ $sourceParam = Mage::app()->getRequest()->getParam('source');
47
+ if (!empty($sourceParam)) {
48
+ $session->setNewsletterSubscriptionSource($sourceParam);
49
+ }
50
+ }
51
+
52
+ /**
53
+ * Add e-Dialog Marketing web beacon after a subsrciption status has changed
54
+ */
55
+ public function addBeaconAfterSubscriptionChange($observer)
56
+ {
57
+ $session = Mage::getSingleton('core/session');
58
+ $changedSubscribers = $session->getNewsletterSubscriptionChanged();
59
+ if (is_array($changedSubscribers)) {
60
+ $layout = $observer->getEvent()->getLayout();
61
+ $targetBlock = $layout->getBlock('before_body_end');
62
+ foreach ($changedSubscribers as $subscriber) {
63
+ $beaconBlock = $layout->createBlock('edialogmarketing/beacon', 'edialogmarketing.beacon.' . $subscriber->getId())
64
+ ->setSubscriber($subscriber)
65
+ ->setSubscriptionSource($session->getNewsletterSubscriptionSource());
66
+ if ($targetBlock) {
67
+ $targetBlock->append($beaconBlock);
68
+ }
69
+ }
70
+ $this->_cleanUpSession();
71
+ }
72
+ }
73
+
74
+ /**
75
+ * Set session flag for subscription during checkout
76
+ */
77
+ public function checkoutSubsciptionWillSubscribe($observer)
78
+ {
79
+ $params = (Mage::app()->getRequest()->getParams()) ? Mage::app()->getRequest()->getParams() : array();
80
+ $session = Mage::getSingleton('core/session');
81
+ if (isset($params['billing']['checkout_opt_in'])) {
82
+ $session->setNewsletterWillSubscribe(true);
83
+ $session->setNewsletterSubscriptionSource(isset($params['billing']['source']) ? $params['billing']['source'] : 'checkout');
84
+ } else {
85
+ $session->setNewsletterWillSubscribe(false);
86
+ }
87
+ }
88
+
89
+ /**
90
+ * Save customer subscription when opted in during checkout
91
+ *
92
+ * @param $observer 'order'=>$order, 'quote'=>$this->getQuote()
93
+ */
94
+ public function checkoutSubscriptionAdded($observer)
95
+ {
96
+ $session = Mage::getSingleton('core/session');
97
+ $willSubscribe = $session->getNewsletterWillSubscribe();
98
+ if ((bool)$willSubscribe) {
99
+ $order = $observer->getEvent()->getOrder();
100
+ $email = $order->getCustomerEmail();
101
+ Mage::getModel('newsletter/subscriber')->subscribe($email);
102
+ }
103
+ }
104
+
105
+ /**
106
+ * Subscriptions during customer registration
107
+ */
108
+ public function customerRegisterSubscribe($observer)
109
+ {
110
+ $params = (Mage::app()->getRequest()->getParams()) ? Mage::app()->getRequest()->getParams() : array();
111
+ $session = Mage::getSingleton('core/session');
112
+ if (isset($params['is_subscribed'])) {
113
+ $session->setNewsletterSubscriptionSource(isset($params['source']) ? $params['source'] : 'account_registration');
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Changes to subscription in the My Account page
119
+ */
120
+ public function accountNewsletterSave($observer)
121
+ {
122
+ $params = (Mage::app()->getRequest()->getParams()) ? Mage::app()->getRequest()->getParams() : array();
123
+ $session = Mage::getSingleton('core/session');
124
+ $session->setNewsletterSubscriptionSource(isset($params['source']) ? $params['source'] : 'my_account');
125
+ }
126
+
127
+ /**
128
+ * Global/default newsletter signup
129
+ */
130
+ public function globalNewsletterSignup($observer)
131
+ {
132
+ $params = (Mage::app()->getRequest()->getParams()) ? Mage::app()->getRequest()->getParams() : array();
133
+ $session = Mage::getSingleton('core/session');
134
+ $session->setNewsletterSubscriptionSource(isset($params['source']) ? $params['source'] : Mage::helper('edialogmarketing')->getDefaultSource());
135
+ }
136
+ }
app/code/community/TrueAction/EDialogMarketing/controllers/Adminhtml/Edialogmarketing/RegisterController.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogMarketing
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogMarketing_Adminhtml_EDialogMarketing_RegisterController extends Mage_Adminhtml_Controller_Action
9
+ {
10
+ public function indexAction()
11
+ {
12
+ $this->loadLayout();
13
+ $this->renderLayout();
14
+ }
15
+ }
app/code/community/TrueAction/EDialogMarketing/controllers/SubscriberController.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogMarketing
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ *
7
+ * e-Dialog Marketing controller for standalone subscribe and unsubscribe pages
8
+ * Subscribe pages simply use the newsletter/signup block so posts are sent to the newletter controller
9
+ * Handles unsubscribe page and post action
10
+ */
11
+ class TrueAction_EDialogMarketing_SubscriberController extends Mage_Core_Controller_Front_Action
12
+ {
13
+
14
+ /**
15
+ * Sets an instance Mage_Newsletter_Model_Subscriber on the block instance
16
+ * allowing for email address to be propopulated in the form
17
+ * Subscriber is determined using an id param, email param or currently logged in user
18
+ *
19
+ * @param $blockName string - the name of the block instance to be setup
20
+ * @return TrueAction_EDialogMarketing_SubscriberController
21
+ */
22
+ protected function _setupSubscriberBlock($blockName)
23
+ {
24
+ if ($block = $this->getLayout()->getBlock($blockName)) {
25
+ $request = $this->getRequest();
26
+ $subscriber = Mage::getModel('newsletter/subscriber');
27
+ if ($idParam = $request->getParam('id')) {
28
+ $subscriber->load($idParam);
29
+ } else if ($emailParam = $request->getParam('email')) {
30
+ $subscriber->loadByEmail($emailParam);
31
+ } else if (Mage::getSingleton('customer/session')->isLoggedIn()) {
32
+ $subscriber->loadByEmail(Mage::getSingleton('customer/session')->getCustomer()->getEmail());
33
+ }
34
+ $block->setSubscriber($subscriber);
35
+ }
36
+ return $this;
37
+ }
38
+
39
+ /**
40
+ * Subscribe action, layout update uses newletter/subscribe block
41
+ * Nothing else necessary
42
+ * URL => /subscriptions/subscriber/subscribe
43
+ */
44
+ public function subscribeAction()
45
+ {
46
+ $this->loadLayout()
47
+ ->renderLayout();
48
+ }
49
+
50
+ /**
51
+ * Unsubscribe action, layout update uses edialogmarketing/unsubscribe block
52
+ * Sets subscriber on the block via TrueAction_EDialogMarketing_SubscriberController::_setupSubscriberBlock
53
+ * URL => /subscriptions/subscriber/unsubscribe
54
+ */
55
+ public function unsubscribeAction()
56
+ {
57
+ $this->loadLayout();
58
+ $this->_setupSubscriberBlock('edialogmarketing.unsubscribe');
59
+ $this->renderLayout();
60
+ }
61
+
62
+ /**
63
+ * Handles unsubscribe form post
64
+ * Loads user by email and unsubscribes them
65
+ * Redirects user via Mage_Core_Controller_Varien_Action::_redirectSuccess
66
+ * which allows the use of setting the redirect location via a success_url parameter submitted with the form
67
+ */
68
+ public function unsubscribePostAction()
69
+ {
70
+ $request = $this->getRequest();
71
+ if ($request->isPost() && $email = $request->getPost('email')) {
72
+ $session = Mage::getSingleton('core/session');
73
+ try {
74
+ Mage::getModel('newsletter/subscriber')
75
+ ->loadByEmail($email)
76
+ ->unsubscribe();
77
+ $session->addSuccess($this->__('You have been unsubscribed.'));
78
+ } catch (Mage_Core_Exception $e) {
79
+ $session->addException($e, $e->getMessage());
80
+ } catch (Exception $e) {
81
+ $session->addException($e, $this->__('There was a problem with the un-subscription.'));
82
+ }
83
+ $this->_redirectSuccess('');
84
+ } else {
85
+ $this->_redirectReferer();
86
+ }
87
+ }
88
+
89
+ }
app/code/community/TrueAction/EDialogMarketing/etc/adminhtml.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * @category TrueAction
5
+ * @package TrueAction_EDialogMarketing
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+ <config>
10
+ <acl>
11
+ <resources>
12
+ <admin>
13
+ <children>
14
+ <system>
15
+ <children>
16
+ <config>
17
+ <children>
18
+ <email_marketing>
19
+ <title>e-Dialog Enterprise Promotional</title>
20
+ </email_marketing>
21
+ </children>
22
+ </config>
23
+ </children>
24
+ </system>
25
+ </children>
26
+ </admin>
27
+ </resources>
28
+ </acl>
29
+ </config>
app/code/community/TrueAction/EDialogMarketing/etc/cache.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * @category TrueAction
5
+ * @package TrueAction_EDialogMarketing
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+ <config>
10
+ <placeholders>
11
+ <edialogmarketing_beacon>
12
+ <block>edialogmarketing/beacon</block>
13
+ <placeholder>EDIALOG_SIGNUP_BEACON</placeholder>
14
+ <container>TrueAction_EDialogMarketing_Model_Container_Beacon</container>
15
+ <cache_lifetime>86400</cache_lifetime>
16
+ </edialogmarketing_beacon>
17
+ </placeholders>
18
+ </config>
app/code/community/TrueAction/EDialogMarketing/etc/config.xml ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * @category TrueAction
5
+ * @package TrueAction_EDialogMarketing
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <TrueAction_EDialogMarketing>
12
+ <version>1.0.0</version>
13
+ </TrueAction_EDialogMarketing>
14
+ </modules>
15
+ <global>
16
+ <blocks>
17
+ <edialogmarketing>
18
+ <class>TrueAction_EDialogMarketing_Block</class>
19
+ </edialogmarketing>
20
+ <checkout>
21
+ <rewrite>
22
+ <onepage_billing>TrueAction_EDialogMarketing_Block_Checkout_Onepage_Billing</onepage_billing>
23
+ </rewrite>
24
+ </checkout>
25
+ </blocks>
26
+ <models>
27
+ <edialogmarketing>
28
+ <class>TrueAction_EDialogMarketing_Model</class>
29
+ </edialogmarketing>
30
+ </models>
31
+ <helpers>
32
+ <edialogmarketing>
33
+ <class>TrueAction_EDialogMarketing_Helper</class>
34
+ </edialogmarketing>
35
+ </helpers>
36
+ <events>
37
+ <!-- triggerred anytime a subscriber object is saved, flags session to add beacon -->
38
+ <newsletter_subscriber_save_after>
39
+ <observers>
40
+ <tan_edialogmarketing>
41
+ <type>singleton</type>
42
+ <class>edialogmarketing/observer</class>
43
+ <method>newsletterSubscriptionChanged</method>
44
+ </tan_edialogmarketing>
45
+ </observers>
46
+ </newsletter_subscriber_save_after>
47
+ <newsletter_subscriber_delete_after>
48
+ <observers>
49
+ <tan_edialogmarketing>
50
+ <type>singleton</type>
51
+ <class>edialogmarketing/observer</class>
52
+ <method>newletterSubscriptionDeleted</method>
53
+ </tan_edialogmarketing>
54
+ </observers>
55
+ </newsletter_subscriber_delete_after>
56
+ <!-- adds beacon if session is flagged by subscriber change -->
57
+ <controller_action_layout_generate_blocks_after>
58
+ <observers>
59
+ <tan_edialogmarketing>
60
+ <type>singleton</type>
61
+ <class>edialogmarketing/observer</class>
62
+ <method>addBeaconAfterSubscriptionChange</method>
63
+ </tan_edialogmarketing>
64
+ </observers>
65
+ </controller_action_layout_generate_blocks_after>
66
+ </events>
67
+ </global>
68
+ <frontend>
69
+ <layout>
70
+ <updates>
71
+ <edialogmarketing>
72
+ <file>edialogmarketing.xml</file>
73
+ </edialogmarketing>
74
+ </updates>
75
+ </layout>
76
+ <routers>
77
+ <edialogmarketing>
78
+ <use>standard</use>
79
+ <args>
80
+ <module>TrueAction_EDialogMarketing</module>
81
+ <frontName>subscriptions</frontName>
82
+ </args>
83
+ </edialogmarketing>
84
+ </routers>
85
+ <events>
86
+ <!-- checkout events -->
87
+ <!-- checks for subscription opt in when billing info is submitted during checkout -->
88
+ <controller_action_postdispatch_checkout_onepage_saveBilling>
89
+ <observers>
90
+ <tan_edialogmarketing>
91
+ <type>singleton</type>
92
+ <class>edialogmarketing/observer</class>
93
+ <method>checkoutSubsciptionWillSubscribe</method>
94
+ </tan_edialogmarketing>
95
+ </observers>
96
+ </controller_action_postdispatch_checkout_onepage_saveBilling>
97
+ <!-- saves the subscription after checkout if opt in during billing step -->
98
+ <checkout_type_onepage_save_order_after>
99
+ <observers>
100
+ <tan_edialogmarketing>
101
+ <type>singleton</type>
102
+ <class>edialogmarketing/observer</class>
103
+ <method>checkoutSubscriptionAdded</method>
104
+ </tan_edialogmarketing>
105
+ </observers>
106
+ </checkout_type_onepage_save_order_after>
107
+ <!-- end checkout events -->
108
+
109
+ <!-- customer registration -->
110
+ <controller_action_postdispatch_customer_account_createpost>
111
+ <observers>
112
+ <tan_edialogmarketing>
113
+ <type>singleton</type>
114
+ <class>edialogmarketing/observer</class>
115
+ <method>customerRegisterSubscribe</method>
116
+ </tan_edialogmarketing>
117
+ </observers>
118
+ </controller_action_postdispatch_customer_account_createpost>
119
+ <!-- subscription changes from my account newsletter page -->
120
+ <controller_action_postdispatch_newsletter_manage_save>
121
+ <observers>
122
+ <tan_edialogmarketing>
123
+ <type>singleton</type>
124
+ <class>edialogmarketing/observer</class>
125
+ <method>accountNewsletterSave</method>
126
+ </tan_edialogmarketing>
127
+ </observers>
128
+ </controller_action_postdispatch_newsletter_manage_save>
129
+ <!-- subscriptions from sidebar/global signup -->
130
+ <controller_action_postdispatch_newsletter_subscriber_new>
131
+ <observers>
132
+ <tan_edialogmarketing>
133
+ <type>singleton</type>
134
+ <class>edialogmarketing/observer</class>
135
+ <method>globalNewsletterSignup</method>
136
+ </tan_edialogmarketing>
137
+ </observers>
138
+ </controller_action_postdispatch_newsletter_subscriber_new>
139
+ </events>
140
+ </frontend>
141
+ <adminhtml>
142
+ <layout>
143
+ <updates>
144
+ <tan_edialogmarketing>
145
+ <file>edialogmarketing.xml</file>
146
+ </tan_edialogmarketing>
147
+ </updates>
148
+ </layout>
149
+ </adminhtml>
150
+ <admin>
151
+ <routers>
152
+ <adminhtml>
153
+ <args>
154
+ <modules>
155
+ <TrueAction_EDialogMarketing before="Mage_Adminhtml">TrueAction_EDialogMarketing_Adminhtml</TrueAction_EDialogMarketing>
156
+ </modules>
157
+ </args>
158
+ </adminhtml>
159
+ </routers>
160
+ </admin>
161
+ <default>
162
+ <email_marketing>
163
+ <edialogmarketing>
164
+ <default_source>signup</default_source>
165
+ <checkout_signup>1</checkout_signup>
166
+ <registration>
167
+ <target_capability_name>e-Dialog Enterprise</target_capability_name>
168
+ <store_endpoint_url />
169
+ <registration_url><![CDATA[https://devportal.x.com/merchant_onboarding/]]></registration_url>
170
+ <legal_agreement_url><![CDATA[http://www.e-dialog.com/index.php/legal/]]></legal_agreement_url>
171
+ </registration>
172
+ </edialogmarketing>
173
+ </email_marketing>
174
+ </default>
175
+ </config>
app/code/community/TrueAction/EDialogMarketing/etc/system.xml ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * @category TrueAction
5
+ * @package TrueAction_EDialogMarketing
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+ <config>
10
+ <tabs>
11
+ <marketing translate="label" module="edialogmarketing">
12
+ <label>Marketing</label>
13
+ <sort_order>99999</sort_order>
14
+ </marketing>
15
+ </tabs>
16
+ <sections>
17
+ <email_marketing>
18
+ <label>Email Marketing</label>
19
+ <tab>marketing</tab>
20
+ <frontend_type>text</frontend_type>
21
+ <sort_order>100</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <groups>
26
+ <edialogmarketing translate="label">
27
+ <label>e-Dialog Enterprise Promotional</label>
28
+ <frontend_type>text</frontend_type>
29
+ <sort_order>20</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ <fields>
34
+ <register_button>
35
+ <label>Register</label>
36
+ <frontend_model>edialogmarketing/adminhtml_system_form_renderer_config_registerButton</frontend_model>
37
+ <comment><![CDATA[To enable the e-Dialog Enterprise Promotional extension, you must register it with x.com. A new window will appear and take you to x.com to complete your registration.<br />Log in with the same credentials you used when you registered for the Fabric at the System menu, under "Configuration".]]></comment>
38
+ <button_label>Register with X.commerce</button_label>
39
+ <button_url><![CDATA[*/edialogmarketing_register/index]]></button_url>
40
+ <sort_order>20</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>0</show_in_website>
43
+ <show_in_store>0</show_in_store>
44
+ </register_button>
45
+ <setup_text translate="label comment">
46
+ <label>Configuration</label>
47
+ <frontend_model>edialogmarketing/adminhtml_system_form_renderer_config_headingComment</frontend_model>
48
+ <comment><![CDATA[This extension requres you to have an account with e-Dialog. If you do not have an account or do not know the account information to enter below, please contact <a href="http://www.e-dialog.com/index.php/contact_us/" target="_blank">e-Dialog</a> for details.]]></comment>
49
+ <sort_order>130</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>0</show_in_website>
52
+ <show_in_store>0</show_in_store>
53
+ </setup_text>
54
+ <enabled translate="label">
55
+ <label>Enable e-Dialog Enterprise Promotional</label>
56
+ <frontend_type>select</frontend_type>
57
+ <source_model>adminhtml/system_config_source_yesno</source_model>
58
+ <sort_order>140</sort_order>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>1</show_in_website>
61
+ <show_in_store>1</show_in_store>
62
+ </enabled>
63
+ <merchant_channel>
64
+ <label>Merchant Channel</label>
65
+ <frontend_type>text</frontend_type>
66
+ <sort_order>160</sort_order>
67
+ <show_in_default>1</show_in_default>
68
+ <show_in_website>1</show_in_website>
69
+ <show_in_store>1</show_in_store>
70
+ </merchant_channel>
71
+ <default_source>
72
+ <label>Default Signup Source</label>
73
+ <comment>If a "source" parameter is not defined for a marketing newsletter signup, this value will be used.</comment>
74
+ <frontend_type>text</frontend_type>
75
+ <sort_order>170</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <show_in_website>1</show_in_website>
78
+ <show_in_store>1</show_in_store>
79
+ </default_source>
80
+ <checkout_signup translate="label">
81
+ <label>Enable Email Signup in Checkout</label>
82
+ <comment>Enabling this option will update the checkout/onepage/billing template to include an opt in checkbox during checkout, allowing users to sign up for the newsletter during checkout.</comment>
83
+ <frontend_type>select</frontend_type>
84
+ <source_model>adminhtml/system_config_source_yesno</source_model>
85
+ <sort_order>180</sort_order>
86
+ <show_in_default>1</show_in_default>
87
+ <show_in_website>1</show_in_website>
88
+ <show_in_store>1</show_in_store>
89
+ </checkout_signup>
90
+ </fields>
91
+ </edialogmarketing>
92
+ </groups>
93
+ </email_marketing>
94
+ </sections>
95
+ </config>
app/code/community/TrueAction/EDialogTransactional/Block/Adminhtml/Productiontoggle.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Block_Adminhtml_Productiontoggle extends Mage_Adminhtml_Block_System_Config_Form_Field
9
+ {
10
+ /**
11
+ * Return the button HTML.
12
+ *
13
+ * @param Varien_Data_Form_Element_Abstract $element
14
+ * @return string
15
+ */
16
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
17
+ {
18
+ $helper = Mage::helper('edialog_transactional');
19
+
20
+ if (! $helper->isProduction()) {
21
+ $label = $helper->__('Switch to Production');
22
+ $prompt = $helper->__('Once in production mode, you cannot switch back to QA mode. Do you wish to continue?');
23
+ $url = $this->getUrl('*/edialogtransactional/promotecells');
24
+
25
+ $buttonHtml = $this->getLayout()->createBlock('adminhtml/widget_button')
26
+ ->setType('button')
27
+ ->setLabel($label)
28
+ ->setOnClick("if(confirm('$prompt'))setLocation('$url')")
29
+ ->setStyle('margin-bottom:5px')
30
+ ->toHtml();
31
+
32
+ return '<b>In QA Mode</b>&nbsp;&nbsp;&nbsp;' . $buttonHtml;
33
+ } else {
34
+ return '<b>In Production Mode</b>';
35
+ }
36
+ }
37
+ }
app/code/community/TrueAction/EDialogTransactional/Helper/Data.php ADDED
@@ -0,0 +1,279 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Helper_Data extends Mage_Core_Helper_Abstract
9
+ {
10
+ const EDIALOG_WSDL_URI = 'https://sdk-staging.e-dialog.com/edialog-webservices/SdkService.wsdl';
11
+ const CONFIG_PATH_ENABLED = 'email_marketing/edialog_transactional/enabled';
12
+ const CONFIG_PATH_PRODUCTION_MODE = 'email_marketing/edialog_transactional/production_mode';
13
+ const CONFIG_PATH_SOAP_USERNAME = 'email_marketing/edialog_transactional/username';
14
+ const CONFIG_PATH_SOAP_PASSWORD = 'email_marketing/edialog_transactional/password';
15
+ const CONFIG_PATH_PROOF_EMAIL = 'email_marketing/edialog_transactional/proof_email';
16
+ const CONFIG_PATH_CUSTOMER_CHANNEL = 'email_marketing/edialog_transactional/customer_channel';
17
+ const CONFIG_PATH_LOGGING_ENABLED = 'email_marketing/edialog_transactional/logging_enabled';
18
+ const MAX_DELIVERY_ATTEMPTS = 3;
19
+
20
+ protected $_templateTriggers = array(
21
+ // Core/Community Edition templates
22
+ 'sales_email_order_template' => 'NEWORDER',
23
+ 'sales_email_order_guest_template' => 'NEWORDER',
24
+ 'sales_email_order_comment_template' => 'ORDERUPDATE',
25
+ 'sales_email_order_comment_guest_template' => 'ORDERUPDATE',
26
+ 'sales_email_invoice_template' => 'NEWINVOICE',
27
+ 'sales_email_invoice_guest_template' => 'NEWINVOICE',
28
+ 'sales_email_invoice_comment_template' => 'INVOICEUPDATE',
29
+ 'sales_email_invoice_comment_guest_template' => 'INVOICEUPDATE',
30
+ 'sales_email_shipment_template' => 'NEWSHIPMENT',
31
+ 'sales_email_shipment_guest_template' => 'NEWSHIPMENT',
32
+ 'sales_email_shipment_comment_template' => 'SHIPMENTUPDATE',
33
+ 'sales_email_shipment_comment_guest_template' => 'SHIPMENTUPDATE',
34
+ 'sales_email_creditmemo_template' => 'NEWCREDITMEMO',
35
+ 'sales_email_creditmemo_guest_template' => 'NEWCREDITMEMO',
36
+ 'sales_email_creditmemo_comment_template' => 'CREDITMEMOUPDATE',
37
+ 'sales_email_creditmemo_comment_guest_template' => 'CREDITMEMOUPDATE',
38
+ 'customer_create_account_email_template' => 'ACCOUNTNEW',
39
+ 'customer_create_account_email_confirmation_template' => 'ACCOUNTCONFIRM',
40
+ 'customer_create_account_email_confirmed_template' => 'ACCOUNTCONFIRMED',
41
+ 'customer_password_forgot_email_template' => 'RESETPASSWORD',
42
+ 'customer_password_remind_email_template' => 'NEWPASSWORD',
43
+ 'customer_enterprise_customerbalance_email_template' => 'STORECREDIT',
44
+ 'giftcard_email_template' => 'NEWGIFTCARDCUSTOMER',
45
+ 'giftcard_giftcardaccount_email_template' => 'NEWGIFTCARDADMIN',
46
+ 'sendfriend_email_template' => 'SENDFRIEND',
47
+ 'wishlist_email_email_template' => 'WISHLISTSHARE',
48
+
49
+ // Enterprise Edition templates
50
+ 'sales_email_enterprise_rma_template' => 'NEWRMA',
51
+ 'sales_email_enterprise_rma_guest_template' => 'NEWRMA',
52
+ 'sales_email_enterprise_rma_auth_template' => 'RMAAUTH',
53
+ 'sales_email_enterprise_rma_auth_guest_template' => 'RMAAUTH',
54
+ 'sales_email_enterprise_rma_comment_template' => 'RMAUPDATE',
55
+ 'sales_email_enterprise_rma_comment_guest_template' => 'RMAUPDATE',
56
+ 'sales_email_enterprise_rma_comment_guest_template' => 'RMAUPDATE',
57
+ 'enterprise_reward_notification_balance_update_template' => 'POINTSUPDATE',
58
+ 'enterprise_reward_notification_expiry_warning_template' => 'POINTSEXPIRING',
59
+ 'enterprise_giftregistry_owner_email_template' => 'NEWGIFTREGISTRY',
60
+ 'enterprise_giftregistry_sharing_email_template' => 'GIFTREGISTRYSHARE',
61
+ 'enterprise_giftregistry_update_email_template' => 'GIFTREGISTRYUPDATE',
62
+ 'enterprise_invitation_email_template' => 'INVITE'
63
+ );
64
+
65
+ protected $_client;
66
+
67
+ /**
68
+ * Get a reference to a SOAP client object representing the e-Dialog SDK API.
69
+ *
70
+ * @return SoapClient
71
+ */
72
+ public function getEDialogClient()
73
+ {
74
+ if (! isset($this->_client)) {
75
+ $this->_client = new SoapClient(self::EDIALOG_WSDL_URI, array(
76
+ 'login' => Mage::getStoreConfig(self::CONFIG_PATH_SOAP_USERNAME),
77
+ 'password' => Mage::getStoreConfig(self::CONFIG_PATH_SOAP_PASSWORD),
78
+ 'exceptions' => true,
79
+ 'trace' => ! $this->isProduction()
80
+ ));
81
+ }
82
+ return $this->_client;
83
+ }
84
+
85
+ /**
86
+ * Send an email to e-Dialog for processing and delivery.
87
+ *
88
+ * @param array $params
89
+ * @return boolean
90
+ */
91
+ public function sendEmailToEDialog($params)
92
+ {
93
+ $this->log('SEND PARAMS: ' . json_encode($params));
94
+
95
+ $client = $this->getEDialogClient();
96
+ $result = null;
97
+ try {
98
+ if ($this->isProduction()) {
99
+ $result = $client->sendMessage($params);
100
+ } else {
101
+ $params['replacementAddress'] = $this->getProofEmail();
102
+ $result = $client->sendProofMessage($params);
103
+ }
104
+ } catch (SoapFault $e) {
105
+ $this->logException($e);
106
+ }
107
+
108
+ $this->log('SEND RESULT: ' . (empty($result) ? 'failed' : json_encode($result)));
109
+
110
+ return ! empty($result);
111
+ }
112
+
113
+ /**
114
+ * Promote all the message cells from QA to production mode.
115
+ *
116
+ * @return boolean
117
+ */
118
+ public function promoteToProduction()
119
+ {
120
+ try {
121
+ // DEBUG...
122
+ throw new Exception('Not ready to promote yet...');
123
+
124
+ $client = $this->getEDialogClient();
125
+ foreach ($this->getAllTriggers() as $triggerName) {
126
+ $client->promoteRTMTestCell(array('messageName' => $triggerName));
127
+ }
128
+ } catch (Exception $e) {
129
+ $this->logException($e);
130
+ return false;
131
+ }
132
+
133
+ Mage::getConfig()->saveConfig(self::CONFIG_PATH_PRODUCTION_MODE, 'true');
134
+ return true;
135
+ }
136
+
137
+ /**
138
+ * Demote all the message cells from production to QA mode.
139
+ *
140
+ * @return boolean
141
+ */
142
+ public function demoteFromProduction()
143
+ {
144
+ try {
145
+ $client = $this->getEDialogClient();
146
+ foreach ($this->getAllTriggers() as $triggerName) {
147
+ // Look up the cell ID for this trigger.
148
+ $rtmConfig = $client->lookupRTMConfiguration(array(
149
+ 'messageName' => $triggerName
150
+ ));
151
+ if (empty($rtmConfig)) throw new Exception('Trigger ' . $triggerName . ' not found on server.');
152
+
153
+ // Look up the mailing & campaign IDs for this trigger based on the cell ID.
154
+ $cellData = $client->lookupCellById(array(
155
+ 'cellId' => $rtmConfig['productionCellId']
156
+ ));
157
+
158
+ // Clone the mailing, including all cells.
159
+ $clonedMailing = $client->cloneMailing(array(
160
+ 'mailingId' => $cellData['cell']['mailingId'],
161
+ 'campaignId' => $cellData['cell']['campaignId'],
162
+ 'deepCopy' => true
163
+ ));
164
+
165
+ // Get the freshly cloned copy of the newest cell.
166
+ $clonedCells = $client->listCellsByFilter(array(
167
+ 'filterMailingId' => $clonedMailing['resultMailingId'],
168
+ 'sortBy' => '-id',
169
+ 'pageSize' => 1,
170
+ 'pageNumber' => 1
171
+ ));
172
+
173
+ // Set the new cell clone as the QA cell for this trigger.
174
+ $client->updateRTMTestCell(array(
175
+ 'messageName' => $triggerName,
176
+ 'cellId' => $clonedCells['cells'][0]['cellId']
177
+ ));
178
+ }
179
+ } catch (Exception $e) {
180
+ $this->logException($e);
181
+ return false;
182
+ }
183
+
184
+ Mage::getConfig()->saveConfig(self::CONFIG_PATH_PRODUCTION_MODE, 'false');
185
+ return true;
186
+ }
187
+
188
+ /**
189
+ * Log a message to the e-Dialog log file.
190
+ *
191
+ * @param string $message
192
+ * @param boolean $force
193
+ */
194
+ public function log($message, $force = false)
195
+ {
196
+ if ($force || Mage::getStoreConfig(self::CONFIG_PATH_LOGGING_ENABLED)) {
197
+ $curTimestamp = date('[Y-m-d H:i:s] ', Mage::getModel('core/date')->timestamp(time()));
198
+ @error_log($curTimestamp . $message . "\n\n", 3, Mage::getBaseDir('log') . '/edialog.log');
199
+ }
200
+ }
201
+
202
+ /**
203
+ * Log an exception both to the main exception log file and the e-Dialog log file.
204
+ *
205
+ * @param string $message
206
+ * @param boolean $force
207
+ */
208
+ public function logException($e)
209
+ {
210
+ Mage::logException($e);
211
+ $this->log('EXCEPTION: ' . $e);
212
+ }
213
+
214
+ /**
215
+ * Get config flag indicating if e-Dialog Transactional integration is enabled.
216
+ *
217
+ * @return boolean
218
+ */
219
+ public function isEnabled()
220
+ {
221
+ return Mage::getStoreConfigFlag(self::CONFIG_PATH_ENABLED);
222
+ }
223
+
224
+ /**
225
+ * Get a flag indicating whether extension has passed QA and is in production mode.
226
+ *
227
+ * @return boolean
228
+ */
229
+ public function isProduction()
230
+ {
231
+ return Mage::getStoreConfigFlag(self::CONFIG_PATH_PRODUCTION_MODE);
232
+ }
233
+
234
+ /**
235
+ * Get the override email address to receive email proofs when in test mode.
236
+ *
237
+ * @return string
238
+ */
239
+ public function getProofEmail()
240
+ {
241
+ return Mage::getStoreConfig(self::CONFIG_PATH_PROOF_EMAIL);
242
+ }
243
+
244
+ /**
245
+ * Returns the channel ID set up in the admin. Normally this will be the same across the whole
246
+ * store, but a retailer may set it differently for different stores or store views in order
247
+ * to segment the customer emails records for those sections.
248
+ *
249
+ * @return string
250
+ */
251
+ public function getChannelId()
252
+ {
253
+ return Mage::getStoreConfig(self::CONFIG_PATH_CUSTOMER_CHANNEL);
254
+ }
255
+
256
+ /**
257
+ * Returns the e-Dialog trigger for a given Magento template ID.
258
+ *
259
+ * @param string $templateId
260
+ * @return string
261
+ */
262
+ public function getTriggerByTemplate($templateId)
263
+ {
264
+ return isset($this->_templateTriggers[$templateId]) ? $this->_templateTriggers[$templateId] : null;
265
+ }
266
+
267
+ /**
268
+ * Returns the e-Dialog trigger for a given Magento template ID.
269
+ *
270
+ * @param string $templateId
271
+ * @return string
272
+ */
273
+ public function getAllTriggers()
274
+ {
275
+ // DEBUG ONLY...
276
+ //return array('NEWORDER');
277
+ return array_values($this->_templateTriggers);
278
+ }
279
+ }
app/code/community/TrueAction/EDialogTransactional/LICENSE.TXT ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GSI COMMERCE
2
+ MAGENTO CONNECT EXTENSIONS
3
+ END USER LICENSE AGREEMENT
4
+ This End User License Agreement ("Agreement") is made as of July 10, 2012 (the "Effective Date") by and between GSI Interactive, Inc. (dba "TrueAction") ("TrueAction"), a Pennsylvania corporation having its principal place of business at 935 1st Avenue, King of Prussia, PA 19406 USA and the Licensee executing this Agreement.
5
+
6
+ WHEREAS, TrueAction along with its affiliates owned or controlled by GSI Commerce, Inc. (each, a "GSI Company") offer various e-commerce and marketing technology and services to its clients, including, among other things, fulfillment and customer call center services, various marketing technology platform services, and account management and marketing agency services (together, the "GSI Services").
7
+
8
+ WHEREAS, TrueAction desires to grant Licensee a limited licensee to use the applicable Magento Connect integration extension (including the associated documentation, the "Extension") in connection with Licensee's purchase and use of the corresponding GSI Services pursuant to an executed services agreement between Licensee and the applicable GSI Company ("Service Agreement").
9
+
10
+ The parties agree as follows:
11
+ TERMS AND CONDITIONS
12
+ 1. License
13
+ 1.1. Subject to Licensee's payment for the applicable GSI Services pursuant to a Service Agreement and Licensee's compliance with other terms and conditions of a Service Agreement and this Agreement, TrueAction hereby grants Licensee a non-transferable, non-assignable, non-sublicensable, worldwide license to use the Extension, solely for internal purposes, in accordance with the Extension's technical documentation and solely during the term of a Service Agreement.
14
+ 1.2. Licensee shall implement reasonable controls to ensure that it does not use the Extension except as permitted hereunder. TrueAction reserves the right to audit Licensee's use of the Extension during normal business hours and with reasonable notice and to include means within the Extension to limit Licensee's use of the Extension to the use permitted hereunder.
15
+ 1.3. TrueAction shall provide the Extension to Licensee, including the associated technical documentation, for use by Licensee in accordance with this Agreement.
16
+ 1.4. TrueAction may modify the terms of this Agreement at any time upon notice to Licensee, which notice shall be deemed given thirty (30) days following the posting of the modified agreement on the applicable Magento website or other website where the Extension is made available. Continued use of the Extension shall be deemed Licensee's consent and agreement with the modified agreement.
17
+
18
+ 2. License Exclusions and Restrictions
19
+ 2.1. Except as expressly authorized herein, Licensee shall not:
20
+ a. use or deploy the Extension in any manner except in connection with its purchase and use of the GSI Services pursuant to a Service Agreement;
21
+ b. reverse engineer, disassemble, decompile or otherwise attempt to derive the source code or functionality of the Extension, except to the extent allowed under any applicable law;
22
+ c. distribute, sublicense, disclose, market, rent, lease, or offer remote computing services, networking, batch processing or transfer of, the Extension to any third party, or permit any person or entity to have access to the Extension by means of a time sharing, remote computing services, networking, batch processing, service bureau or time sharing arrangement;
23
+ d. export the Extension in violation of U.S. Department of Commerce export administration regulations.
24
+ 2.2. No license, right or interest in any TrueAction or any other GSI Company trademark, trade name or service mark is granted hereunder.
25
+
26
+ 3. Fees
27
+ The Extension is made available to Licensee at no additional charge, subject to Licensee's timely payment for the GSI Services and compliance with a Service Agreement and this Agreement.
28
+
29
+ 4. Title and Protection
30
+ 4.1. TrueAction (or its third party providers) retains title to all portions of the Extension and any copies thereof. The Extension contains valuable proprietary information, and Licensee shall not disclose the Extension to anyone other than those of its employees or consultants under written nondisclosure obligations at least as restrictive as those contained in this Agreement, having a need to know for purposes consistent with this Agreement. Licensee shall be responsible for the compliance of such employees or consultants. Licensee shall affix, to each full or partial copy of the Extension made by Licensee, all copyright and proprietary information notices as were affixed to the original. The obligations set forth in this Section shall survive termination of this Agreement.
31
+ 4.2. If the Extension is acquired by or on behalf of a unit or agency of the U.S. Government (the "Government"), the Government agrees that such Product is "commercial computer software" or "commercial computer software documentation" and that, absent a written agreement to the contrary, the Government's rights with respect to such Product are limited by the terms of this Agreement, pursuant to applicable FAR and/or DFARS and successor regulations.
32
+
33
+ 5. Patent and Copyright Indemnity
34
+ For such time as Licensee is receiving Services pursuant to a Service Agreement, TrueAction shall indemnify and defend Licensee against any claims that the Extension infringes any United States patent or copyright; provided that TrueAction is given prompt notice of such claim and is given information, reasonable assistance and sole authority to defend or settle the claim. In the defense or settlement of the claim, TrueAction shall obtain for Licensee the right to continue using the Extension, replace or modify the Extension so that it becomes non-infringing while giving equivalent performance or, if TrueAction determines that such remedies are not reasonably available, remove the infringing portion of the Extension. TrueAction shall have no liability if the alleged infringement is based on (i) a modification of the Extension by anyone other than, or a combination of the Extension with any product or service not provided by, TrueAction; (ii) use of the Extension other than in accordance with the documentation of this Agreement; or (iii) use of the Extension not in connection with the GSI Services. This Section 5 states TrueAction's entire liability and Licensee's exclusive remedy for infringement.
35
+
36
+ 6. Default and Termination
37
+ 6.1. An event of default shall be deemed to occur if: (i) Licensee fails to perform any of its obligations under this Agreement or is otherwise in breach of this Agreement or a Service Agreement.
38
+ 6.2. If an event of default occurs, the non-defaulting party, in addition to any other rights available to it under the law, may terminate this Agreement and all licenses granted hereunder by written notice to the defaulting party. Remedies shall be cumulative and there shall be no obligation to exercise a particular remedy.
39
+ 6.3. This Agreement and all licenses granted herein shall automatically terminate upon the termination or expiration of the applicable Service Agreement.
40
+ 6.4. Within thirty (30) days after termination of this Agreement, Licensee shall certify in writing to TrueAction that Licensee has ceased use of the Extension and that all copies of the Extension in any form, including partial copies, have been destroyed.
41
+
42
+ 7. Warranty
43
+ 7.1. Warranty. TrueAction warrants for a single period of ninety (90) days commencing upon TrueAction's electronic delivery of the Extension to Licensee that the Extension will in all material respects perform the functions described in the specifications contained in the documentation provided with the Extension. TrueAction will use commercially reasonable efforts to undertake to correct any reported and verifiable error, which shall be TrueAction's entire liability and Licensee's exclusive remedy for errors. TrueAction does not warrant that the Extension will meet Licensee's requirements, that the Extension will operate in the combinations which Licensee may select for use, that the operation of the Extension will be uninterrupted or error-free, or that all error conditions will be corrected. EXCEPT AS PROVIDED IN THIS SECTION ALL SOFTWARE PROVIDED HEREUNDER IS PROVIDED "AS IS".
44
+ 7.2. DISCLAIMER . THE EXPRESS WARRANTIES SET FORTH IN THIS SECTION 7 ARE THE ONLY WARRANTIES MADE BY TRUEACTION WITH RESPECT TO THE EXTENSION PROVIDED BY TRUEACTION. TRUEACTION MAKES NO OTHER WARRANTIES, EXPRESS, IMPLIED OR ARISING BY CUSTOM OR TRADE USAGE, AND, SPECIFICALLY, MAKES NO WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. TRUEACTION'S EXPRESS WARRANTIES SHALL NOT BE ENLARGED, DIMINISHED OR AFFECTED BY, AND NO OBLIGATION OR LIABILITY SHALL ARISE OUT OF, TRUEACTION RENDERING TECHNICAL OR OTHER ADVICE OR SERVICE IN CONNECTION WITH THE EXTENSION.
45
+
46
+ 8. Limitation of Liability
47
+ 8.1. LIABILITY EXCLUSIONS. NOTHING IN THIS AGREEMENT SHALL EXCLUDE OR LIMIT EITHER PARTY'S LIABILITY FOR BREACH OF THE LICENSES OR RELATED RESTRICTIONS CONTAINED HEREIN OR ANY LIABILITY WHICH CANNOT BE EXCLUDED OR LIMITED BY APPLICABLE LAW. SAVE FOR THE FOREGOING, NEITHER PARTY ACCEPTS AND EACH PARTY HEREBY EXCLUDES ANY LIABILITY FOR LOSS OF OR DAMAGE TO TANGIBLE PROPERTY OTHER THAN THAT CAUSED BY ITS NEGLIGENCE AND HEREBY EXCLUDES ANY OTHER LIABILITY FOR NEGLIGENCE ARISING PURSUANT TO THE TERMS OF THIS AGREEMENT. UNDER NO CIRCUMSTANCES WILL EITHER PARTY BE LIABLE FOR: LOSS OF REVENUE; LOSS OF ACTUAL OR ANTICIPATED PROFITS; LOSS OF CONTRACTS; LOSS OF THE USE OF MONEY; LOSS OF ANTICIPATED SAVINGS; LOSS OF BUSINESS; LOSS OF OPPORTUNITY; LOSS OF GOODWILL; LOSS OF REPUTATION; LOSS OF, DAMAGE TO OR CORRUPTION OF DATA; OR CONSEQUENTIAL OR INDIRECT LOSS OR SPECIAL, PUNITIVE, OR INCIDENTAL DAMAGES (INCLUDING, FOR THE AVOIDANCE OF DOUBT, WHERE SUCH LOSS OR DAMAGE IS ALSO OF A CATEGORY OF LOSS OR DAMAGE ALREADY LISTED), WHETHER FORESEEABLE OR UNFORESEEABLE, BASED ON CLAIMS OF LICENSEE, TRUEACTION OR ANY THIRD PARTY ARISING OUT OF ANY BREACH OR FAILURE OF EXPRESS OR IMPLIED WARRANTY CONDITIONS OR OTHER TERM, BREACH OF CONTRACT, MISREPRESENTATION, NEGLIGENCE, OTHER LIABILITY IN TORT, FAILURE OF ANY REMEDY TO ACHIEVE ITS ESSENTIAL PURPOSE, OR OTHERWISE.
48
+
49
+ 8.2. LIABILITY CAP. NOTWITHSTANDING THE FORM (E.G., CONTRACT, TORT, OR OTHERWISE) IN WHICH ANY LEGAL OR EQUITABLE ACTION MAY BE BROUGHT, IN NO EVENT WILL TRUEACTION OR ITS SUPPLIERS BE LIABLE FOR DAMAGES, RESTITUTION OR LOSSES, THAT EXCEED, IN THE AGGREGATE, FOR EACH RESPECTIVE BREACH OR SERIES OF RELATED BREACHES, THE LESSER OF $5,000 OR THE AMOUNT OF FEES PAID BY LICENSEE FOR THE EXTENSION LICENSE IN THE TWELVE (12) MONTH PERIOD PRIOR TO THE DATE ON WHICH THE EVENT GIVING RISE TO SUCH DAMAGES OR LOSSES OCCURRED.
50
+
51
+ 9. Support Services
52
+ No support services are provided under this Agreement. Any support services provided to Licensee will be provided pursuant to a Service Agreement through the applicable GSI Company.
53
+
54
+ 10. Joint Marketing Activities
55
+ The parties agree to undertake the joint marketing activities set forth in Schedule A (Joint Marketing Activities).
56
+
57
+ 11. Notices
58
+ All notices shall be in writing and sent by first class mail or overnight mail (or courier), transmitted by facsimile (if confirmed by such mailing), or email, to the addresses indicated on the first page of this Agreement, or such other address as either party may indicate by at least ten (10) days prior written notice to the other party. Notices to TrueAction shall be sent to the attention of the General Counsel.
59
+
60
+ 12. Assignment
61
+ Licensee may not assign this Agreement without the prior written consent of TrueAction; provided that such consent shall not be required for assignment to a purchaser of all or substantially all of the assets or equity securities of Licensee who undertakes in writing to be bound by all the terms and conditions of this Agreement. Any prohibited assignment shall be null and void.
62
+
63
+ 13. Entire Agreement
64
+ This Agreement is the complete and exclusive agreement between the parties, which supersedes all proposals or prior agreements, oral or written, including any other online (click-through) agreement which Licensee may have accepted in conjunction with the downloading of the Extension, and all other communications between the parties relating to the subject matter hereof. No purchase order, other ordering document or any hand written or typewritten text or email which purports to modify or supplement the printed text hereof or any executed agreement with any GSI Company other than TrueAction shall add to or vary the terms thereof. Except as contained in a writing signed by both parties, all such proposed variations or additions are objected to and shall have no force or effect.
65
+
66
+ 14. General
67
+ This Agreement is made in and shall be governed by the laws of the State of New York, excluding choice of law principles. All proceedings shall be conducted in English. Venue for all proceedings shall be the state and federal courts located in New York, New York, provided that TrueAction may seek injunctive relief in any court of competent jurisdiction. The United Nations Convention for the International Sale of Goods shall not apply. The section headings herein are provided for convenience only and have no substantive effect on the construction of this Agreement. Except for Licensee's license restrictions herein, neither party shall be liable for any failure to perform due to causes beyond its reasonable control. If any provision of this Agreement is held to be unenforceable, this Agreement shall be construed without such provision. The failure by a party to exercise any right hereunder shall not operate as a waiver of such party's right to exercise such right or any other right in the future. This Agreement may be amended only by a written document executed by a duly authorized representative of each of the parties. The parties agree to receive electronic documents and accept electronic signatures (information attached or logically associated with such document and clicked or otherwise adopted with an intent to sign) including in counterparts which shall be valid substitutes for paper-based documents and signatures, and the legal validity of a transaction will not be denied on the ground that it is not in writing.
68
+
69
+ 15. Definitions
70
+ "Updates" means all published revisions and corrections to the printed documentation and corrections and new releases of the Extension which are generally made available to TrueAction's supported customers at no additional cost or for media and handling charges only. Updates shall not include any options or future products which TrueAction sells separately.
71
+
72
+ SCHEDULE A
73
+ TRUEACTION EXTENSION
74
+ JOINT MARKETING ACTIVITIES
75
+ These Joint Marketing Activities are referenced in and incorporated into the End User License Agreement between GSI Interactive, Inc. ("TrueAction") and ("Licensee"), dated July 10, 2012 (the "Agreement").
76
+ 1. Press Releases. Licensee agrees to permit TrueAction to issue a press releases at (i) contract execution announcing the selection of the Extension(s), and (ii) at launch of GSI Services. Licensee will have the right to approve the release in advance, but such approval will not be unreasonably delayed or withheld.
77
+ 2. Use of Licensee Logo. TrueAction shall be permitted to include Licensee's logo on TrueAction's website (including its social media pages) as well as in connection with the Magento Connect website and in printed marketing material.
78
+ 3. Interview. Licensee agrees to designate one of its founders and/or executives to participate in a video and/or written interview to promote the TrueAction Extension.
79
+ 4. Case Study. The parties shall jointly issue a case study based on such use. Licensee's site may be showcased on TrueAction's website.
80
+ 5. Reference. Licensee's employees shall make themselves available to be a reference for the Extension and will provide quotations about how the Extension has contributed to the success of their site or product.
81
+ 6. Other. Additional joint marketing activities may be developed based upon mutual agreement.
app/code/community/TrueAction/EDialogTransactional/Model/Core/Email/Template.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Core_Email_Template extends Mage_Core_Model_Email_Template
9
+ {
10
+ /**
11
+ * Prefix of model events names
12
+ *
13
+ * @var string
14
+ */
15
+ protected $_eventPrefix = 'email_template';
16
+
17
+ /**
18
+ * Parameter name in event
19
+ *
20
+ * @var string
21
+ */
22
+ protected $_eventObject = 'template';
23
+
24
+ /**
25
+ * Get array of event data
26
+ *
27
+ * @param array $additionalData
28
+ * @return array
29
+ */
30
+ protected function _getEventData($additionalData = array())
31
+ {
32
+ return array_merge(array(
33
+ 'data_object' => $this,
34
+ $this->_eventObject => $this
35
+ ), $additionalData);
36
+ }
37
+
38
+ /**
39
+ * Send mail to recipient
40
+ *
41
+ * @param array|string $email E-mail(s)
42
+ * @param array|string|null $name receiver name(s)
43
+ * @param array $variables template variables
44
+ * @return boolean
45
+ **/
46
+ public function send($email, $name = null, array $variables = array())
47
+ {
48
+ if (!$this->isValidForSend()) {
49
+ Mage::logException(new Exception('This letter cannot be sent.')); // translation is intentionally omitted
50
+ return false;
51
+ }
52
+
53
+ $emails = array_values((array)$email);
54
+ $names = is_array($name) ? $name : (array)$name;
55
+ $names = array_values($names);
56
+ foreach ($emails as $key => $email) {
57
+ if (!isset($names[$key])) {
58
+ $names[$key] = substr($email, 0, strpos($email, '@'));
59
+ }
60
+ }
61
+
62
+ $variables['email'] = reset($emails);
63
+ $variables['name'] = reset($names);
64
+
65
+ ini_set('SMTP', Mage::getStoreConfig('system/smtp/host'));
66
+ ini_set('smtp_port', Mage::getStoreConfig('system/smtp/port'));
67
+
68
+ $mail = $this->getMail();
69
+
70
+ $setReturnPath = Mage::getStoreConfig(self::XML_PATH_SENDING_SET_RETURN_PATH);
71
+ switch ($setReturnPath) {
72
+ case 1:
73
+ $returnPathEmail = $this->getSenderEmail();
74
+ break;
75
+ case 2:
76
+ $returnPathEmail = Mage::getStoreConfig(self::XML_PATH_SENDING_RETURN_PATH_EMAIL);
77
+ break;
78
+ default:
79
+ $returnPathEmail = null;
80
+ break;
81
+ }
82
+
83
+ if ($returnPathEmail !== null) {
84
+ $mailTransport = new Zend_Mail_Transport_Sendmail("-f".$returnPathEmail);
85
+ Zend_Mail::setDefaultTransport($mailTransport);
86
+ }
87
+
88
+ foreach ($emails as $key => $email) {
89
+ $mail->addTo($email, '=?utf-8?B?' . base64_encode($names[$key]) . '?=');
90
+ }
91
+
92
+ $this->setUseAbsoluteLinks(true);
93
+ $text = $this->getProcessedTemplate($variables, true);
94
+
95
+ if ($this->isPlain()) {
96
+ $mail->setBodyText($text);
97
+ } else {
98
+ $mail->setBodyHTML($text);
99
+ }
100
+
101
+ $mail->setSubject('=?utf-8?B?' . base64_encode($this->getProcessedTemplateSubject($variables)) . '?=');
102
+ $mail->setFrom($this->getSenderEmail(), $this->getSenderName());
103
+
104
+ try {
105
+ Mage::dispatchEvent($this->_eventPrefix.'_send_before', $this->_getEventData(array('emailVariables' => $variables, 'mail' => $mail)));
106
+ if (!$this->getSendCanceled()) {
107
+ $mail->send();
108
+ $this->_mail = null;
109
+ Mage::dispatchEvent($this->_eventPrefix.'_send_after', $this->_getEventData());
110
+ }
111
+ } catch (Exception $e) {
112
+ $this->_mail = null;
113
+ Mage::logException($e);
114
+ return false;
115
+ }
116
+
117
+ return true;
118
+ }
119
+
120
+ /**
121
+ * Send transactional email to recipient
122
+ *
123
+ * @param int $templateId
124
+ * @param string|array $sender sender information, can be declared as part of config path
125
+ * @param string $email recipient email
126
+ * @param string $name recipient name
127
+ * @param array $vars varianles which can be used in template
128
+ * @param int|null $storeId
129
+ * @return Mage_Core_Model_Email_Template
130
+ */
131
+ public function sendTransactional($templateId, $sender, $email, $name, $vars=array(), $storeId=null)
132
+ {
133
+ $this->setSentSuccess(false);
134
+ if (($storeId === null) && $this->getDesignConfig()->getStore()) {
135
+ $storeId = $this->getDesignConfig()->getStore();
136
+ }
137
+
138
+ // Dispatch event before template is loaded.
139
+ Mage::dispatchEvent(
140
+ $this->_eventPrefix.'_load_before',
141
+ $this->_getEventData(
142
+ // Pass along info about the email template that hasn't been set on $this yet.
143
+ array(
144
+ 'transactionalOptions' => array(
145
+ 'templateId' => $templateId,
146
+ 'sender' => $sender,
147
+ 'email' => $email,
148
+ 'name' => $name,
149
+ 'vars' => $vars,
150
+ 'storeId' => $storeId
151
+ )
152
+ )
153
+ )
154
+ );
155
+
156
+ // If an event handler indicated it has successfully and completely handled the email by
157
+ // setting the "sent success" flag, then we're all done here.
158
+ if ($this->getSentSuccess()) {
159
+ return $this;
160
+ }
161
+
162
+ if (is_numeric($templateId)) {
163
+ $this->load($templateId);
164
+ } else {
165
+ $localeCode = Mage::getStoreConfig('general/locale/code', $storeId);
166
+ $this->loadDefault($templateId, $localeCode);
167
+ }
168
+
169
+ Mage::dispatchEvent($this->_eventPrefix.'_load_after', $this->_getEventData());
170
+
171
+ if (!$this->getId()) {
172
+ throw Mage::exception('Mage_Core', Mage::helper('core')->__('Invalid transactional email code: '.$templateId));
173
+ }
174
+
175
+ if (!is_array($sender)) {
176
+ $this->setSenderName(Mage::getStoreConfig('trans_email/ident_'.$sender.'/name', $storeId));
177
+ $this->setSenderEmail(Mage::getStoreConfig('trans_email/ident_'.$sender.'/email', $storeId));
178
+ } else {
179
+ $this->setSenderName($sender['name']);
180
+ $this->setSenderEmail($sender['email']);
181
+ }
182
+
183
+ if (!isset($vars['store'])) {
184
+ $vars['store'] = Mage::app()->getStore($storeId);
185
+ }
186
+
187
+ $this->setSentSuccess($this->send($email, $name, $vars));
188
+ return $this;
189
+ }
190
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message.php ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ abstract class TrueAction_EDialogTransactional_Model_Message extends Varien_Object
9
+ {
10
+ const CONFIG_PATH_STORE_NAME = 'general/store_information/name';
11
+ const CONFIG_PATH_SUPPORT_PHONE = 'general/store_information/phone';
12
+ const CONFIG_PATH_SUPPORT_EMAIL = 'trans_email/ident_support/email';
13
+
14
+ /**
15
+ * Prepare the template-specific properties to be passed to e-Dialog. This function will be
16
+ * implemented by the individual message classes.
17
+ *
18
+ * @param array $vars variables which can be used in template
19
+ * @return array
20
+ */
21
+ abstract protected function _getEventProps($vars);
22
+
23
+ /**
24
+ * Post message to e-Dialog.
25
+ *
26
+ * @param string $templateId
27
+ * @param string $toEmail recipient email
28
+ * @param string $toName recipient name
29
+ * @param array $vars variables which can be used in template
30
+ * @param int|null $storeId
31
+ * @return boolean
32
+ */
33
+ public function send($templateId, $toEmail, $toName, $vars, $storeId)
34
+ {
35
+ $helper = Mage::helper('edialog_transactional');
36
+ $emulationMode = false;
37
+
38
+ // Set data for later access by called methods.
39
+ $this->setTemplateId($templateId);
40
+ $this->setRecipientEmail($toEmail);
41
+ $this->setRecepientFullName($toName);
42
+
43
+ // If sending from a different store than we're currently running in, emulate the specified
44
+ // store front while we prepare the email content.
45
+ if (! empty($storeId) && $storeId != Mage::app()->getStore()->getStoreId()) {
46
+ $appEmulation = Mage::getSingleton('core/app_emulation');
47
+ $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
48
+ $emulationMode = true;
49
+ }
50
+
51
+ // Collect the email content to pass as parameters to e-Dialog.
52
+ try {
53
+ $params = $this->_getMessageParams($vars);
54
+ } catch (Exception $e) {
55
+ // Turn store front emulation off while we still have the chance.
56
+ if ($emulationMode) {
57
+ $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
58
+ }
59
+ throw $e;
60
+ }
61
+
62
+ // If we've been emulating a different store, stop now.
63
+ if ($emulationMode) {
64
+ $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
65
+ }
66
+
67
+ // Save the email to the queue to send asynchronously.
68
+ $queuedEmail = Mage::getModel('edialog_transactional/queue')
69
+ ->setSoapParams(json_encode($params))
70
+ ->save();
71
+
72
+ // Make note of the queued item.
73
+ $helper->log(sprintf('QUEUED: %s as #%s', $this->getTriggerName(), $queuedEmail->getId()));
74
+
75
+ // The built-in Magento mailer will be skipped if we return true. We want this to happen
76
+ // all the time when we're in production mode and never when we're in QA.
77
+ return $helper->isProduction();
78
+ }
79
+
80
+ /**
81
+ * Return the trigger name for this message.
82
+ *
83
+ * @return string
84
+ */
85
+ public function getTriggerName()
86
+ {
87
+ $classParts = explode('_', get_class($this));
88
+ return strtoupper(end($classParts));
89
+ }
90
+
91
+ /**
92
+ * Prepare the SOAP parameters to be passed to e-Dialog sendMessage() call.
93
+ *
94
+ * @param array $vars variables which can be used in template
95
+ * @return array
96
+ */
97
+ protected function _getMessageParams($vars)
98
+ {
99
+ return array(
100
+ 'messageName' => $this->getTriggerName(),
101
+ 'property' => $this->_processProperties(array(
102
+ 'EMAIL' => $this->getRecipientEmail(),
103
+ 'CHANNELID' => Mage::helper('edialog_transactional')->getChannelId(),
104
+ 'EVENTINFO' => $this->_getEventProps($vars)
105
+ ))
106
+ );
107
+ }
108
+
109
+ /**
110
+ * Turn a clean data structure into the data structure the SOAP library wants. This is slightly
111
+ * inefficient, but we decided it was worth it to make our code more maintainable.
112
+ *
113
+ * @param array $properties
114
+ * @return array
115
+ */
116
+ protected function _processProperties($props)
117
+ {
118
+ $soapProps = array();
119
+ foreach ($props as $key => $value) {
120
+ if (is_array($value)) {
121
+ // Algorithm to determine if the array is numeric or associative.
122
+ // From squirrel on Stack Overflow: http://tinyurl.com/c643yyb
123
+ for (reset($value); is_int(key($value)); next($value));
124
+ $isNumericArray = is_null(key($value));
125
+
126
+ // If the array is numeric we're in a "row" structure rather than a "property" structure.
127
+ $type = $isNumericArray ? 'row' : 'property';
128
+
129
+ // Recursively process the array.
130
+ $value = $this->_processProperties($value);
131
+ } else {
132
+ $type = 'value';
133
+
134
+ // Null values cause PHP SOAP not to send the parameter at all, so send as a blank string.
135
+ if (is_null($value)) {
136
+ $value = '';
137
+ // If the value's not an HTML fragment (identified by key naming convention), escape it.
138
+ } else if (! preg_match('/(Html|Table)$/', $key)) {
139
+ $value = htmlspecialchars($value);
140
+ // If the value is an HTML fragment, make sure it's not too long for an email line.
141
+ // Technical line length limit is 990 for sendmail, but we use 900 here to be safe (in case
142
+ // there are other characters in the template on the same line).
143
+ } else {
144
+ $value = wordwrap($value, 900);
145
+ }
146
+ }
147
+
148
+ $soapProps[] = array(
149
+ 'name' => $key,
150
+ $type => $value
151
+ );
152
+ }
153
+ return $soapProps;
154
+ }
155
+
156
+ /**
157
+ * Return an associative array of general store information properties that are sent to
158
+ * e-Dialog with every email type.
159
+ *
160
+ * @return array
161
+ */
162
+ protected function _getStoreInfoProps()
163
+ {
164
+ return array(
165
+ 'name' => Mage::getStoreConfig(self::CONFIG_PATH_STORE_NAME),
166
+ 'logo' => Mage::getDesign()->getSkinUrl('images/logo_email.gif'),
167
+ 'url' => Mage::getBaseUrl(),
168
+ 'supportPhone' => Mage::getStoreConfig(self::CONFIG_PATH_SUPPORT_PHONE),
169
+ 'supportEmail' => Mage::getStoreConfig(self::CONFIG_PATH_SUPPORT_EMAIL)
170
+ );
171
+ }
172
+
173
+ /**
174
+ * Return the HTML output of a given layout handle.
175
+ *
176
+ * @param string $handle
177
+ * @param array $params
178
+ * @return string
179
+ */
180
+ protected function _getLayoutHandleContent($handle, $params)
181
+ {
182
+ /**
183
+ * @var $layout Mage_Core_Model_Layout
184
+ */
185
+ $layout = Mage::getModel('core/layout');
186
+ $layout->setArea(Mage::app()->getLayout()->getArea());
187
+ $layout->getUpdate()->load($handle);
188
+ $layout->generateXml();
189
+ $layout->generateBlocks();
190
+
191
+ /**
192
+ * @var $block Mage_Core_Block_Abstract
193
+ */
194
+ foreach ($layout->getAllBlocks() as $blockName => $block) {
195
+ foreach ($params as $k => $v) {
196
+ $block->setDataUsingMethod($k, $v);
197
+ }
198
+ }
199
+
200
+ // Add output method for first block.
201
+ $allBlocks = $layout->getAllBlocks();
202
+ $firstBlock = reset($allBlocks);
203
+ if ($firstBlock) {
204
+ $layout->addOutputBlock($firstBlock->getNameInLayout());
205
+ }
206
+
207
+ $layout->setDirectOutput(false);
208
+ return $layout->getOutput();
209
+ }
210
+
211
+ /**
212
+ * Return the HTML output of a given layout handle.
213
+ *
214
+ * @param string $type
215
+ * @param string $template
216
+ * @param array $params
217
+ * @return string
218
+ */
219
+ protected function _getBlockContent($type, $template, $params)
220
+ {
221
+ $params['template'] = $template;
222
+
223
+ $block = Mage::app()->getLayout()->createBlock($type, null, $params);
224
+ if (! $block) return '';
225
+
226
+ return $block->toHtml();
227
+ }
228
+
229
+ /**
230
+ * Convert a boolean into a string token understood by e-Dialog.
231
+ *
232
+ * @param boolean $value
233
+ * @return string
234
+ */
235
+ protected function _boolToStr($value)
236
+ {
237
+ return $value ? 'TRUE' : 'FALSE';
238
+ }
239
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Accountconfirm.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Accountconfirm extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $customer = $vars['customer'];
13
+
14
+ $confirmUrlParams = array(
15
+ 'id' => $customer->getId(),
16
+ 'key' => $customer->getConfirmation()
17
+ );
18
+ if (! empty($vars['back_url'])) {
19
+ $confirmUrlParams['back_url'] = $vars['back_url'];
20
+ }
21
+ $confirmUrl = Mage::getUrl('customer/account/confirm', array('_query' => $confirmUrlParams));
22
+
23
+ return array(
24
+ 'storeInfo' => $this->_getStoreInfoProps(),
25
+ 'customerInfo' => array(
26
+ 'firstName' => $customer->getFirstname(),
27
+ 'lastName' => $customer->getLastname(),
28
+ 'password' => $customer->getPassword(),
29
+ 'confirmUrl' => $confirmUrl
30
+ )
31
+ );
32
+ }
33
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Accountconfirmed.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Accountconfirmed extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $customer = $vars['customer'];
13
+
14
+ return array(
15
+ 'storeInfo' => $this->_getStoreInfoProps(),
16
+ 'customerInfo' => array(
17
+ 'firstName' => $customer->getFirstname(),
18
+ 'lastName' => $customer->getLastname(),
19
+ 'accountUrl' => Mage::getUrl('customer/account/')
20
+ )
21
+ );
22
+ }
23
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Accountnew.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Accountnew extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $customer = $vars['customer'];
13
+
14
+ return array(
15
+ 'storeInfo' => $this->_getStoreInfoProps(),
16
+ 'customerInfo' => array(
17
+ 'firstName' => $customer->getFirstname(),
18
+ 'lastName' => $customer->getLastname(),
19
+ 'password' => $customer->getPassword(),
20
+ 'accountUrl' => Mage::getUrl('customer/account/')
21
+ )
22
+ );
23
+ }
24
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Creditmemoupdate.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Creditmemoupdate extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $order = $vars['order'];
13
+ $creditMemo = $vars['creditmemo'];
14
+
15
+ return array(
16
+ 'storeInfo' => $this->_getStoreInfoProps(),
17
+ 'customerInfo' => array(
18
+ 'firstName' => $order->getCustomerFirstname(),
19
+ 'lastName' => $order->getCustomerLastname(),
20
+ 'isRegistered' => $this->_boolToStr(strpos($this->getTemplateId(), 'guest') === false)
21
+ ),
22
+ 'order' => array(
23
+ 'accountUrl' => Mage::getUrl('customer/account/'),
24
+ 'incrementId' => $order->getIncrementId(),
25
+ 'statusLabel' => $order->getStatusLabel()
26
+ ),
27
+ 'creditMemo' => array(
28
+ 'incrementId' => $creditMemo->getIncrementId(),
29
+ 'comments' => $vars['comment']
30
+ )
31
+ );
32
+ }
33
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Giftregistryshare.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Giftregistryshare extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $registry = $vars['entity'];
13
+
14
+ return array(
15
+ 'storeInfo' => $this->_getStoreInfoProps(),
16
+ 'recipient' => array(
17
+ 'fullName' => $vars['recipient_name'],
18
+ 'shareMessageHtml' => nl2br(htmlentities($vars['message']))
19
+ ),
20
+ 'giftRegistry' => array(
21
+ 'ownerName' => $registry->getRegistrants(),
22
+ 'title' => $registry->getTitle(),
23
+ 'message' => $registry->getMessage(),
24
+ 'url' => $vars['url'],
25
+ 'id' => $registry->getUrlKey()
26
+ )
27
+ );
28
+ }
29
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Giftregistryupdate.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Giftregistryupdate extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $owner = $vars['owner'];
13
+ $registry = $vars['entity'];
14
+
15
+ $itemsHtml = $this->_getLayoutHandleContent('enterprise_giftregistry_email_entity_items', array('entity' => $registry));
16
+
17
+ return array(
18
+ 'storeInfo' => $this->_getStoreInfoProps(),
19
+ 'customerInfo' => array(
20
+ 'firstName' => $owner->getFirstname(),
21
+ 'lastName' => $owner->getLastname()
22
+ ),
23
+ 'giftRegistry' => array(
24
+ 'title' => $registry->getTitle(),
25
+ 'url' => Mage::helper('enterprise_giftregistry')->getRegistryLink($registry),
26
+ 'id' => $registry->getUrlKey(),
27
+ 'boughtItemsHtml' => $itemsHtml
28
+ )
29
+ );
30
+ }
31
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Invite.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Invite extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $messageHtml = $vars['allow_message'] ? nl2br(htmlspecialchars($vars['message'])) : null;
13
+
14
+ return array(
15
+ 'storeInfo' => $this->_getStoreInfoProps(),
16
+ 'sender' => array(
17
+ 'isAdmin' => $this->_boolToStr(empty($vars['inviter_name'])),
18
+ 'fullName' => $vars['inviter_name']
19
+ ),
20
+ 'inviteUrl' => $vars['url'],
21
+ 'messageHtml' => $messageHtml
22
+ );
23
+ }
24
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Invoiceupdate.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Invoiceupdate extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $order = $vars['order'];
13
+ $invoice = $vars['invoice'];
14
+
15
+ return array(
16
+ 'storeInfo' => $this->_getStoreInfoProps(),
17
+ 'customerInfo' => array(
18
+ 'firstName' => $order->getCustomerFirstname(),
19
+ 'lastName' => $order->getCustomerLastname(),
20
+ 'isRegistered' => $this->_boolToStr(strpos($this->getTemplateId(), 'guest') === false)
21
+ ),
22
+ 'order' => array(
23
+ 'accountUrl' => Mage::getUrl('customer/account/'),
24
+ 'incrementId' => $order->getIncrementId(),
25
+ 'statusLabel' => $order->getStatusLabel()
26
+ ),
27
+ 'invoice' => array(
28
+ 'incrementId' => $invoice->getIncrementId(),
29
+ 'comments' => $vars['comment']
30
+ )
31
+ );
32
+ }
33
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Newcreditmemo.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Newcreditmemo extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $order = $vars['order'];
13
+ $creditmemo = $vars['creditmemo'];
14
+
15
+ $itemsHtml = $this->_getLayoutHandleContent('sales_email_order_creditmemo_items', array(
16
+ 'order' => $order,
17
+ 'creditmemo' => $creditmemo
18
+ ));
19
+
20
+ $shippingAddress = $order->getShippingAddress();
21
+ $shippingAddress = empty($shippingAddress) ? '' : $shippingAddress->format('html');
22
+
23
+ return array(
24
+ 'storeInfo' => $this->_getStoreInfoProps(),
25
+ 'customerInfo' => array(
26
+ 'firstName' => $order->getCustomerFirstname(),
27
+ 'lastName' => $order->getCustomerLastname(),
28
+ 'isRegistered' => $this->_boolToStr(strpos($this->getTemplateId(), 'guest') === false)
29
+ ),
30
+ 'order' => array(
31
+ 'accountUrl' => Mage::getUrl('customer/account/'),
32
+ 'incrementId' => $order->getIncrementId(),
33
+ 'isVirtual' => $this->_boolToStr($order->getIsVirtual()),
34
+ 'billingAddressHtml' => $order->getBillingAddress()->format('html'),
35
+ 'paymentDetailsHtml' => $vars['payment_html'],
36
+ 'shippingAddressHtml' => $shippingAddress,
37
+ 'shippingDetails' => $order->getShippingDescription(),
38
+ 'orderItemsTable' => $itemsHtml
39
+ ),
40
+ 'creditMemo' => array(
41
+ 'incrementId' => $creditmemo->getIncrementId(),
42
+ 'comments' => $vars['comment']
43
+ )
44
+ );
45
+ }
46
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Newgiftcardadmin.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Newgiftcardadmin extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ return array(
13
+ 'storeInfo' => $this->_getStoreInfoProps(),
14
+ 'recipient' => array(
15
+ 'fullName' => $vars['name']
16
+ ),
17
+ 'giftcard' => array(
18
+ 'cardCode' => $vars['code'],
19
+ 'balance' => $vars['balance']
20
+ )
21
+ );
22
+ }
23
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Newgiftcardcustomer.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Newgiftcardcustomer extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ return array(
13
+ 'storeInfo' => $this->_getStoreInfoProps(),
14
+ 'sender' => array(
15
+ 'fullName' => $vars['sender_name']
16
+ ),
17
+ 'recipient' => array(
18
+ 'fullName' => $vars['name']
19
+ ),
20
+ 'giftcard' => array(
21
+ 'cardCodeHtml' => $vars['giftcards'],
22
+ 'balance' => $vars['balance'],
23
+ 'isMultiple' => $this->_boolToStr($vars['is_multiple_codes']),
24
+ 'isRedeemable' => $this->_boolToStr($vars['is_redeemable']),
25
+ 'messageHtml' => nl2br(htmlspecialchars($vars['gift_message']))
26
+ )
27
+ );
28
+ }
29
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Newgiftregistry.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Newgiftregistry extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $owner = $vars['owner'];
13
+ $registry = $vars['entity'];
14
+
15
+ return array(
16
+ 'storeInfo' => $this->_getStoreInfoProps(),
17
+ 'customerInfo' => array(
18
+ 'firstName' => $owner->getFirstname(),
19
+ 'lastName' => $owner->getLastname()
20
+ ),
21
+ 'giftRegistry' => array(
22
+ 'title' => $registry->getTitle(),
23
+ 'message' => $registry->getMessage(),
24
+ 'url' => $vars['url'],
25
+ 'id' => $registry->getUrlKey()
26
+ )
27
+ );
28
+ }
29
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Newinvoice.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Newinvoice extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $order = $vars['order'];
13
+ $invoice = $vars['invoice'];
14
+
15
+ $itemsHtml = $this->_getLayoutHandleContent('sales_email_order_invoice_items', array(
16
+ 'order' => $order,
17
+ 'invoice' => $invoice
18
+ ));
19
+
20
+ $shippingAddress = $order->getShippingAddress();
21
+ $shippingAddress = empty($shippingAddress) ? '' : $shippingAddress->format('html');
22
+
23
+ return array(
24
+ 'storeInfo' => $this->_getStoreInfoProps(),
25
+ 'customerInfo' => array(
26
+ 'firstName' => $order->getCustomerFirstname(),
27
+ 'lastName' => $order->getCustomerLastname(),
28
+ 'isRegistered' => $this->_boolToStr(strpos($this->getTemplateId(), 'guest') === false)
29
+ ),
30
+ 'order' => array(
31
+ 'accountUrl' => Mage::getUrl('customer/account/'),
32
+ 'incrementId' => $order->getIncrementId(),
33
+ 'isVirtual' => $this->_boolToStr($order->getIsVirtual()),
34
+ 'billingAddressHtml' => $order->getBillingAddress()->format('html'),
35
+ 'paymentDetailsHtml' => $vars['payment_html'],
36
+ 'shippingAddressHtml' => $shippingAddress,
37
+ 'shippingDetails' => $order->getShippingDescription(),
38
+ 'orderItemsTable' => $itemsHtml
39
+ ),
40
+ 'invoice' => array(
41
+ 'incrementId' => $invoice->getIncrementId(),
42
+ 'comments' => $vars['comment']
43
+ )
44
+ );
45
+ }
46
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Neworder.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Neworder extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $order = $vars['order'];
13
+
14
+ $itemsHtml = $this->_getLayoutHandleContent('sales_email_order_items', array('order' => $order));
15
+
16
+ $shippingAddress = $order->getShippingAddress();
17
+ $shippingAddress = empty($shippingAddress) ? '' : $shippingAddress->format('html');
18
+
19
+ return array(
20
+ 'storeInfo' => $this->_getStoreInfoProps(),
21
+ 'customerInfo' => array(
22
+ 'firstName' => $order->getCustomerFirstname(),
23
+ 'lastName' => $order->getCustomerLastname(),
24
+ 'isRegistered' => $this->_boolToStr(strpos($this->getTemplateId(), 'guest') === false)
25
+ ),
26
+ 'order' => array(
27
+ 'accountUrl' => Mage::getUrl('customer/account/'),
28
+ 'incrementId' => $order->getIncrementId(),
29
+ 'orderDate' => $order->getCreatedAtFormated('long'),
30
+ 'isVirtual' => $this->_boolToStr($order->getIsVirtual()),
31
+ 'billingAddressHtml' => $order->getBillingAddress()->format('html'),
32
+ 'paymentDetailsHtml' => $vars['payment_html'],
33
+ 'shippingAddressHtml' => $shippingAddress,
34
+ 'shippingDetails' => $order->getShippingDescription(),
35
+ 'orderItemsTable' => $itemsHtml,
36
+ 'orderNote' => $order->getEmailCustomerNote()
37
+ )
38
+ );
39
+ }
40
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Newpassword.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Newpassword extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $customer = $vars['customer'];
13
+
14
+ return array(
15
+ 'storeInfo' => $this->_getStoreInfoProps(),
16
+ 'customerInfo' => array(
17
+ 'firstName' => $customer->getFirstname(),
18
+ 'lastName' => $customer->getLastname(),
19
+ 'password' => $customer->getPassword(),
20
+ 'accountUrl' => Mage::getUrl('customer/account/')
21
+ )
22
+ );
23
+ }
24
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Newrma.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Newrma extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $order = $vars['order'];
13
+ $rma = $vars['rma'];
14
+
15
+ $itemsHtml = $this->_getLayoutHandleContent('enterprise_rma_email_rma_items', array(
16
+ 'collection' => $vars['item_collection']
17
+ ));
18
+
19
+ return array(
20
+ 'storeInfo' => $this->_getStoreInfoProps(),
21
+ 'customerInfo' => array(
22
+ 'firstName' => $order->getCustomerFirstname(),
23
+ 'lastName' => $order->getCustomerLastname(),
24
+ 'isRegistered' => $this->_boolToStr(strpos($this->getTemplateId(), 'guest') === false)
25
+ ),
26
+ 'order' => array(
27
+ 'accountUrl' => Mage::getUrl('customer/account/'),
28
+ 'incrementId' => $order->getIncrementId(),
29
+ 'shippingAddressHtml' => $order->getShippingAddress()->format('html')
30
+ ),
31
+ 'rma' => array(
32
+ 'incrementId' => $rma->getIncrementId(),
33
+ 'statusLabel' => $rma->getStatusLabel(),
34
+ 'createdDate' => $rma->getCreatedAtFormated('long'),
35
+ 'returnAddressHtml' => $vars['return_address'],
36
+ 'returnItemsTable' => $itemsHtml
37
+ )
38
+ );
39
+ }
40
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Newshipment.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Newshipment extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $order = $vars['order'];
13
+ $shipment = $vars['shipment'];
14
+
15
+ $itemsHtml = $this->_getLayoutHandleContent('sales_email_order_shipment_items', array(
16
+ 'order' => $order,
17
+ 'shipment' => $shipment
18
+ ));
19
+
20
+ $trackingHtml = $this->_getBlockContent('core/template', 'email/order/shipment/track.phtml', array(
21
+ 'order' => $order,
22
+ 'shipment' => $shipment
23
+ ));
24
+
25
+ $shippingAddress = $order->getShippingAddress();
26
+ $shippingAddress = empty($shippingAddress) ? '' : $shippingAddress->format('html');
27
+
28
+ return array(
29
+ 'storeInfo' => $this->_getStoreInfoProps(),
30
+ 'customerInfo' => array(
31
+ 'firstName' => $order->getCustomerFirstname(),
32
+ 'lastName' => $order->getCustomerLastname(),
33
+ 'isRegistered' => $this->_boolToStr(strpos($this->getTemplateId(), 'guest') === false)
34
+ ),
35
+ 'order' => array(
36
+ 'accountUrl' => Mage::getUrl('customer/account/'),
37
+ 'incrementId' => $order->getIncrementId(),
38
+ 'isVirtual' => $this->_boolToStr($order->getIsVirtual()),
39
+ 'billingAddressHtml' => $order->getBillingAddress()->format('html'),
40
+ 'paymentDetailsHtml' => $vars['payment_html'],
41
+ 'shippingAddressHtml' => $shippingAddress,
42
+ 'shippingDetails' => $order->getShippingDescription(),
43
+ 'orderItemsTable' => $itemsHtml
44
+ ),
45
+ 'shipment' => array(
46
+ 'incrementId' => $shipment->getIncrementId(),
47
+ 'trackingInfo' => $trackingHtml,
48
+ 'comments' => $vars['comment']
49
+ )
50
+ );
51
+ }
52
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Orderupdate.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Orderupdate extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $order = $vars['order'];
13
+
14
+ return array(
15
+ 'storeInfo' => $this->_getStoreInfoProps(),
16
+ 'customerInfo' => array(
17
+ 'firstName' => $order->getCustomerFirstname(),
18
+ 'lastName' => $order->getCustomerLastname(),
19
+ 'isRegistered' => $this->_boolToStr(strpos($this->getTemplateId(), 'guest') === false)
20
+ ),
21
+ 'order' => array(
22
+ 'accountUrl' => Mage::getUrl('customer/account/'),
23
+ 'incrementId' => $order->getIncrementId(),
24
+ 'statusLabel' => $order->getStatusLabel(),
25
+ 'comments' => $vars['comment']
26
+ )
27
+ );
28
+ }
29
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Pointsexpiring.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Pointsexpiring extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $customer = $vars['customer'];
13
+
14
+ return array(
15
+ 'storeInfo' => $this->_getStoreInfoProps(),
16
+ 'customerInfo' => array(
17
+ 'fullName' => $vars['customer_name']
18
+ ),
19
+ 'rewardPoints' => array(
20
+ 'unsubscribeUrl' => $vars['unsubscription_url'],
21
+ 'pointsBalance' => $vars['points_balance'],
22
+ 'pointsExpiring' => $vars['points_expiring'],
23
+ 'daysRemaining' => $vars['remaining_days'],
24
+ 'amountNow' => $vars['reward_amount_now'],
25
+ 'comments' => $vars['update_message']
26
+ )
27
+ );
28
+ }
29
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Pointsupdate.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Pointsupdate extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $customer = $vars['customer'];
13
+
14
+ return array(
15
+ 'storeInfo' => $this->_getStoreInfoProps(),
16
+ 'customerInfo' => array(
17
+ 'firstName' => $customer->getFirstname(),
18
+ 'lastName' => $customer->getLastname()
19
+ ),
20
+ 'rewardPoints' => array(
21
+ 'unsubscribeUrl' => $vars['unsubscription_url'],
22
+ 'pointsWas' => $vars['reward_pts_was'],
23
+ 'pointsChange' => $vars['reward_pts_change'],
24
+ 'pointsBalance' => $vars['points_balance'],
25
+ 'amountWas' => $vars['reward_amount_was'],
26
+ 'amountNow' => $vars['reward_amount_now'],
27
+ 'reason' => $vars['update_message'],
28
+ 'comments' => $vars['update_comment']
29
+ )
30
+ );
31
+ }
32
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Resetpassword.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Resetpassword extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $customer = $vars['customer'];
13
+ $resetUrl = Mage::getUrl('customer/account/resetpassword', array(
14
+ '_query' => array(
15
+ 'id' => $customer->getId(),
16
+ 'token' => $customer->getRpToken()
17
+ )
18
+ ));
19
+
20
+ return array(
21
+ 'storeInfo' => $this->_getStoreInfoProps(),
22
+ 'customerInfo' => array(
23
+ 'firstName' => $customer->getFirstname(),
24
+ 'lastName' => $customer->getLastname()
25
+ ),
26
+ 'resetPassword' => array(
27
+ 'resetPasswordLink' => $resetUrl
28
+ )
29
+ );
30
+ }
31
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Rmaauth.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Rmaauth extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $order = $vars['order'];
13
+ $rma = $vars['rma'];
14
+
15
+ $itemsHtml = $this->_getLayoutHandleContent('enterprise_rma_email_rma_items', array(
16
+ 'collection' => $vars['item_collection']
17
+ ));
18
+
19
+ return array(
20
+ 'storeInfo' => $this->_getStoreInfoProps(),
21
+ 'customerInfo' => array(
22
+ 'firstName' => $order->getCustomerFirstname(),
23
+ 'lastName' => $order->getCustomerLastname(),
24
+ 'isRegistered' => $this->_boolToStr(strpos($this->getTemplateId(), 'guest') === false)
25
+ ),
26
+ 'order' => array(
27
+ 'accountUrl' => Mage::getUrl('customer/account/'),
28
+ 'incrementId' => $order->getIncrementId(),
29
+ 'shippingAddressHtml' => $order->getShippingAddress()->format('html')
30
+ ),
31
+ 'rma' => array(
32
+ 'incrementId' => $rma->getIncrementId(),
33
+ 'statusLabel' => $rma->getStatusLabel(),
34
+ 'returnAddressHtml' => $vars['return_address'],
35
+ 'returnItemsTable' => $itemsHtml
36
+ )
37
+ );
38
+ }
39
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Rmaupdate.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Rmaupdate extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $order = $vars['order'];
13
+ $rma = $vars['rma'];
14
+
15
+ return array(
16
+ 'storeInfo' => $this->_getStoreInfoProps(),
17
+ 'customerInfo' => array(
18
+ 'firstName' => $order->getCustomerFirstname(),
19
+ 'lastName' => $order->getCustomerLastname(),
20
+ 'isRegistered' => $this->_boolToStr(strpos($this->getTemplateId(), 'guest') === false)
21
+ ),
22
+ 'order' => array(
23
+ 'accountUrl' => Mage::getUrl('customer/account/'),
24
+ 'incrementId' => $order->getIncrementId()
25
+ ),
26
+ 'rma' => array(
27
+ 'incrementId' => $rma->getIncrementId(),
28
+ 'comments' => $vars['comment']
29
+ )
30
+ );
31
+ }
32
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Sendfriend.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Sendfriend extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ return array(
13
+ 'storeInfo' => $this->_getStoreInfoProps(),
14
+ 'sender' => array(
15
+ 'fullName' => $vars['sender_name'],
16
+ 'email' => $vars['sender_email']
17
+ ),
18
+ 'recipient' => array(
19
+ 'fullName' => $vars['name']
20
+ ),
21
+ 'productUrl' => $vars['product_url'],
22
+ 'productName' => $vars['product_name'],
23
+ 'message' => $vars['message']
24
+ );
25
+ }
26
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Shipmentupdate.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Shipmentupdate extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $order = $vars['order'];
13
+ $shipment = $vars['shipment'];
14
+
15
+ return array(
16
+ 'storeInfo' => $this->_getStoreInfoProps(),
17
+ 'customerInfo' => array(
18
+ 'firstName' => $order->getCustomerFirstname(),
19
+ 'lastName' => $order->getCustomerLastname(),
20
+ 'isRegistered' => $this->_boolToStr(strpos($this->getTemplateId(), 'guest') === false)
21
+ ),
22
+ 'order' => array(
23
+ 'accountUrl' => Mage::getUrl('customer/account/'),
24
+ 'incrementId' => $order->getIncrementId(),
25
+ 'statusLabel' => $order->getStatusLabel()
26
+ ),
27
+ 'shipment' => array(
28
+ 'incrementId' => $shipment->getIncrementId(),
29
+ 'comments' => $vars['comment']
30
+ )
31
+ );
32
+ }
33
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Storecredit.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Storecredit extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ return array(
13
+ 'storeInfo' => $this->_getStoreInfoProps(),
14
+ 'customerInfo' => array(
15
+ 'fullName' => $vars['name'],
16
+ 'creditBalance' => $vars['balance']
17
+ )
18
+ );
19
+ }
20
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Message/Wishlistshare.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Message_Wishlistshare extends TrueAction_EDialogTransactional_Model_Message
9
+ {
10
+ protected function _getEventProps($vars)
11
+ {
12
+ $customer = $vars['customer'];
13
+
14
+ return array(
15
+ 'storeInfo' => $this->_getStoreInfoProps(),
16
+ 'customerInfo' => array(
17
+ 'firstName' => $customer->getFirstname(),
18
+ 'lastName' => $customer->getLastname()
19
+ ),
20
+ 'wishlist' => array(
21
+ 'itemsHtml' => $vars['items'],
22
+ 'message' => $vars['message'],
23
+ 'wishlistUrl' => $vars['viewOnSiteLink'],
24
+ 'isSaleable' => $this->_boolToStr($vars['salable']),
25
+ 'addAllToCartUrl' => $vars['addAllLink']
26
+ )
27
+ );
28
+ }
29
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Mysql4/Queue.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Mysql4_Queue extends Mage_Core_Model_Mysql4_Abstract
9
+ {
10
+ protected function _construct()
11
+ {
12
+ $this->_init('edialog_transactional/queue', 'mail_id');
13
+ }
14
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Mysql4/Queue/Collection.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Mysql4_Queue_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
9
+ {
10
+ protected function _construct()
11
+ {
12
+ $this->_init('edialog_transactional/queue');
13
+ }
14
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Observer.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Observer
9
+ {
10
+ /**
11
+ * Intercepts Magento email template load event and sends e-Dialog email instead.
12
+ *
13
+ * @param Varien_Event_Observer $observer
14
+ */
15
+ public function replaceWithEDialogEmail(Varien_Event_Observer $observer)
16
+ {
17
+ $helper = Mage::helper('edialog_transactional');
18
+ if (! $helper->isEnabled()) return;
19
+
20
+ list ($templateId, , $toEmail, $toName, $vars, $storeId) = array_values($observer['transactionalOptions']);
21
+ $toEmail = is_array($toEmail) ? $toEmail[0] : $toEmail;
22
+ $toName = is_array($toName) ? $toName[0] : $toName;
23
+
24
+ // Get the appropriate message class for this trigger.
25
+ $triggerName = $helper->getTriggerByTemplate($templateId);
26
+ if (empty($triggerName)) {
27
+ $helper->log('UNHANDLED MESSAGE: ' . $templateId);
28
+ return;
29
+ }
30
+ $modelClassPath = 'edialog_transactional/message_' . strtolower($triggerName);
31
+
32
+ // Load the message model.
33
+ try {
34
+ $edMessage = Mage::getModel($modelClassPath);
35
+ if (false === $edMessage) throw new Exception();
36
+ } catch (Exception $e) {
37
+ $helper->logException(new Exception('Could not load e-Dialog template model ' . $modelClassPath));
38
+ return;
39
+ }
40
+
41
+ // Send the email and mark as sent in Magento's object if successful.
42
+ $isEDialogCaptured = $edMessage->send($templateId, $toEmail, $toName, $vars, $storeId);
43
+ $observer['template']->setSentSuccess($isEDialogCaptured);
44
+ }
45
+
46
+ /**
47
+ * Process a cron trigger to asynchronously send emails in the queue.
48
+ *
49
+ * @param Mage_Cron_Model_Schedule $schedule
50
+ */
51
+ public function processEmailQueue(Mage_Cron_Model_Schedule $schedule)
52
+ {
53
+ $helper = Mage::helper('edialog_transactional');
54
+ $queuedEmails = Mage::getModel('edialog_transactional/queue')->getCollection();
55
+ foreach ($queuedEmails as $queuedEmail) {
56
+ $attemptCount = 1 + $queuedEmail->getAttemptCount();
57
+ $helper->log(sprintf('DEQUEUED: #%s, attempt #%s', $queuedEmail->getId(), $attemptCount));
58
+ $sendSuccess = $helper->sendEmailToEDialog(json_decode($queuedEmail->getSoapParams(), true));
59
+
60
+ if ($sendSuccess) {
61
+ $queuedEmail->delete();
62
+ } else if ($attemptCount < $helper::MAX_DELIVERY_ATTEMPTS) {
63
+ $helper->log('LEAVING IN QUEUE: #' . $queuedEmail->getId());
64
+ $queuedEmail->setAttemptCount($attemptCount);
65
+ $queuedEmail->save();
66
+ } else {
67
+ $helper->log('GIVING UP ON: #' . $queuedEmail->getId());
68
+ $queuedEmail->delete();
69
+ }
70
+ }
71
+ }
72
+ }
app/code/community/TrueAction/EDialogTransactional/Model/Queue.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Model_Queue extends Mage_Core_Model_Abstract
9
+ {
10
+ protected function _construct()
11
+ {
12
+ $this->_init('edialog_transactional/queue');
13
+ }
14
+ }
app/code/community/TrueAction/EDialogTransactional/controllers/Adminhtml/EdialogtransactionalController.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ class TrueAction_EDialogTransactional_Adminhtml_EdialogtransactionalController extends Mage_Adminhtml_Controller_Action
9
+ {
10
+ const MSG_PROD_SUCCESS = 'Production mode is now enabled for e-Dialog transactional messages.';
11
+ const MSG_ERROR = 'Failed to change mode. See exception log for details.';
12
+
13
+ public function promotecellsAction()
14
+ {
15
+ $helper = Mage::helper('edialog_transactional');
16
+ if ($helper->promoteToProduction()) {
17
+ Mage::getSingleton('core/session')->addSuccess($helper->__(self::MSG_PROD_SUCCESS));
18
+ } else {
19
+ Mage::getSingleton('core/session')->addError($helper->__(self::MSG_ERROR));
20
+ }
21
+ $this->_redirectReferer();
22
+ }
23
+
24
+ public function demotecellsAction()
25
+ {
26
+ // ...
27
+ }
28
+ }
app/code/community/TrueAction/EDialogTransactional/etc/config.xml ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * @category TrueAction
5
+ * @package TrueAction_EDialogMarketing
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+
10
+ <config>
11
+ <modules>
12
+ <TrueAction_EDialogTransactional>
13
+ <version>1.0.0</version>
14
+ </TrueAction_EDialogTransactional>
15
+ </modules>
16
+ <global>
17
+ <helpers>
18
+ <edialog_transactional>
19
+ <class>TrueAction_EDialogTransactional_Helper</class>
20
+ </edialog_transactional>
21
+ </helpers>
22
+ <blocks>
23
+ <edialog_transactional>
24
+ <class>TrueAction_EDialogTransactional_Block</class>
25
+ </edialog_transactional>
26
+ </blocks>
27
+ <models>
28
+ <edialog_transactional>
29
+ <class>TrueAction_EDialogTransactional_Model</class>
30
+ <resourceModel>edialog_transactional_mysql4</resourceModel>
31
+ </edialog_transactional>
32
+ <edialog_transactional_mysql4>
33
+ <class>TrueAction_EDialogTransactional_Model_Mysql4</class>
34
+ <entities>
35
+ <queue>
36
+ <table>edialog_trans_mail_queue</table>
37
+ </queue>
38
+ </entities>
39
+ </edialog_transactional_mysql4>
40
+ <core>
41
+ <rewrite>
42
+ <email_template>TrueAction_EDialogTransactional_Model_Core_Email_Template</email_template>
43
+ </rewrite>
44
+ </core>
45
+ </models>
46
+ <resources>
47
+ <edialog_transactional_setup>
48
+ <setup>
49
+ <module>TrueAction_EDialogTransactional</module>
50
+ </setup>
51
+ <connection>
52
+ <use>core_setup</use>
53
+ </connection>
54
+ </edialog_transactional_setup>
55
+ <edialog_transactional_write>
56
+ <connection>
57
+ <use>core_write</use>
58
+ </connection>
59
+ </edialog_transactional_write>
60
+ <edialog_transactional_read>
61
+ <connection>
62
+ <use>core_read</use>
63
+ </connection>
64
+ </edialog_transactional_read>
65
+ </resources>
66
+ <events>
67
+ <email_template_load_before>
68
+ <observers>
69
+ <tan_edialog_transactional>
70
+ <type>singleton</type>
71
+ <class>TrueAction_EDialogTransactional_Model_Observer</class>
72
+ <method>replaceWithEDialogEmail</method>
73
+ </tan_edialog_transactional>
74
+ </observers>
75
+ </email_template_load_before>
76
+ </events>
77
+ </global>
78
+ <admin>
79
+ <routers>
80
+ <adminhtml>
81
+ <args>
82
+ <modules>
83
+ <edialog_transactional>TrueAction_EDialogTransactional_Adminhtml</edialog_transactional>
84
+ </modules>
85
+ </args>
86
+ </adminhtml>
87
+ </routers>
88
+ </admin>
89
+ <adminhtml>
90
+ <acl>
91
+ <resources>
92
+ <admin>
93
+ <children>
94
+ <system>
95
+ <children>
96
+ <config>
97
+ <children>
98
+ <email_marketing>
99
+ <title>Email Marketing</title>
100
+ </email_marketing>
101
+ </children>
102
+ </config>
103
+ </children>
104
+ </system>
105
+ </children>
106
+ </admin>
107
+ </resources>
108
+ </acl>
109
+ </adminhtml>
110
+
111
+ <!-- Default configuration values -->
112
+ <default>
113
+ <email_marketing>
114
+ <edialog_transactional>
115
+ <password backend_model="adminhtml/system_config_backend_encrypted" />
116
+ <customer_channel>default</customer_channel>
117
+ </edialog_transactional>
118
+ </email_marketing>
119
+ </default>
120
+
121
+ <!-- Cron job to send emails asynchronously -->
122
+ <crontab>
123
+ <jobs>
124
+ <edialog_transactional_process_queue>
125
+ <schedule>
126
+ <cron_expr>*/5 * * * *</cron_expr>
127
+ </schedule>
128
+ <run>
129
+ <model>edialog_transactional/observer::processEmailQueue</model>
130
+ </run>
131
+ </edialog_transactional_process_queue>
132
+ </jobs>
133
+ </crontab>
134
+ </config>
app/code/community/TrueAction/EDialogTransactional/etc/system.xml ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * @category TrueAction
5
+ * @package TrueAction_EDialogTransactional
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+ <config>
10
+ <tabs>
11
+ <marketing translate="label" module="edialog_transactional">
12
+ <label>Marketing</label>
13
+ <sort_order>99999</sort_order>
14
+ </marketing>
15
+ </tabs>
16
+ <sections>
17
+ <email_marketing>
18
+ <label>Email Marketing</label>
19
+ <tab>marketing</tab>
20
+ <frontend_type>text</frontend_type>
21
+ <sort_order>100</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <groups>
26
+ <edialog_transactional translate="label">
27
+ <label>e-Dialog Enterprise Transactional</label>
28
+ <frontend_type>text</frontend_type>
29
+ <sort_order>1</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ <comment><![CDATA[
34
+ This extension requres you to have an account with e-Dialog. If you do not have an
35
+ account or do not know the account information to enter below, please contact
36
+ <a href="http://www.e-dialog.com/index.php/contact_us/" target="_blank">e-Dialog</a> for details.
37
+ ]]></comment>
38
+ <fields>
39
+ <production_mode>
40
+ <show_in_default>0</show_in_default>
41
+ <show_in_website>0</show_in_website>
42
+ <show_in_store>0</show_in_store>
43
+ </production_mode>
44
+ <enabled translate="label">
45
+ <label>Enable e-Dialog Enterprise Transactional</label>
46
+ <frontend_type>select</frontend_type>
47
+ <source_model>adminhtml/system_config_source_yesno</source_model>
48
+ <sort_order>10</sort_order>
49
+ <show_in_default>1</show_in_default>
50
+ <show_in_website>1</show_in_website>
51
+ <show_in_store>1</show_in_store>
52
+ </enabled>
53
+ <username translate="label">
54
+ <label>e-Dialog SDK Username</label>
55
+ <frontend_type>text</frontend_type>
56
+ <sort_order>20</sort_order>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>0</show_in_website>
59
+ <show_in_store>0</show_in_store>
60
+ </username>
61
+ <password translate="label">
62
+ <label>e-Dialog SDK Password</label>
63
+ <frontend_type>obscure</frontend_type>
64
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
65
+ <sort_order>30</sort_order>
66
+ <show_in_default>1</show_in_default>
67
+ <show_in_website>0</show_in_website>
68
+ <show_in_store>0</show_in_store>
69
+ </password>
70
+ <customer_channel translate="label">
71
+ <label>Customer Channel ID</label>
72
+ <frontend_type>text</frontend_type>
73
+ <sort_order>40</sort_order>
74
+ <comment><![CDATA[
75
+ If you wish to segment your customers in e-Dialog's database by website
76
+ or store view, set this to a different value for each unique area.
77
+ ]]></comment>
78
+ <show_in_default>0</show_in_default>
79
+ <show_in_website>1</show_in_website>
80
+ <show_in_store>1</show_in_store>
81
+ </customer_channel>
82
+ <proof_email translate="label">
83
+ <label>QA Proof Email Recipient</label>
84
+ <frontend_type>text</frontend_type>
85
+ <sort_order>50</sort_order>
86
+ <comment><![CDATA[
87
+ When in QA mode, the email address set here will receive all emails.
88
+ Multiple addresses can be specified, separated by commas.
89
+ ]]></comment>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>1</show_in_website>
92
+ <show_in_store>1</show_in_store>
93
+ </proof_email>
94
+ <logging_enabled translate="label">
95
+ <label>Enable Email Logging</label>
96
+ <frontend_type>select</frontend_type>
97
+ <source_model>adminhtml/system_config_source_yesno</source_model>
98
+ <sort_order>60</sort_order>
99
+ <show_in_default>1</show_in_default>
100
+ <show_in_website>1</show_in_website>
101
+ <show_in_store>1</show_in_store>
102
+ </logging_enabled>
103
+ <promote_button>
104
+ <label>Current Mode</label>
105
+ <frontend_model>edialog_transactional/adminhtml_productiontoggle</frontend_model>
106
+ <sort_order>100</sort_order>
107
+ <comment><![CDATA[
108
+ When in QA mode, e-Dialog will send all emails as proofs to the email
109
+ address(es) specified above. If Magento is appropriately configured,
110
+ the emails will continue to be sent to their intended recipients through
111
+ Magento's built-in mailer.<br><br>
112
+
113
+ When in production mode, e-Dialog will override the built-in mailer
114
+ and send emails to their intended recipients. <strong>Once in production
115
+ mode, it is not possible to switch back to QA mode.</strong>
116
+ ]]></comment>
117
+ <show_in_default>1</show_in_default>
118
+ <show_in_website>0</show_in_website>
119
+ <show_in_store>0</show_in_store>
120
+ </promote_button>
121
+ </fields>
122
+ </edialog_transactional>
123
+ </groups>
124
+ </email_marketing>
125
+ </sections>
126
+ </config>
app/code/community/TrueAction/EDialogTransactional/sql/edialog_transactional_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category TrueAction
4
+ * @package TrueAction_EDialogTransactional
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+
8
+ $installer = $this;
9
+ $installer->startSetup();
10
+ $installer->run("
11
+ CREATE TABLE `{$installer->getTable('edialog_transactional/queue')}` (
12
+ `mail_id` int(10) unsigned NOT NULL auto_increment,
13
+ `soap_params` text,
14
+ `attempt_count` int(10) unsigned NOT NULL default 0,
15
+ `timestamp` timestamp NOT NULL default current_timestamp,
16
+ PRIMARY KEY (`mail_id`)
17
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
18
+ ");
19
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/edialogmarketing.xml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category design
5
+ * @package base_default
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+ <layout>
10
+ <adminhtml_edialogmarketing_register_index>
11
+ <reference name="root">
12
+ <action method="setTemplate"><template>edialogmarketing/register/view.phtml</template></action>
13
+ </reference>
14
+ </adminhtml_edialogmarketing_register_index>
15
+ </layout>
app/design/adminhtml/default/default/template/edialogmarketing/beacon.phtml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category design
4
+ * @package base_default
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ * @var $this = TrueAction_EDialogMarketing_Block_Beacon
7
+ */
8
+ ?>
9
+ <?php if ($this->showBeacon()):?>
10
+ <script>
11
+ (function () {
12
+ var i=new Image();i.src='<?php echo $this->getBeaconUrl() ?>';
13
+ }());
14
+ </script>
15
+ <noscript>
16
+ <img src="<?php echo $this->getBeaconUrl() ?>" width="1" height="1" border="0">
17
+ </noscript>
18
+ <?php endif?>
app/design/adminhtml/default/default/template/edialogmarketing/checkout/onepage/billing.phtml ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category design
4
+ * @package base_default
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ * @var $this = TrueAction_EDialogMarketing_Block_Beacon
7
+ */
8
+ ?>
9
+ <form id="co-billing-form" action="">
10
+ <fieldset>
11
+ <ul class="form-list">
12
+ <?php if ($this->customerHasAddresses()): ?>
13
+ <li class="form-alt">
14
+ <label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
15
+ <div class="input-box">
16
+ <?php echo $this->getAddressesHtmlSelect('billing') ?>
17
+ </div>
18
+ </li>
19
+ <?php endif; ?>
20
+ <li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
21
+ <div class="fieldset">
22
+ <input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
23
+ <ul>
24
+ <li class="fields">
25
+ <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject( $this->getAddress() )->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
26
+ </li>
27
+ <li>
28
+ <label for="billing:company"><?php echo $this->__('Company') ?></label>
29
+ <div class="input-box">
30
+ <input type="text" id="billing:company" name="billing[company]" value="<?php echo $this->htmlEscape($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text" />
31
+ </div>
32
+ </li>
33
+ <?php if(!$this->isCustomerLoggedIn()): ?>
34
+ <li>
35
+ <label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
36
+ <div class="input-box">
37
+ <input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->htmlEscape($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
38
+ </div>
39
+ </li>
40
+ <?php endif ?>
41
+ <li>
42
+ <label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
43
+ <div class="input-box">
44
+ <input type="text" title="<?php echo $this->__('Street Address') ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet(1)) ?>" class="input-text required-entry" />
45
+ </div>
46
+ </li>
47
+ <?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
48
+ <li class="add-field">
49
+ <div class="input-box">
50
+ <input type="text" title="<?php echo $this->__('Street Address '.$_i) ?>" name="billing[street][]" id="billing:street<?php echo $_i?>" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet($_i)) ?>" class="input-text" />
51
+ </div>
52
+ </li>
53
+ <?php endfor ?>
54
+ <li class="fields">
55
+ <div class="field">
56
+ <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
57
+ <div class="input-box">
58
+ <input type="text" title="<?php echo $this->__('City') ?>" name="billing[city]" value="<?php echo $this->htmlEscape($this->getAddress()->getCity()) ?>" class="input-text required-entry" id="billing:city" />
59
+ </div>
60
+ </div>
61
+ <div class="field">
62
+ <label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
63
+ <div class="input-box">
64
+ <select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
65
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
66
+ </select>
67
+ <script type="text/javascript">
68
+ $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
69
+ </script>
70
+ <input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->htmlEscape($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
71
+ </div>
72
+ </div>
73
+ </li>
74
+ <li class="fields">
75
+ <div class="field">
76
+ <label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
77
+ <div class="input-box">
78
+ <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->htmlEscape($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international required-entry" />
79
+ </div>
80
+ </div>
81
+ <div class="field">
82
+ <label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
83
+ <div class="input-box">
84
+ <?php echo $this->getCountryHtmlSelect('billing') ?>
85
+ </div>
86
+ </div>
87
+ </li>
88
+ <li class="fields">
89
+ <div class="field">
90
+ <label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
91
+ <div class="input-box">
92
+ <input type="text" name="billing[telephone]" value="<?php echo $this->htmlEscape($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry" id="billing:telephone" />
93
+ </div>
94
+ </div>
95
+ <div class="field">
96
+ <label for="billing:fax"><?php echo $this->__('Fax') ?></label>
97
+ <div class="input-box">
98
+ <input type="text" name="billing[fax]" value="<?php echo $this->htmlEscape($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text" id="billing:fax" />
99
+ </div>
100
+ </div>
101
+ </li>
102
+
103
+ <?php $addressAttributes = $this->getChild('customer_form_billing_address_user_defined_attributes');?>
104
+ <?php if ($addressAttributes): ?>
105
+ <?php $addressAttributes->setEntity($this->getAddress())->setEntityType('customer_address');?>
106
+ <?php $addressAttributes->setFieldIdFormat('billing:%1$s')->setFieldNameFormat('billing[%1$s]');?>
107
+ <?php echo $addressAttributes->setExcludeFileAttributes(true)->setShowContainer(false)->toHtml()?>
108
+ <?php endif;?>
109
+
110
+ <?php if(!$this->isCustomerLoggedIn()): ?>
111
+ <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
112
+ <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
113
+ <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
114
+ <?php if ($_dob->isEnabled() || $_taxvat->isEnabled() || $_gender->isEnabled() ): ?>
115
+ <li class="fields">
116
+ <?php if ($_dob->isEnabled()): ?>
117
+ <div class="field">
118
+ <?php echo $_dob->setDate($this->getQuote()->getCustomerDob())
119
+ ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
120
+ </div>
121
+ <?php endif; ?>
122
+ <?php if ($_taxvat->isEnabled()): ?>
123
+ <div class="field">
124
+ <?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())
125
+ ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
126
+ </div>
127
+ <?php endif ?>
128
+ <?php if ($_gender->isEnabled()): ?>
129
+ <div class="field">
130
+ <?php echo $_gender->setGender($this->getQuote()->getCustomerGender())
131
+ ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
132
+ </div>
133
+ <?php endif ?>
134
+ </li>
135
+ <?php endif; ?>
136
+ <?php $customerAttributes = $this->getChild('customer_form_customer_user_defined_attributes');?>
137
+ <?php if ($customerAttributes): ?>
138
+ <?php $customerAttributes->setEntityModelClass('customer/customer')->setFieldIdFormat('billing:%1$s');?>
139
+ <?php $customerAttributes->setFieldNameFormat('billing[%1$s]')->setShowContainer(false);?>
140
+ <?php echo $customerAttributes->setExcludeFileAttributes(true)->toHtml()?>
141
+ <?php endif;?>
142
+ <li class="fields" id="register-customer-password">
143
+ <div class="field">
144
+ <label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
145
+ <div class="input-box">
146
+ <input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
147
+ </div>
148
+ </div>
149
+ <div class="field">
150
+ <label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
151
+ <div class="input-box">
152
+ <input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
153
+ </div>
154
+ </div>
155
+ </li>
156
+ <?php endif; ?>
157
+ <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
158
+ <li class="control">
159
+ <div class="input-box">
160
+ <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" />
161
+ </div>
162
+ <label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
163
+ </li>
164
+ <?php else:?>
165
+ <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
166
+ <?php endif; ?>
167
+ </ul>
168
+ </div>
169
+ </li>
170
+ <?php if ($this->canShip()): ?>
171
+ <li class="control">
172
+ <div class="input-box">
173
+ <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1"<?php if ($this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> onclick="$('shipping:same_as_billing').checked = true;" class="radio" />
174
+ </div>
175
+ <label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label>
176
+ </li>
177
+ <li class="control">
178
+ <div class="input-box">
179
+ <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0"<?php if (!$this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> onclick="$('shipping:same_as_billing').checked = false;" class="radio" />
180
+ </div>
181
+ <label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address') ?></label>
182
+ </li>
183
+ <?php endif; ?>
184
+ </ul>
185
+ <?php if (!$this->canShip()): ?>
186
+ <input type="hidden" name="billing[use_for_shipping]" value="1" />
187
+ <?php endif; ?>
188
+ <?php if ($this->showNewsletterOptIn()): ?>
189
+ <li class="control">
190
+ <input type="checkbox" id="checkout_opt_in" name="billing[checkout_opt_in]" checked />
191
+ <label for="checkout_opt_in"><?php echo $this->__('Subscribe to our newsletter.') ?></label>
192
+ <input type="hidden" name="billing[source]" value="checkout" />
193
+ </li>
194
+ <?php endif; ?>
195
+ </fieldset>
196
+ <div class="buttons-set form-buttons btn-only" id="billing-buttons-container">
197
+ <button type="button" class="button" onclick="billing.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
198
+ <span id="billing-please-wait" class="please-wait" style="display:none;">
199
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
200
+ </span>
201
+ </div>
202
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
203
+ </form>
204
+ <script type="text/javascript">
205
+ //<![CDATA[
206
+ var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
207
+ var billingForm = new VarienForm('co-billing-form');
208
+
209
+ //billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
210
+ $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
211
+
212
+ var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', countryRegions, undefined, 'billing:postcode');
213
+ //]]>
214
+ </script>
app/design/adminhtml/default/default/template/edialogmarketing/register/view.phtml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category design
4
+ * @package base_default
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+ ?>
8
+ <!DOCTYPE HTML>
9
+ <html lang="en-US">
10
+ <head>
11
+ <meta charset="UTF-8" />
12
+ <title><?php echo $this->__('Please wait') ?></title>
13
+ </head>
14
+ <body>
15
+ <?php /** @var $_helper Xcom_Ebay_Helper_Data */ ?>
16
+ <?php $_helper = $this->helper('edialogmarketing/xfabric'); ?>
17
+ <form id="xcom_registration" action="<?php echo $_helper->getRegistrationRequestUrl() ?>" method="post" enctype="multipart/form-data">
18
+ <input type="hidden" name="onboarding_info" value="<?php echo $_helper->getRegistrationRequest()->getOnboardingInfo() ?>" />
19
+ </form>
20
+ <script type="text/javascript">
21
+ document.forms['xcom_registration'].submit();
22
+ </script>
23
+ </body>
24
+ </html>
app/design/adminhtml/default/default/template/edialogmarketing/system/config/register_button.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category design
4
+ * @package base_default
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ */
7
+ ?>
8
+ <h4 id="heading_<?php echo $this->getHtmlId() ?>"><?php echo $this->getElementLabel() ?></h4>
9
+ <div id="system-fieldset-sub-head-comment"><?php echo $this->getElementComment() ?></div>
10
+ <div>
11
+ <button class="scalable add" type="button" id="<?php echo $this->getHtmlId() ?>">
12
+ <span><?php echo $this->escapeHtml($this->getButtonLabel()); ?></span>
13
+ </button>
14
+ </div>
15
+ <script type="text/javascript">
16
+ //<![CDATA[
17
+ var XFabricExtensionRegistration = Class.create();
18
+ XFabricExtensionRegistration.prototype = {
19
+ initialize: function() {
20
+ this.redirectURL = '<?php echo $this->getUrl($this->getButtonUrl())?>';
21
+ this.buttonId = '<?php echo $this->getHtmlId() ?>';
22
+ this.popupWindow = null;
23
+
24
+ $(this.buttonId).observe('click', this.openWindow.bindAsEventListener(this));
25
+ },
26
+
27
+ openWindow: function() {
28
+ if (this.popupWindow == null || this.popupWindow.closed) {
29
+ this.popupWindow = window.open(this.redirectURL, 'ExtensionRegistartion', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, ,left=100, top=100, width=815, height=640');
30
+ }
31
+ else {
32
+ this.popupWindow.focus();
33
+ }
34
+ if (typeof this.intervalID == "number") {
35
+ window.clearInterval(this.intervalID);
36
+ delete this.intervalID;
37
+ }
38
+ this.intervalID = window.setInterval(function(){this.checkWindow();}.bind(this), 500);
39
+ return false;
40
+ },
41
+
42
+ checkWindow: function() {
43
+ if (this.popupWindow != null && this.popupWindow.closed) {
44
+ window.clearInterval(this.intervalID);
45
+ delete this.intervalID;
46
+ window.location.reload(true);
47
+ }
48
+ }
49
+ };
50
+ var registrationExtension = new XFabricExtensionRegistration();
51
+ //]]>
52
+ </script>
app/design/adminhtml/default/default/template/edialogmarketing/unsubscribe.phtml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category design
4
+ * @package base_default
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ * @var $this TrueAction_EDialogMarketing_Block_Unsubscribe
7
+ */
8
+ ?>
9
+ <div class="block block-subscribe">
10
+ <div class="block-title">
11
+ <strong><span><?php echo $this->__('Newsletter') ?></span></strong>
12
+ </div>
13
+ <form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail">
14
+ <div class="block-content">
15
+ <div class="form-subscribe-header"><?php echo $this->__('Unsubscribe from our newsletter') ?></div>
16
+ <label for="newsletter"><?php echo $this->__('Unsubscribe From Our Newsletter:') ?></label>
17
+ <div class="input-box">
18
+ <input type="text" name="email" id="newsletter" title="<?php echo $this->__('Unsubscribe From Our Newsletter') ?>" class="input-text required-entry validate-email" value="<?php echo $this->getSubscriberEmail() ?>" />
19
+ </div>
20
+ <div class="actions">
21
+ <button type="submit" title="<?php echo $this->__('Unsubscribe') ?>" class="button"><span><span><?php echo $this->__('Unsubscribe') ?></span></span></button>
22
+ </div>
23
+ </div>
24
+ </form>
25
+ <script type="text/javascript">
26
+ //<![CDATA[
27
+ var newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');
28
+ //]]>
29
+ </script>
30
+ </div>
app/design/frontend/base/default/layout/edialogmarketing.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category design
5
+ * @package base
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+ <layout version="0.1.0">
10
+ <!-- update checkout/onepage/billing template to include opt in checkbox -->
11
+ <checkout_onepage_index>
12
+ <reference name="checkout.onepage.billing">
13
+ <action method="setTemplate" ifconfig="email_marketing/edialogmarketing/checkout_signup">
14
+ <template>edialogmarketing/checkout/onepage/billing.phtml</template>
15
+ </action>
16
+ </reference>
17
+ </checkout_onepage_index>
18
+
19
+ <edialogmarketing_subscriber_unsubscribe>
20
+ <reference name="root">
21
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
22
+ </reference>
23
+ <reference name="content">
24
+ <block type="edialogmarketing/unsubscribe" name="edialogmarketing.unsubscribe" template="edialogmarketing/unsubscribe.phtml" />
25
+ </reference>
26
+ <remove name="left" />
27
+ <remove name="right" />
28
+ </edialogmarketing_subscriber_unsubscribe>
29
+ </layout>
app/design/frontend/base/default/template/edialogmarketing/beacon.phtml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category design
4
+ * @package base_default
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ * @var $this = TrueAction_EDialogMarketing_Block_Beacon
7
+ */
8
+ ?>
9
+ <?php if ($this->showBeacon()):?>
10
+ <script>
11
+ (function () {
12
+ var i=new Image();i.src='<?php echo $this->getBeaconUrl() ?>';
13
+ }());
14
+ </script>
15
+ <noscript>
16
+ <img src="<?php echo $this->getBeaconUrl() ?>" width="1" height="1" border="0">
17
+ </noscript>
18
+ <?php endif?>
app/design/frontend/base/default/template/edialogmarketing/checkout/onepage/billing.phtml ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category design
4
+ * @package base_default
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ * @var $this = TrueAction_EDialogMarketing_Block_Beacon
7
+ */
8
+ ?>
9
+ <form id="co-billing-form" action="">
10
+ <fieldset>
11
+ <ul class="form-list">
12
+ <?php if ($this->customerHasAddresses()): ?>
13
+ <li class="form-alt">
14
+ <label for="billing-address-select"><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></label>
15
+ <div class="input-box">
16
+ <?php echo $this->getAddressesHtmlSelect('billing') ?>
17
+ </div>
18
+ </li>
19
+ <?php endif; ?>
20
+ <li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
21
+ <div class="fieldset">
22
+ <input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>" id="billing:address_id" />
23
+ <ul>
24
+ <li class="fields">
25
+ <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject( $this->getAddress() )->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
26
+ </li>
27
+ <li>
28
+ <label for="billing:company"><?php echo $this->__('Company') ?></label>
29
+ <div class="input-box">
30
+ <input type="text" id="billing:company" name="billing[company]" value="<?php echo $this->htmlEscape($this->getAddress()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text" />
31
+ </div>
32
+ </li>
33
+ <?php if(!$this->isCustomerLoggedIn()): ?>
34
+ <li>
35
+ <label for="billing:email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
36
+ <div class="input-box">
37
+ <input type="text" name="billing[email]" id="billing:email" value="<?php echo $this->htmlEscape($this->getAddress()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
38
+ </div>
39
+ </li>
40
+ <?php endif ?>
41
+ <li>
42
+ <label for="billing:street1" class="required"><em>*</em><?php echo $this->__('Address') ?></label>
43
+ <div class="input-box">
44
+ <input type="text" title="<?php echo $this->__('Street Address') ?>" name="billing[street][]" id="billing:street1" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet(1)) ?>" class="input-text required-entry" />
45
+ </div>
46
+ </li>
47
+ <?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
48
+ <li class="add-field">
49
+ <div class="input-box">
50
+ <input type="text" title="<?php echo $this->__('Street Address '.$_i) ?>" name="billing[street][]" id="billing:street<?php echo $_i?>" value="<?php echo $this->htmlEscape($this->getAddress()->getStreet($_i)) ?>" class="input-text" />
51
+ </div>
52
+ </li>
53
+ <?php endfor ?>
54
+ <li class="fields">
55
+ <div class="field">
56
+ <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
57
+ <div class="input-box">
58
+ <input type="text" title="<?php echo $this->__('City') ?>" name="billing[city]" value="<?php echo $this->htmlEscape($this->getAddress()->getCity()) ?>" class="input-text required-entry" id="billing:city" />
59
+ </div>
60
+ </div>
61
+ <div class="field">
62
+ <label for="billing:region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
63
+ <div class="input-box">
64
+ <select id="billing:region_id" name="billing[region_id]" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
65
+ <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
66
+ </select>
67
+ <script type="text/javascript">
68
+ $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
69
+ </script>
70
+ <input type="text" id="billing:region" name="billing[region]" value="<?php echo $this->htmlEscape($this->getAddress()->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
71
+ </div>
72
+ </div>
73
+ </li>
74
+ <li class="fields">
75
+ <div class="field">
76
+ <label for="billing:postcode" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
77
+ <div class="input-box">
78
+ <input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->htmlEscape($this->getAddress()->getPostcode()) ?>" class="input-text validate-zip-international required-entry" />
79
+ </div>
80
+ </div>
81
+ <div class="field">
82
+ <label for="billing:country_id" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
83
+ <div class="input-box">
84
+ <?php echo $this->getCountryHtmlSelect('billing') ?>
85
+ </div>
86
+ </div>
87
+ </li>
88
+ <li class="fields">
89
+ <div class="field">
90
+ <label for="billing:telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
91
+ <div class="input-box">
92
+ <input type="text" name="billing[telephone]" value="<?php echo $this->htmlEscape($this->getAddress()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry" id="billing:telephone" />
93
+ </div>
94
+ </div>
95
+ <div class="field">
96
+ <label for="billing:fax"><?php echo $this->__('Fax') ?></label>
97
+ <div class="input-box">
98
+ <input type="text" name="billing[fax]" value="<?php echo $this->htmlEscape($this->getAddress()->getFax()) ?>" title="<?php echo $this->__('Fax') ?>" class="input-text" id="billing:fax" />
99
+ </div>
100
+ </div>
101
+ </li>
102
+
103
+ <?php $addressAttributes = $this->getChild('customer_form_billing_address_user_defined_attributes');?>
104
+ <?php if ($addressAttributes): ?>
105
+ <?php $addressAttributes->setEntity($this->getAddress())->setEntityType('customer_address');?>
106
+ <?php $addressAttributes->setFieldIdFormat('billing:%1$s')->setFieldNameFormat('billing[%1$s]');?>
107
+ <?php echo $addressAttributes->setExcludeFileAttributes(true)->setShowContainer(false)->toHtml()?>
108
+ <?php endif;?>
109
+
110
+ <?php if(!$this->isCustomerLoggedIn()): ?>
111
+ <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
112
+ <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
113
+ <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
114
+ <?php if ($_dob->isEnabled() || $_taxvat->isEnabled() || $_gender->isEnabled() ): ?>
115
+ <li class="fields">
116
+ <?php if ($_dob->isEnabled()): ?>
117
+ <div class="field">
118
+ <?php echo $_dob->setDate($this->getQuote()->getCustomerDob())
119
+ ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
120
+ </div>
121
+ <?php endif; ?>
122
+ <?php if ($_taxvat->isEnabled()): ?>
123
+ <div class="field">
124
+ <?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())
125
+ ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
126
+ </div>
127
+ <?php endif ?>
128
+ <?php if ($_gender->isEnabled()): ?>
129
+ <div class="field">
130
+ <?php echo $_gender->setGender($this->getQuote()->getCustomerGender())
131
+ ->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
132
+ </div>
133
+ <?php endif ?>
134
+ </li>
135
+ <?php endif; ?>
136
+ <?php $customerAttributes = $this->getChild('customer_form_customer_user_defined_attributes');?>
137
+ <?php if ($customerAttributes): ?>
138
+ <?php $customerAttributes->setEntityModelClass('customer/customer')->setFieldIdFormat('billing:%1$s');?>
139
+ <?php $customerAttributes->setFieldNameFormat('billing[%1$s]')->setShowContainer(false);?>
140
+ <?php echo $customerAttributes->setExcludeFileAttributes(true)->toHtml()?>
141
+ <?php endif;?>
142
+ <li class="fields" id="register-customer-password">
143
+ <div class="field">
144
+ <label for="billing:customer_password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
145
+ <div class="input-box">
146
+ <input type="password" name="billing[customer_password]" id="billing:customer_password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
147
+ </div>
148
+ </div>
149
+ <div class="field">
150
+ <label for="billing:confirm_password" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
151
+ <div class="input-box">
152
+ <input type="password" name="billing[confirm_password]" title="<?php echo $this->__('Confirm Password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />
153
+ </div>
154
+ </div>
155
+ </li>
156
+ <?php endif; ?>
157
+ <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()):?>
158
+ <li class="control">
159
+ <div class="input-box">
160
+ <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" />
161
+ </div>
162
+ <label for="billing:save_in_address_book"><?php echo $this->__('Save in address book') ?></label>
163
+ </li>
164
+ <?php else:?>
165
+ <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li>
166
+ <?php endif; ?>
167
+ </ul>
168
+ </div>
169
+ </li>
170
+ <?php if ($this->canShip()): ?>
171
+ <li class="control">
172
+ <div class="input-box">
173
+ <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1"<?php if ($this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> onclick="$('shipping:same_as_billing').checked = true;" class="radio" />
174
+ </div>
175
+ <label for="billing:use_for_shipping_yes"><?php echo $this->__('Ship to this address') ?></label>
176
+ </li>
177
+ <li class="control">
178
+ <div class="input-box">
179
+ <input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0"<?php if (!$this->isUseBillingAddressForShipping()) {?> checked="checked"<?php }?> onclick="$('shipping:same_as_billing').checked = false;" class="radio" />
180
+ </div>
181
+ <label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address') ?></label>
182
+ </li>
183
+ <?php endif; ?>
184
+ </ul>
185
+ <?php if (!$this->canShip()): ?>
186
+ <input type="hidden" name="billing[use_for_shipping]" value="1" />
187
+ <?php endif; ?>
188
+ <?php if ($this->showNewsletterOptIn()): ?>
189
+ <li class="control">
190
+ <input type="checkbox" id="checkout_opt_in" name="billing[checkout_opt_in]" checked />
191
+ <label for="checkout_opt_in"><?php echo $this->__('Subscribe to our newsletter.') ?></label>
192
+ <input type="hidden" name="billing[source]" value="checkout" />
193
+ </li>
194
+ <?php endif; ?>
195
+ </fieldset>
196
+ <div class="buttons-set form-buttons btn-only" id="billing-buttons-container">
197
+ <button type="button" class="button" onclick="billing.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
198
+ <span id="billing-please-wait" class="please-wait" style="display:none;">
199
+ <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
200
+ </span>
201
+ </div>
202
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
203
+ </form>
204
+ <script type="text/javascript">
205
+ //<![CDATA[
206
+ var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
207
+ var billingForm = new VarienForm('co-billing-form');
208
+
209
+ //billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
210
+ $('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
211
+
212
+ var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', countryRegions, undefined, 'billing:postcode');
213
+ //]]>
214
+ </script>
app/design/frontend/base/default/template/edialogmarketing/unsubscribe.phtml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category design
4
+ * @package base_default
5
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
6
+ * @var $this TrueAction_EDialogMarketing_Block_Unsubscribe
7
+ */
8
+ ?>
9
+ <div class="block block-subscribe">
10
+ <div class="block-title">
11
+ <strong><span><?php echo $this->__('Newsletter') ?></span></strong>
12
+ </div>
13
+ <form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail">
14
+ <div class="block-content">
15
+ <div class="form-subscribe-header"><?php echo $this->__('Unsubscribe from our newsletter') ?></div>
16
+ <label for="newsletter"><?php echo $this->__('Unsubscribe From Our Newsletter:') ?></label>
17
+ <div class="input-box">
18
+ <input type="text" name="email" id="newsletter" title="<?php echo $this->__('Unsubscribe From Our Newsletter') ?>" class="input-text required-entry validate-email" value="<?php echo $this->getSubscriberEmail() ?>" />
19
+ </div>
20
+ <div class="actions">
21
+ <button type="submit" title="<?php echo $this->__('Unsubscribe') ?>" class="button"><span><span><?php echo $this->__('Unsubscribe') ?></span></span></button>
22
+ </div>
23
+ </div>
24
+ </form>
25
+ <script type="text/javascript">
26
+ //<![CDATA[
27
+ var newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');
28
+ //]]>
29
+ </script>
30
+ </div>
app/etc/modules/TrueAction_EDialogMarketing.xml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ /**
4
+ * @category TrueAction
5
+ * @package TrueAction_EDialogMarketing
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <TrueAction_EDialogMarketing>
12
+ <active>true</active>
13
+ <codePool>community</codePool>
14
+ <depends>
15
+ <Xcom_Xfabric />
16
+ </depends>
17
+ </TrueAction_EDialogMarketing>
18
+ </modules>
19
+ </config>
app/etc/modules/TrueAction_EDialogTransactional.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category TrueAction
5
+ * @package TrueAction_EDialogTransactional
6
+ * @copyright Copyright (c) 2012 True Action Network (http://www.trueaction.com)
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <TrueAction_EDialogTransactional>
12
+ <active>true</active>
13
+ <codePool>community</codePool>
14
+ </TrueAction_EDialogTransactional>
15
+ </modules>
16
+ </config>
package.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>eDialogEnterprise</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://media.trueaction.com/magento/LICENSE.TXT">GSI Commerce End User License Agreement</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Precision Central&#xAE; is e-Dialog&#x2019;s premiere email and cross-channel marketing platform.</summary>
10
+ <description>&lt;h2&gt;Overview: &lt;/h2&gt;&#xD;
11
+ &lt;p&gt;e-Dialog&#x2019;s Precision Central&#xAE; suite makes it easy to perform all aspects of email and cross-channel marketing including:&lt;/p&gt;&#xD;
12
+ &lt;ul&gt;&#xD;
13
+ &lt;li&gt;Data segmentation and analysis&lt;/li&gt;&#xD;
14
+ &lt;li&gt;Campaign development and execution&lt;/li&gt;&#xD;
15
+ &lt;li&gt;In-depth campaign reporting and analysis&lt;/li&gt;&#xD;
16
+ &lt;/ul&gt;&#xD;
17
+ &lt;p&gt;Precision Central enables marketers to optimize email communications with personalized, engaging, and highly targeted messages and deliver relevant, data-driven email campaigns that align with your brand&#x2019;s overall marketing mix. &lt;/p&gt;&#xD;
18
+ &lt;h2&gt;Key Benefits:&lt;/h2&gt;&#xD;
19
+ &lt;p&gt;The Precision Central suite offers these significant benefits and more:&lt;/p&gt;&#xD;
20
+ &lt;ul&gt;&#xD;
21
+ &lt;li&gt;Improve the relevance, and ultimate success of digital marketing campaigns&lt;/li&gt;&#xD;
22
+ &lt;li&gt;Deliver a more relevant and engaging multichannel customer experience&lt;/li&gt;&#xD;
23
+ &lt;li&gt;Achieve a higher return on your email marketing investment&lt;/li&gt;&#xD;
24
+ &lt;li&gt;Transfer the power of database segmentation to key decision makers&lt;/li&gt;&#xD;
25
+ &lt;li&gt;Free marketers to spend more time focused on higher value, strategic initiatives&lt;/li&gt;&#xD;
26
+ &lt;li&gt;Make better, more informed decisions about e-mail marketing campaigns&lt;/li&gt;&#xD;
27
+ &lt;/ul&gt;</description>
28
+ <notes>Initial Release.</notes>
29
+ <authors><author><name>True Action Edialog</name><user>trueaction_ed</user><email>edialog@trueaction.com</email></author></authors>
30
+ <date>2012-07-10</date>
31
+ <time>22:52:46</time>
32
+ <contents><target name="magecommunity"><dir name="TrueAction"><dir name="EDialogMarketing"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Form"><dir name="Renderer"><dir name="Config"><file name="HeadingComment.php" hash="37ef2e6af4d798f76c3a1921f6bdd3fa"/><file name="RegisterButton.php" hash="0899ea54c2aca31f40bcd1b9ec225d96"/></dir></dir></dir></dir></dir><file name="Beacon.php" hash="cca2c3a125226d37b6f71eca0cdfe9bc"/><dir name="Checkout"><dir name="Onepage"><file name="Billing.php" hash="c96ff6c37eb5fcf07580fa7075148537"/></dir></dir><dir name="Customer"><file name="Newsletter.php" hash="0155b3d48a555aef35bb24d70ae5d7e8"/></dir><dir name="Newsletter"><file name="Subscribe.php" hash="deacfdbfdff88cce8201418108eac620"/></dir><file name="Unsubscribe.php" hash="779da3233251254744dc67a921906eac"/></dir><dir name="Helper"><file name="Data.php" hash="200031f697aabd04fafcd422ea50d8c0"/><file name="Xfabric.php" hash="14e6475af764d309f3d9049876b45f0c"/></dir><file name="LICENSE.TXT" hash="90f4fc90c81a1ca036fad0087c9c7dee"/><dir name="Model"><dir name="Container"><file name="Beacon.php" hash="cd75e5a69ad66e187991a29b294749b6"/></dir><file name="Observer.php" hash="d24db0682220410a01d6c4690f62eff6"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Edialogmarketing"><file name="RegisterController.php" hash="d14cef572a90047ca1d408b935dae401"/></dir></dir><file name="SubscriberController.php" hash="145dd8f516171a8b658166de03d85d73"/></dir><dir name="etc"><file name="adminhtml.xml" hash="5bb5e3ff1868972bd55e50155f8b473c"/><file name="cache.xml" hash="9fbc24337b6cc74e680ecff1b6217add"/><file name="config.xml" hash="dc35a46703ca99b4b1728a7db82aa897"/><file name="system.xml" hash="0360e19fcd2b824c27058aea2ba72411"/></dir></dir><dir name="EDialogTransactional"><dir name="Block"><dir name="Adminhtml"><file name="Productiontoggle.php" hash="12c9c702ddefeedf58cbd4416c5730dd"/></dir></dir><dir name="Helper"><file name="Data.php" hash="00a5d939f3eb40a2c41e0c334ee8461a"/></dir><file name="LICENSE.TXT" hash="90f4fc90c81a1ca036fad0087c9c7dee"/><dir name="Model"><dir name="Core"><dir name="Email"><file name="Template.php" hash="e9c95097036b427cefbaafa862216aee"/></dir></dir><dir name="Message"><file name="Accountconfirm.php" hash="38081279cb37ab463ee5d3091be3021a"/><file name="Accountconfirmed.php" hash="357b5a73d63c80376d63c5cbb85ac1eb"/><file name="Accountnew.php" hash="3da1c98126139508f090e55bd27eaf01"/><file name="Creditmemoupdate.php" hash="990ebe33dc4841ef9a9021e8ed658221"/><file name="Giftregistryshare.php" hash="a6eaf3c8c0cd7a25fd423cebfa178f4e"/><file name="Giftregistryupdate.php" hash="2e0cff23bd59e4b137655644ef30070d"/><file name="Invite.php" hash="8eba6cdb3de953932cf3c2b22002d707"/><file name="Invoiceupdate.php" hash="6d94bdcfd21f32f993ba567c610c64ab"/><file name="Newcreditmemo.php" hash="4b8e9b4e7c8ec18f28ab91621c8a7862"/><file name="Newgiftcardadmin.php" hash="e84e96dfa2b3fe9d05af1aec8c76780d"/><file name="Newgiftcardcustomer.php" hash="452bbc6466445fcc55c7d32f914a8c24"/><file name="Newgiftregistry.php" hash="c15a179def284aad786556f665c554ac"/><file name="Newinvoice.php" hash="2b48d823fda052d76c82a67a3a331829"/><file name="Neworder.php" hash="4238cd752646156bfbb1e2d6dbdf4622"/><file name="Newpassword.php" hash="806c6132b06e6047cad21899036e3b3d"/><file name="Newrma.php" hash="a5449d441ef0dcbf9f469f0d994a21ae"/><file name="Newshipment.php" hash="8455645d982c265e47f64223dd0e26d4"/><file name="Orderupdate.php" hash="67afee2ca5202f7a51544241e1979b03"/><file name="Pointsexpiring.php" hash="49192a1311ef93cf128b7008ddd5b342"/><file name="Pointsupdate.php" hash="bb44964678d53e0cc1a62e3c69f336a4"/><file name="Resetpassword.php" hash="95337566bce5da045d3f2a8a9028edf9"/><file name="Rmaauth.php" hash="bc88cf2e18e32201a8ab987c05863e80"/><file name="Rmaupdate.php" hash="320bb6cdbc2e4645135eaae5d44b52c0"/><file name="Sendfriend.php" hash="f8408243af0690341aa257ef13f86a70"/><file name="Shipmentupdate.php" hash="593ffade4e74efd91437f6f8a36a5582"/><file name="Storecredit.php" hash="b5ade25d4d62e7e276c68821414ad944"/><file name="Wishlistshare.php" hash="dd579e49c272bbdbbb87ed336a834929"/></dir><file name="Message.php" hash="3cd2b44124ab62b79cf1a54b7fe1c23b"/><dir name="Mysql4"><dir name="Queue"><file name="Collection.php" hash="d689c6a097f6c37dcc2c12b6ca2cf2a3"/></dir><file name="Queue.php" hash="3dfc2ac1895b5887a224e0965612e6f0"/></dir><file name="Observer.php" hash="005560be78de5293948b561ba7eaa09a"/><file name="Queue.php" hash="7d669543f9baf67c4db40f13058dc1c0"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="EdialogtransactionalController.php" hash="478982407feff46edd570daf63754110"/></dir></dir><dir name="etc"><file name="config.xml" hash="f2f2845cd9825b4795386b1be73dc941"/><file name="system.xml" hash="253375f51b9152d7e9898d9d6e0ba263"/></dir><dir name="sql"><dir name="edialog_transactional_setup"><file name="mysql4-install-0.1.0.php" hash="bc3786b51a2cd7f7b7c497432cf9933b"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="edialogmarketing.xml" hash="8b38ac482b901d9baf9c0f06f117b08f"/></dir><dir name="template"><dir name="edialogmarketing"><file name="beacon.phtml" hash="52af43e4d02544d84136f3b32764d266"/><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="5007f848ade590a06bc5ec3e04a186ed"/></dir></dir><dir name="register"><file name="view.phtml" hash="6333af06ea569f025e8454377f40c7a0"/></dir><dir name="system"><dir name="config"><file name="register_button.phtml" hash="f3787b61040fe2feb95df43f1c155db9"/></dir></dir><file name="unsubscribe.phtml" hash="c8f9be432219e2413ad43ef828883899"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="edialogmarketing.xml" hash="47e1a7c612f8a0f33829975e546e588b"/></dir><dir name="template"><dir name="edialogmarketing"><file name="beacon.phtml" hash="52af43e4d02544d84136f3b32764d266"/><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="5007f848ade590a06bc5ec3e04a186ed"/></dir></dir><file name="unsubscribe.phtml" hash="c8f9be432219e2413ad43ef828883899"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TrueAction_EDialogMarketing.xml" hash="b415daef50a6a8b78e3ffa75698feb91"/><file name="TrueAction_EDialogTransactional.xml" hash="e739726cf42cf9ee9512e5ad0a8fd372"/></dir></target></contents>
33
+ <compatible/>
34
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>xintegrationpack</name><channel>community</channel><min>1.0.0</min><max>1.0.9</max></package></required></dependencies>
35
+ </package>