Version Notes
1.1.22
--------
- New Mandrill implementation
- Async implementation for subscritions and ecommerce360
- New mark for identify if the customers click on subscribe or not
- New implementation for differentiate abandoned cart emails
- New buttons for reset ecommerce360 order (local and remote)
- New customer group management
- Fix for product availability in abandoned cart
- Fix for ecommerce360 currency
- Fix for coupons
Download this release
Release Info
Developer | Magento Core Team |
Extension | Ebizmarts_MageMonkey |
Version | 1.1.22 |
Comparing to | |
See all releases |
Code changes from version 1.1.21 to 1.1.22
- app/code/community/Ebizmarts/AbandonedCart/Block/Adminhtml/Dashboard/Totals.php +3 -4
- app/code/community/Ebizmarts/AbandonedCart/Block/Email/Order/Items.php +7 -0
- app/code/community/Ebizmarts/AbandonedCart/Model/Config.php +16 -3
- app/code/community/Ebizmarts/AbandonedCart/Model/Cron.php +183 -105
- app/code/community/Ebizmarts/AbandonedCart/Model/EventObserver.php +1 -1
- app/code/community/Ebizmarts/AbandonedCart/Model/System/Config/Maxemails.php +13 -0
- app/code/community/Ebizmarts/AbandonedCart/etc/config.xml +50 -7
- app/code/community/Ebizmarts/AbandonedCart/etc/system.xml +202 -41
- app/code/community/Ebizmarts/Autoresponder/Model/EventObserver.php +2 -2
- app/code/community/Ebizmarts/Autoresponder/etc/config.xml +19 -1
- app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/System/Config/Date.php +17 -0
- app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/System/Config/ResetLocalEcommerce.php +49 -0
- app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/System/Config/ResetRemoteEcommerce.php +49 -0
- app/code/community/Ebizmarts/MageMonkey/Block/Lists.php +14 -1
- app/code/community/Ebizmarts/MageMonkey/Helper/Data.php +36 -35
- app/code/community/Ebizmarts/MageMonkey/Model/Asyncorders.php +21 -0
- app/code/community/Ebizmarts/MageMonkey/Model/Asyncsubscribers.php +21 -0
- app/code/community/Ebizmarts/MageMonkey/Model/Cron.php +81 -3
- app/code/community/Ebizmarts/MageMonkey/Model/Ecommerce360.php +44 -19
- app/code/community/Ebizmarts/MageMonkey/Model/MCAPI.php +1 -0
- app/code/community/Ebizmarts/MageMonkey/Model/Mysql4/Asyncorders.php +21 -0
- app/code/community/Ebizmarts/MageMonkey/Model/Mysql4/Asyncorders/Collection.php +22 -0
- app/code/community/Ebizmarts/MageMonkey/Model/Mysql4/Asyncsubscribers.php +21 -0
- app/code/community/Ebizmarts/MageMonkey/Model/Mysql4/Asyncsubscribers/Collection.php +22 -0
- app/code/community/Ebizmarts/MageMonkey/Model/Observer.php +133 -49
- app/code/community/Ebizmarts/MageMonkey/Model/System/Config/Source/Checkoutsubscribe.php +2 -1
- app/code/community/Ebizmarts/MageMonkey/Model/System/Config/Source/CustomerGroup.php +52 -0
- app/code/community/Ebizmarts/MageMonkey/Model/System/Config/Source/OrderProcessLimit.php +26 -0
- app/code/community/Ebizmarts/MageMonkey/controllers/Adminhtml/ConfigController.php +60 -0
- app/code/community/Ebizmarts/MageMonkey/controllers/Adminhtml/EcommerceController.php +71 -0
- app/code/community/Ebizmarts/MageMonkey/etc/adminhtml.xml +24 -0
- app/code/community/Ebizmarts/MageMonkey/etc/config.xml +21 -1
- app/code/community/Ebizmarts/MageMonkey/etc/system.xml +78 -5
- app/code/community/Ebizmarts/MageMonkey/sql/monkey_setup/mysql4-upgrade-1.1.21-1.1.22.php +40 -0
- app/code/community/Ebizmarts/Mandrill/Block/Adminhtml/System/Config/Fieldset/Hint.php +1 -1
- app/code/community/Ebizmarts/Mandrill/Block/Adminhtml/Templates/Templates.php +34 -0
- app/code/community/Ebizmarts/Mandrill/Block/Adminhtml/Templates/Templates/Grid.php +132 -0
- app/code/community/Ebizmarts/Mandrill/Block/Adminhtml/Users/Senders.php +2 -2
- app/code/community/Ebizmarts/Mandrill/Block/Adminhtml/Users/Senders/Grid.php +37 -34
- app/code/community/Ebizmarts/Mandrill/Helper/Data.php +5 -8
- app/code/community/Ebizmarts/Mandrill/Model/Email/Template.php +102 -148
- app/code/community/Ebizmarts/Mandrill/Model/System/Config.php +14 -0
- app/code/community/Ebizmarts/Mandrill/Model/System/Config/Source/Userinfo.php +32 -34
- app/code/community/Ebizmarts/Mandrill/etc/adminhtml.xml +33 -32
- app/code/community/Ebizmarts/Mandrill/etc/config.xml +32 -35
- app/code/community/Ebizmarts/Mandrill/etc/system.xml +13 -12
- app/design/adminhtml/default/default/layout/ebizmarts/mandrill.xml +18 -0
- app/design/adminhtml/default/default/layout/mandrill.xml +0 -18
- app/design/adminhtml/default/default/template/ebizmarts/abandonedcart/dashboard/totalbar.phtml +1 -1
- app/design/adminhtml/default/default/template/ebizmarts/abandonedcart/system/config/fieldset/hint.phtml +1 -1
- app/design/adminhtml/default/default/template/ebizmarts/autoresponder/system/config/fieldset/hint.phtml +1 -1
- app/design/adminhtml/default/default/template/{mandrill → ebizmarts/mandrill}/system/config/fieldset/hint.phtml +0 -0
- app/design/adminhtml/default/default/template/magemonkey/system/config/resetlocal360.phtml +62 -0
- app/design/adminhtml/default/default/template/magemonkey/system/config/resetremote360.phtml +20 -0
- app/design/adminhtml/default/default/template/mandrill/.DS_Store +0 -0
- app/design/adminhtml/default/default/template/mandrill/system/.DS_Store +0 -0
- app/design/adminhtml/default/default/template/mandrill/system/config/.DS_Store +0 -0
- app/design/frontend/base/default/layout/ebizmarts/autoresponder.xml +1 -1
- app/design/frontend/base/default/template/ebizmarts_abandonedcart/email/order/items.phtml +5 -2
- app/design/frontend/base/default/template/magemonkey/checkout/subscribe.phtml +188 -155
- app/design/frontend/base/default/template/magemonkey/lists.phtml +2 -1
- app/locale/en_US/Ebizmarts_Autoresponder.csv +0 -0
- app/locale/en_US/template/email/ebizmarts/abandonedcart/abandoned_cart_mail_1.html +43 -0
- app/locale/en_US/template/email/ebizmarts/abandonedcart/abandoned_cart_mail_2.html +44 -0
- app/locale/en_US/template/email/{sales/abandoned_cart.html → ebizmarts/abandonedcart/abandoned_cart_mail_3.html} +3 -3
- app/locale/en_US/template/email/ebizmarts/abandonedcart/abandoned_cart_mail_generic.html +41 -0
- app/locale/en_US/template/email/ebizmarts/autoresponder/backtostock.html +1 -1
- app/locale/en_US/template/email/ebizmarts/autoresponder/birthday.html +1 -1
- app/locale/en_US/template/email/ebizmarts/autoresponder/neworder.html +1 -1
- app/locale/en_US/template/email/ebizmarts/autoresponder/noactivity.html +1 -1
- app/locale/en_US/template/email/ebizmarts/autoresponder/relatedproducts.html +1 -1
- app/locale/en_US/template/email/ebizmarts/autoresponder/review.html +1 -1
- app/locale/en_US/template/email/ebizmarts/autoresponder/reviewcoupon.html +1 -1
- app/locale/en_US/template/email/ebizmarts/autoresponder/visitedproducts.html +1 -1
- app/locale/en_US/template/email/ebizmarts/autoresponder/wishlist.html +1 -1
- lib/Mandrill/API.php +0 -382
- lib/Mandrill/Mandrill.php +161 -0
- lib/Mandrill/Mandrill/Exceptions.php +151 -0
- lib/Mandrill/Mandrill/Exports.php +112 -0
- lib/Mandrill/Mandrill/Inbound.php +138 -0
- lib/Mandrill/Mandrill/Internal.php +10 -0
- lib/Mandrill/Mandrill/Ips.php +279 -0
- lib/Mandrill/Mandrill/Messages.php +408 -0
- lib/Mandrill/Mandrill/Metadata.php +64 -0
- lib/Mandrill/Mandrill/Rejects.php +80 -0
- lib/Mandrill/Mandrill/Senders.php +218 -0
- lib/Mandrill/Mandrill/Subaccounts.php +171 -0
- lib/Mandrill/Mandrill/Tags.php +174 -0
- lib/Mandrill/Mandrill/Templates.php +235 -0
- lib/Mandrill/Mandrill/Urls.php +108 -0
- lib/Mandrill/Mandrill/Users.php +132 -0
- lib/Mandrill/Mandrill/Webhooks.php +122 -0
- lib/Mandrill/Mandrill/Whitelists.php +52 -0
- lib/Mandrill/Message.php +191 -0
- package.xml +17 -20
- skin/adminhtml/default/default/{mandrill → ebizmarts/mandrill}/mandrill-tab.png +0 -0
- skin/adminhtml/default/default/{mandrill → ebizmarts/mandrill}/mandrill.css +0 -0
app/code/community/Ebizmarts/AbandonedCart/Block/Adminhtml/Dashboard/Totals.php
CHANGED
@@ -94,7 +94,7 @@ class Ebizmarts_AbandonedCart_Block_Adminhtml_Dashboard_Totals extends Mage_Admi
|
|
94 |
// get Mandrill statistics
|
95 |
if(Mage::helper('core')->isModuleEnabled('Ebizmarts_Mandrill')
|
96 |
&& (version_compare(Mage::getConfig()->getNode()->modules->Ebizmarts_Mandrill->version, '1.0.4', '>'))
|
97 |
-
&& Mage::helper('
|
98 |
if(!$isFilter) {
|
99 |
$stores = Mage::app()->getStores();
|
100 |
$__particular = array('sent' => 0, 'soft_bounces' => 0,'hard_bounces'=>0,'unique_opens'=>0,'unique_clicks'=>0);
|
@@ -163,10 +163,9 @@ class Ebizmarts_AbandonedCart_Block_Adminhtml_Dashboard_Totals extends Mage_Admi
|
|
163 |
*/
|
164 |
private function __getMandrillStatistics($period,$store)
|
165 |
{
|
166 |
-
$
|
167 |
-
$mandrill->setApiKey(Mage::helper('mandrill')->getApiKey($store));
|
168 |
$mandrillTag = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::MANDRILL_TAG, $store)."_$store";
|
169 |
-
$tags = $
|
170 |
if(!$tags) {
|
171 |
return false;
|
172 |
}
|
94 |
// get Mandrill statistics
|
95 |
if(Mage::helper('core')->isModuleEnabled('Ebizmarts_Mandrill')
|
96 |
&& (version_compare(Mage::getConfig()->getNode()->modules->Ebizmarts_Mandrill->version, '1.0.4', '>'))
|
97 |
+
&& Mage::helper('ebizmarts_mandrill')->useTransactionalService()) {
|
98 |
if(!$isFilter) {
|
99 |
$stores = Mage::app()->getStores();
|
100 |
$__particular = array('sent' => 0, 'soft_bounces' => 0,'hard_bounces'=>0,'unique_opens'=>0,'unique_clicks'=>0);
|
163 |
*/
|
164 |
private function __getMandrillStatistics($period,$store)
|
165 |
{
|
166 |
+
$api = new Mandrill_Message(Mage::getStoreConfig(Ebizmarts_Mandrill_Model_System_Config::APIKEY,$store));
|
|
|
167 |
$mandrillTag = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::MANDRILL_TAG, $store)."_$store";
|
168 |
+
$tags = $api->tags->info($mandrillTag);
|
169 |
if(!$tags) {
|
170 |
return false;
|
171 |
}
|
app/code/community/Ebizmarts/AbandonedCart/Block/Email/Order/Items.php
CHANGED
@@ -27,4 +27,11 @@ class Ebizmarts_AbandonedCart_Block_Email_Order_Items extends Mage_Sales_Block_I
|
|
27 |
return $subtotal;
|
28 |
}
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
27 |
return $subtotal;
|
28 |
}
|
29 |
|
30 |
+
public function getImage($_item)
|
31 |
+
{
|
32 |
+
$product = Mage::getModel('catalog/product')
|
33 |
+
->load($_item->getProductId());
|
34 |
+
return Mage::helper('catalog/image')->init($product, 'image')->resize(115);
|
35 |
+
}
|
36 |
+
|
37 |
}
|
app/code/community/Ebizmarts/AbandonedCart/Model/Config.php
CHANGED
@@ -11,13 +11,22 @@
|
|
11 |
class Ebizmarts_AbandonedCart_Model_Config
|
12 |
{
|
13 |
const ACTIVE = "ebizmarts_abandonedcart/general/active";
|
14 |
-
const
|
|
|
|
|
|
|
|
|
15 |
const MANDRILL_TAG = 'ebizmarts_abandonedcart/general/mandrill-tag';
|
16 |
const EMAIL_TEMPLATE_XML_PATH_W_COUPON = 'ebizmarts_abandonedcart/general/coupon_template';
|
17 |
-
const
|
|
|
|
|
|
|
|
|
18 |
const UNIT = "ebizmarts_abandonedcart/general/unit";
|
19 |
const SENDER = "ebizmarts_abandonedcart/general/identity";
|
20 |
const MAXTIMES = "ebizmarts_abandonedcart/general/max";
|
|
|
21 |
const COUPON_DAYS = "ebizmarts_abandonedcart/coupon/sendon";
|
22 |
const SEND_COUPON = "ebizmarts_abandonedcart/coupon/create";
|
23 |
const FIRST_DATE = "ebizmarts_abandonedcart/general/firstdate";
|
@@ -29,7 +38,11 @@ class Ebizmarts_AbandonedCart_Model_Config
|
|
29 |
const COUPON_LENGTH = "ebizmarts_abandonedcart/coupon/length";
|
30 |
const COUPON_LABEL = "ebizmarts_abandonedcart/coupon/couponlabel";
|
31 |
const CUSTOMER_GROUPS = "ebizmarts_abandonedcart/general/customer";
|
32 |
-
const
|
|
|
|
|
|
|
|
|
33 |
const LOG = "ebizmarts_abandonedcart/general/log";
|
34 |
const AUTOLOGIN = "ebizmarts_abandonedcart/general/autologin";
|
35 |
const ABANDONED_TAGS = 'global/ebizmarts_abandonedcart/mandrill-tag';
|
11 |
class Ebizmarts_AbandonedCart_Model_Config
|
12 |
{
|
13 |
const ACTIVE = "ebizmarts_abandonedcart/general/active";
|
14 |
+
const FIRST_EMAIL_TEMPLATE_XML_PATH = 'ebizmarts_abandonedcart/general/template1';
|
15 |
+
const SECOND_EMAIL_TEMPLATE_XML_PATH = 'ebizmarts_abandonedcart/general/template2';
|
16 |
+
const THIRD_EMAIL_TEMPLATE_XML_PATH = 'ebizmarts_abandonedcart/general/template3';
|
17 |
+
const FOURTH_EMAIL_TEMPLATE_XML_PATH = 'ebizmarts_abandonedcart/general/template4';
|
18 |
+
const FIFTH_EMAIL_TEMPLATE_XML_PATH = 'ebizmarts_abandonedcart/general/template5';
|
19 |
const MANDRILL_TAG = 'ebizmarts_abandonedcart/general/mandrill-tag';
|
20 |
const EMAIL_TEMPLATE_XML_PATH_W_COUPON = 'ebizmarts_abandonedcart/general/coupon_template';
|
21 |
+
const DAYS_1 = "ebizmarts_abandonedcart/general/days1";
|
22 |
+
const DAYS_2 = "ebizmarts_abandonedcart/general/days2";
|
23 |
+
const DAYS_3 = "ebizmarts_abandonedcart/general/days3";
|
24 |
+
const DAYS_4 = "ebizmarts_abandonedcart/general/days4";
|
25 |
+
const DAYS_5 = "ebizmarts_abandonedcart/general/days5";
|
26 |
const UNIT = "ebizmarts_abandonedcart/general/unit";
|
27 |
const SENDER = "ebizmarts_abandonedcart/general/identity";
|
28 |
const MAXTIMES = "ebizmarts_abandonedcart/general/max";
|
29 |
+
const MAXTIMES_NUM = 5;
|
30 |
const COUPON_DAYS = "ebizmarts_abandonedcart/coupon/sendon";
|
31 |
const SEND_COUPON = "ebizmarts_abandonedcart/coupon/create";
|
32 |
const FIRST_DATE = "ebizmarts_abandonedcart/general/firstdate";
|
38 |
const COUPON_LENGTH = "ebizmarts_abandonedcart/coupon/length";
|
39 |
const COUPON_LABEL = "ebizmarts_abandonedcart/coupon/couponlabel";
|
40 |
const CUSTOMER_GROUPS = "ebizmarts_abandonedcart/general/customer";
|
41 |
+
const FIRST_SUBJECT = "ebizmarts_abandonedcart/general/subject1";
|
42 |
+
const SECOND_SUBJECT = "ebizmarts_abandonedcart/general/subject2";
|
43 |
+
const THIRD_SUBJECT = "ebizmarts_abandonedcart/general/subject3";
|
44 |
+
const FOURTH_SUBJECT = "ebizmarts_abandonedcart/general/subject4";
|
45 |
+
const FIFTH_SUBJECT = "ebizmarts_abandonedcart/general/subject5";
|
46 |
const LOG = "ebizmarts_abandonedcart/general/log";
|
47 |
const AUTOLOGIN = "ebizmarts_abandonedcart/general/autologin";
|
48 |
const ABANDONED_TAGS = 'global/ebizmarts_abandonedcart/mandrill-tag';
|
app/code/community/Ebizmarts/AbandonedCart/Model/Cron.php
CHANGED
@@ -38,24 +38,43 @@ class Ebizmarts_AbandonedCart_Model_Cron
|
|
38 |
Mage::getSingleton('core/design_package' )->setStore($store);
|
39 |
|
40 |
$adapter = Mage::getSingleton('core/resource')->getConnection('sales_read');
|
41 |
-
$days =
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
$sendcoupondays = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_DAYS, $store);
|
44 |
$sendcoupon = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::SEND_COUPON, $store);
|
45 |
$firstdate = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::FIRST_DATE, $store);
|
46 |
$unit = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::UNIT, $store);
|
47 |
$customergroups = explode(",",Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::CUSTOMER_GROUPS, $store));
|
48 |
-
$mailsubject = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::SUBJECT, $store);
|
49 |
$mandrillTag = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::MANDRILL_TAG, $store)."_$store";
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
$from = new Zend_Db_Expr($expr);
|
57 |
|
58 |
-
// get
|
59 |
$collection = Mage::getResourceModel('reports/quote_collection');
|
60 |
$collection->addFieldToFilter('items_count', array('neq' => '0'))
|
61 |
->addFieldToFilter('main_table.is_active', '1')
|
@@ -65,120 +84,121 @@ class Ebizmarts_AbandonedCart_Model_Cron
|
|
65 |
|
66 |
$collection->addFieldToFilter('main_table.converted_at', array(array('null'=>true),$this->_getSuggestedZeroDate()))
|
67 |
->addFieldToFilter('main_table.updated_at', array('to' => $from,'from' => $firstdate))
|
68 |
-
->addFieldToFilter('main_table.ebizmarts_abandonedcart_counter',array('
|
69 |
|
70 |
$collection->addFieldToFilter('main_table.customer_email', array('neq' => ''));
|
71 |
if(count($customergroups)) {
|
72 |
$collection->addFieldToFilter('main_table.customer_group_id', array('in', $customergroups));
|
73 |
}
|
74 |
-
|
75 |
-
|
76 |
-
$expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($days, 'HOUR'));
|
77 |
-
$from = new Zend_Db_Expr($expr);
|
78 |
|
79 |
-
//
|
80 |
-
$
|
81 |
-
|
82 |
-
->
|
83 |
-
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
|
|
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
|
92 |
-
|
93 |
-
if(count($customergroups)) {
|
94 |
-
$collection1->addFieldToFilter('main_table.customer_group_id', array('in', $customergroups));
|
95 |
-
}
|
96 |
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
->addFieldToFilter('main_table.is_active', '1')
|
103 |
-
->addFieldToFilter('main_table.store_id',array('eq'=>$store))
|
104 |
-
->addSubtotal($store)
|
105 |
-
->setOrder('updated_at');
|
106 |
|
107 |
-
|
108 |
-
|
109 |
-
|
|
|
|
|
|
|
|
|
110 |
|
111 |
-
|
112 |
-
|
113 |
-
$collection2->addFieldToFilter('main_table.customer_group_id', array('in', $customergroups));
|
114 |
-
}
|
115 |
-
Mage::helper('ebizmarts_abandonedcart')->log((string)$collection1->getSelect());
|
116 |
-
Mage::helper('ebizmarts_abandonedcart')->log((string)$collection2->getSelect());
|
117 |
-
$collection = $collection1;
|
118 |
-
foreach($collection2 as $quote) {
|
119 |
-
$collection->addItem($quote);
|
120 |
-
}
|
121 |
-
}
|
122 |
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
|
|
|
|
140 |
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
$name = $quote->getCustomerFirstname().' '.$quote->getCustomerLastname();
|
150 |
-
$quote2 = Mage::getModel('sales/quote')->loadByIdWithoutStore($quote->getId());
|
151 |
-
$unsubscribeUrl = Mage::getModel('core/url')->setStore($store)->getUrl().'ebizautoresponder/autoresponder/unsubscribe?list=abandonedcart&email='.$email.'&store='.$store;
|
152 |
-
$couponcode = '';
|
153 |
-
if($sendcoupon && $quote2->getEbizmartsAbandonedcartCounter() + 1 == $sendcoupondays)
|
154 |
-
{
|
155 |
-
$templateId = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::EMAIL_TEMPLATE_XML_PATH);
|
156 |
-
// create a new coupon
|
157 |
-
if(Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_AUTOMATIC)==2) {
|
158 |
-
list($couponcode,$discount,$toDate) = $this->_createNewCoupon($store,$email);
|
159 |
-
$vars = array('quote'=>$quote,'url'=>$url, 'couponcode'=>$couponcode,'discount' => $discount,
|
160 |
-
'todate' => $toDate, 'name' => $name,'tags'=>array($mandrillTag),'unsubscribeurl'=>$unsubscribeUrl);
|
161 |
}
|
162 |
-
else {
|
163 |
-
$couponcode = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_CODE);
|
164 |
-
$vars = array('quote'=>$quote,'url'=>$url, 'couponcode'=>$couponcode, 'name' => $name,'tags'=>array($mandrillTag),'unsubscribeurl'=>$unsubscribeUrl);
|
165 |
-
}
|
166 |
-
}
|
167 |
-
else {
|
168 |
-
$templateId = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::EMAIL_TEMPLATE_XML_PATH);
|
169 |
-
$vars = array('quote'=>$quote,'url'=>$url,'unsubscribeurl'=>$unsubscribeUrl,'tags'=>array($mandrillTag));
|
170 |
-
|
171 |
}
|
172 |
-
$translate = Mage::getSingleton('core/translate');
|
173 |
-
$mail = Mage::getModel('core/email_template')->setTemplateSubject($mailsubject)->sendTransactional($templateId,$sender,$email,$name,$vars,$store);
|
174 |
-
$translate->setTranslateInLine(true);
|
175 |
-
$quote2->setEbizmartsAbandonedcartCounter($quote2->getEbizmartsAbandonedcartCounter()+1);
|
176 |
-
$quote2->setEbizmartsAbandonedcartToken($token);
|
177 |
-
$quote2->save();
|
178 |
-
Mage::helper('ebizmarts_abandonedcart')->saveMail('abandoned cart',$email,$name,$couponcode,$store);
|
179 |
}
|
180 |
}
|
181 |
-
|
182 |
}
|
183 |
|
184 |
/**
|
@@ -214,6 +234,7 @@ class Ebizmarts_AbandonedCart_Model_Cron
|
|
214 |
$coupon_rule = Mage::getModel('salesrule/rule');
|
215 |
$coupon_rule->setName("Abandoned coupon $email")
|
216 |
->setDescription("Abandoned coupon $email")
|
|
|
217 |
->setFromDate($fromDate)
|
218 |
->setToDate($toDate)
|
219 |
->setIsActive(1)
|
@@ -265,4 +286,61 @@ class Ebizmarts_AbandonedCart_Model_Cron
|
|
265 |
->addFieldtoFilter('main_table.store_id',array('eq'=>$storeId));
|
266 |
return $collection->getSize() == 0;
|
267 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
}
|
38 |
Mage::getSingleton('core/design_package' )->setStore($store);
|
39 |
|
40 |
$adapter = Mage::getSingleton('core/resource')->getConnection('sales_read');
|
41 |
+
$days = array(
|
42 |
+
0 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_1, $store),
|
43 |
+
1 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_2, $store),
|
44 |
+
2 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_3, $store),
|
45 |
+
3 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_4, $store),
|
46 |
+
4 => Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::DAYS_5, $store)
|
47 |
+
);
|
48 |
+
$maxtimes = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::MAXTIMES, $store)+1;
|
49 |
$sendcoupondays = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_DAYS, $store);
|
50 |
$sendcoupon = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::SEND_COUPON, $store);
|
51 |
$firstdate = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::FIRST_DATE, $store);
|
52 |
$unit = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::UNIT, $store);
|
53 |
$customergroups = explode(",",Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::CUSTOMER_GROUPS, $store));
|
|
|
54 |
$mandrillTag = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::MANDRILL_TAG, $store)."_$store";
|
55 |
|
56 |
+
// iterates one time for each mail number
|
57 |
+
for($run=0;$run<$maxtimes;$run++){
|
58 |
+
if(!$days[$run]){
|
59 |
+
return;
|
60 |
+
}
|
61 |
+
|
62 |
+
// subtract days from latest run to get difference from the actual abandon date of the cart
|
63 |
+
$diff = $days[$run];
|
64 |
+
if($run == 1 && $unit == Ebizmarts_AbandonedCart_Model_Config::IN_HOURS){
|
65 |
+
$diff -= $days[0]/24;
|
66 |
+
}elseif($run != 0){
|
67 |
+
$diff -= $days[$run-1];
|
68 |
+
}
|
69 |
+
|
70 |
+
// set the top date of the carts to get
|
71 |
+
$expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($diff, 'DAY'));
|
72 |
+
if($run == 0 && $unit == Ebizmarts_AbandonedCart_Model_Config::IN_HOURS) {
|
73 |
+
$expr = sprintf('DATE_SUB(%s, %s)', $adapter->quote(now()), $this->_getIntervalUnitSql($diff, 'HOUR'));
|
74 |
+
}
|
75 |
$from = new Zend_Db_Expr($expr);
|
76 |
|
77 |
+
// get collection of abandoned carts with cart_counter == $run
|
78 |
$collection = Mage::getResourceModel('reports/quote_collection');
|
79 |
$collection->addFieldToFilter('items_count', array('neq' => '0'))
|
80 |
->addFieldToFilter('main_table.is_active', '1')
|
84 |
|
85 |
$collection->addFieldToFilter('main_table.converted_at', array(array('null'=>true),$this->_getSuggestedZeroDate()))
|
86 |
->addFieldToFilter('main_table.updated_at', array('to' => $from,'from' => $firstdate))
|
87 |
+
->addFieldToFilter('main_table.ebizmarts_abandonedcart_counter', array('eq' => $run));
|
88 |
|
89 |
$collection->addFieldToFilter('main_table.customer_email', array('neq' => ''));
|
90 |
if(count($customergroups)) {
|
91 |
$collection->addFieldToFilter('main_table.customer_group_id', array('in', $customergroups));
|
92 |
}
|
93 |
+
//is this necessary?
|
94 |
+
// Mage::helper('ebizmarts_abandonedcart')->log((string)$collection->getSelect());
|
|
|
|
|
95 |
|
96 |
+
// for each cart of the current run
|
97 |
+
foreach($collection as $quote)
|
98 |
+
{
|
99 |
+
foreach($quote->getAllVisibleItems() as $item) {
|
100 |
+
$removeFromQuote = false;
|
101 |
+
$product = Mage::getModel('catalog/product')->load($item->getProductId());
|
102 |
+
if(!$product || $product->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED)
|
103 |
+
{
|
104 |
+
Mage::log('AbandonedCart; ' . $product->getSku() .' is no longer present or enabled; remove from quote ' . $quote->getId() . ' for email',null,'Ebizmarts_AbandonedCart.log');
|
105 |
+
$removeFromQuote = true;
|
106 |
+
}
|
107 |
+
$stock = $product->getStockItem();
|
108 |
+
if(
|
109 |
+
(
|
110 |
+
$stock->getManageStock() ||
|
111 |
+
($stock->getUseConfigManageStock() && Mage::getStoreConfig('cataloginventory/item_options/manage_stock', $quote->getStoreId()))
|
112 |
+
)
|
113 |
+
&& $stock->getQty() < $item->getQty())
|
114 |
+
{
|
115 |
+
Mage::log('AbandonedCart; ' . $product->getSku() .' is no longer in stock; remove from quote ' . $quote->getId() . ' for email',null,'Ebizmarts_AbandonedCart.log');
|
116 |
+
$removeFromQuote = true;
|
117 |
+
}
|
118 |
+
if($removeFromQuote)
|
119 |
+
{
|
120 |
+
$quote->removeItem($item->getId());
|
121 |
+
}
|
122 |
+
}
|
123 |
+
if(count($quote->getAllVisibleItems()) < 1)
|
124 |
+
{
|
125 |
+
$quote2 = Mage::getModel('sales/quote')->loadByIdWithoutStore($quote->getId());
|
126 |
+
$quote2->setEbizmartsAbandonedcartCounter($quote2->getEbizmartsAbandonedcartCounter()+1);
|
127 |
+
$quote2->save();
|
128 |
+
continue;
|
129 |
+
}
|
130 |
+
// check if they are any order from the customer with date >=
|
131 |
+
$collection2 = Mage::getResourceModel('reports/quote_collection');
|
132 |
+
$collection2->addFieldToFilter('main_table.is_active', '0')
|
133 |
+
->addFieldToFilter('main_table.reserved_order_id',array('neq' => 'NULL' ))
|
134 |
+
->addFieldToFilter('main_table.customer_email',array('eq' => $quote->getCustomerEmail()))
|
135 |
+
->addFieldToFilter('main_table.updated_at',array('from'=>$quote->getUpdatedAt()));
|
136 |
+
if($collection2->getSize()) {
|
137 |
+
continue;
|
138 |
+
}
|
139 |
+
//
|
140 |
+
//$url = Mage::getBaseUrl('web').'ebizmarts_abandonedcart/abandoned/loadquote?id='.$quote->getEntityId();
|
141 |
+
//srand((double)microtime()*1000000);
|
142 |
+
$token = md5(rand(0,9999999));
|
143 |
+
$url = Mage::getModel('core/url')->setStore($store)->getUrl('',array('_nosid'=>true)).'ebizmarts_abandonedcart/abandoned/loadquote?id='.$quote->getEntityId().'&token='.$token;
|
144 |
|
145 |
+
$data = array('AbandonedURL'=>$url, 'AbandonedDate' => $quote->getUpdatedAt());
|
146 |
|
147 |
+
// send email
|
148 |
+
$senderid = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::SENDER, $store);
|
149 |
+
$sender = array('name'=>Mage::getStoreConfig("trans_email/ident_$senderid/name",$store), 'email'=> Mage::getStoreConfig("trans_email/ident_$senderid/email",$store));
|
150 |
|
151 |
+
$email = $quote->getCustomerEmail();
|
|
|
|
|
|
|
152 |
|
153 |
+
if($this->_isSubscribed($email,'abandonedcart',$store)) {
|
154 |
+
$name = $quote->getCustomerFirstname().' '.$quote->getCustomerLastname();
|
155 |
+
$quote2 = Mage::getModel('sales/quote')->loadByIdWithoutStore($quote->getId());
|
156 |
+
$unsubscribeUrl = Mage::getModel('core/url')->setStore($store)->getUrl().'ebizautoresponder/autoresponder/unsubscribe?list=abandonedcart&email='.$email.'&store='.$store;
|
157 |
+
$couponcode = '';
|
|
|
|
|
|
|
|
|
158 |
|
159 |
+
//if hour is set for first run calculates hours since cart was created else calculates days
|
160 |
+
$today = idate('U', strtotime(now()));
|
161 |
+
$updatedAt = idate('U', strtotime($quote2->getUpdatedAt()));
|
162 |
+
$updatedAtDiff = ($today-$updatedAt)/60/60/24;
|
163 |
+
if($unit == Ebizmarts_AbandonedCart_Model_Config::IN_HOURS && $run == 0){
|
164 |
+
$updatedAtDiff = ($today-$updatedAt)/60/60;
|
165 |
+
}
|
166 |
|
167 |
+
// if days have passed proceed to send mail
|
168 |
+
if($updatedAtDiff >= $diff){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
|
170 |
+
$mailsubject = $this->_getMailSubject($run, $store);
|
171 |
+
$templateId = $this->_getTemplateId($run);
|
172 |
+
if($sendcoupon && $run+1 == $sendcoupondays)
|
173 |
+
{
|
174 |
+
//$templateId = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::EMAIL_TEMPLATE_XML_PATH);
|
175 |
+
// create a new coupon
|
176 |
+
if(Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_AUTOMATIC)==2) {
|
177 |
+
list($couponcode,$discount,$toDate) = $this->_createNewCoupon($store,$email);
|
178 |
+
$vars = array('quote'=>$quote,'url'=>$url, 'couponcode'=>$couponcode,'discount' => $discount,
|
179 |
+
'todate' => $toDate, 'name' => $name,'tags'=>array($mandrillTag),'unsubscribeurl'=>$unsubscribeUrl);
|
180 |
+
}
|
181 |
+
else {
|
182 |
+
$couponcode = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::COUPON_CODE);
|
183 |
+
$vars = array('quote'=>$quote,'url'=>$url, 'couponcode'=>$couponcode, 'name' => $name,'tags'=>array($mandrillTag),'unsubscribeurl'=>$unsubscribeUrl);
|
184 |
+
}
|
185 |
+
}
|
186 |
+
else {
|
187 |
+
//$templateId = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::EMAIL_TEMPLATE_XML_PATH);
|
188 |
+
$vars = array('quote'=>$quote,'url'=>$url,'unsubscribeurl'=>$unsubscribeUrl,'tags'=>array($mandrillTag));
|
189 |
|
190 |
+
}
|
191 |
+
$translate = Mage::getSingleton('core/translate');
|
192 |
+
$mail = Mage::getModel('core/email_template')->setTemplateSubject($mailsubject)->sendTransactional($templateId,$sender,$email,$name,$vars,$store);
|
193 |
+
$translate->setTranslateInLine(true);
|
194 |
+
$quote2->setEbizmartsAbandonedcartCounter($quote2->getEbizmartsAbandonedcartCounter()+1);
|
195 |
+
$quote2->setEbizmartsAbandonedcartToken($token);
|
196 |
+
$quote2->save();
|
197 |
+
Mage::helper('ebizmarts_abandonedcart')->saveMail('abandoned cart',$email,$name,$couponcode,$store);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
}
|
201 |
}
|
|
|
202 |
}
|
203 |
|
204 |
/**
|
234 |
$coupon_rule = Mage::getModel('salesrule/rule');
|
235 |
$coupon_rule->setName("Abandoned coupon $email")
|
236 |
->setDescription("Abandoned coupon $email")
|
237 |
+
->setStopRulesProcessing(0)
|
238 |
->setFromDate($fromDate)
|
239 |
->setToDate($toDate)
|
240 |
->setIsActive(1)
|
286 |
->addFieldtoFilter('main_table.store_id',array('eq'=>$storeId));
|
287 |
return $collection->getSize() == 0;
|
288 |
}
|
289 |
+
|
290 |
+
/**
|
291 |
+
* @param $currentCount
|
292 |
+
* @param $store
|
293 |
+
* @return mixed|null
|
294 |
+
*/
|
295 |
+
protected function _getMailSubject($currentCount, $store){
|
296 |
+
|
297 |
+
$ret = NULL;
|
298 |
+
switch($currentCount){
|
299 |
+
case 0:
|
300 |
+
$ret = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::FIRST_SUBJECT, $store);
|
301 |
+
break;
|
302 |
+
case 1:
|
303 |
+
$ret = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::SECOND_SUBJECT, $store);
|
304 |
+
break;
|
305 |
+
case 2:
|
306 |
+
$ret = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::THIRD_SUBJECT, $store);
|
307 |
+
break;
|
308 |
+
case 3:
|
309 |
+
$ret = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::FOURTH_SUBJECT, $store);
|
310 |
+
break;
|
311 |
+
case 4:
|
312 |
+
$ret = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::FIFTH_SUBJECT, $store);
|
313 |
+
break;
|
314 |
+
}
|
315 |
+
return $ret;
|
316 |
+
|
317 |
+
}
|
318 |
+
|
319 |
+
/**
|
320 |
+
* @param $currentCount
|
321 |
+
* @return mixed
|
322 |
+
*/
|
323 |
+
protected function _getTemplateId($currentCount){
|
324 |
+
|
325 |
+
$ret = NULL;
|
326 |
+
switch($currentCount){
|
327 |
+
case 0:
|
328 |
+
$ret = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::FIRST_EMAIL_TEMPLATE_XML_PATH);
|
329 |
+
break;
|
330 |
+
case 1:
|
331 |
+
$ret = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::SECOND_EMAIL_TEMPLATE_XML_PATH);
|
332 |
+
break;
|
333 |
+
case 2:
|
334 |
+
$ret = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::THIRD_EMAIL_TEMPLATE_XML_PATH);
|
335 |
+
break;
|
336 |
+
case 3:
|
337 |
+
$ret = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::FOURTH_EMAIL_TEMPLATE_XML_PATH);
|
338 |
+
break;
|
339 |
+
case 4:
|
340 |
+
$ret = Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::FIFTH_EMAIL_TEMPLATE_XML_PATH);
|
341 |
+
break;
|
342 |
+
}
|
343 |
+
return $ret;
|
344 |
+
|
345 |
+
}
|
346 |
}
|
app/code/community/Ebizmarts/AbandonedCart/Model/EventObserver.php
CHANGED
@@ -23,7 +23,7 @@ class Ebizmarts_AbandonedCart_Model_EventObserver
|
|
23 |
}
|
24 |
|
25 |
$store = is_null($o->getEvent()->getStore()) ? Mage::app()->getDefaultStoreView()->getCode(): $o->getEvent()->getStore();
|
26 |
-
if(!Mage::helper('
|
27 |
$config = new Mage_Core_Model_Config();
|
28 |
$config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ACTIVE,false,$scope,$store);
|
29 |
Mage::getConfig()->cleanCache();
|
23 |
}
|
24 |
|
25 |
$store = is_null($o->getEvent()->getStore()) ? Mage::app()->getDefaultStoreView()->getCode(): $o->getEvent()->getStore();
|
26 |
+
if(!Mage::helper('ebizmarts_mandrill')->useTransactionalService()) {
|
27 |
$config = new Mage_Core_Model_Config();
|
28 |
$config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ACTIVE,false,$scope,$store);
|
29 |
Mage::getConfig()->cleanCache();
|
app/code/community/Ebizmarts/AbandonedCart/Model/System/Config/Maxemails.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Ebizmarts_AbandonedCart_Model_System_Config_Maxemails
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
$options = array();
|
8 |
+
for($i = 0; $i < Ebizmarts_AbandonedCart_Model_Config::MAXTIMES_NUM; $i++){
|
9 |
+
$options[]=array('value'=> $i, 'label' => $i+1);
|
10 |
+
}
|
11 |
+
return $options;
|
12 |
+
}
|
13 |
+
}
|
app/code/community/Ebizmarts/AbandonedCart/etc/config.xml
CHANGED
@@ -10,17 +10,53 @@
|
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Ebizmarts_AbandonedCart>
|
13 |
-
<version>0.1.
|
14 |
</Ebizmarts_AbandonedCart>
|
15 |
</modules>
|
16 |
<global>
|
17 |
<template>
|
18 |
<email>
|
19 |
-
<
|
20 |
-
<label>Abandoned Cart Mail</label>
|
21 |
-
<file>
|
22 |
<type>html</type>
|
23 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
</email>
|
25 |
</template>
|
26 |
<ebizmarts_abandonedcart>
|
@@ -144,11 +180,18 @@
|
|
144 |
<default>
|
145 |
<ebizmarts_abandonedcart>
|
146 |
<general>
|
147 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
<mandrill-tag>AbandonedCart</mandrill-tag>
|
149 |
<autologin>0</autologin>
|
150 |
<page>checkout/cart</page>
|
151 |
-
<incremental>0</incremental>
|
152 |
</general>
|
153 |
</ebizmarts_abandonedcart>
|
154 |
</default>
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Ebizmarts_AbandonedCart>
|
13 |
+
<version>0.1.27</version>
|
14 |
</Ebizmarts_AbandonedCart>
|
15 |
</modules>
|
16 |
<global>
|
17 |
<template>
|
18 |
<email>
|
19 |
+
<ebizmarts_abandonedcart_general_template1 translate="label" module="ebizmarts_abandonedcart">
|
20 |
+
<label>First Abandoned Cart Mail</label>
|
21 |
+
<file>ebizmarts/abandonedcart/abandoned_cart_mail_1.html</file>
|
22 |
<type>html</type>
|
23 |
+
</ebizmarts_abandonedcart_general_template1>
|
24 |
+
</email>
|
25 |
+
</template>
|
26 |
+
<template>
|
27 |
+
<email>
|
28 |
+
<ebizmarts_abandonedcart_general_template2 translate="label" module="ebizmarts_abandonedcart">
|
29 |
+
<label>Second Abandoned Cart Mail</label>
|
30 |
+
<file>ebizmarts/abandonedcart/abandoned_cart_mail_2.html</file>
|
31 |
+
<type>html</type>
|
32 |
+
</ebizmarts_abandonedcart_general_template2>
|
33 |
+
</email>
|
34 |
+
</template>
|
35 |
+
<template>
|
36 |
+
<email>
|
37 |
+
<ebizmarts_abandonedcart_general_template3 translate="label" module="ebizmarts_abandonedcart">
|
38 |
+
<label>Third Abandoned Cart Mail</label>
|
39 |
+
<file>ebizmarts/abandonedcart/abandoned_cart_mail_3.html</file>
|
40 |
+
<type>html</type>
|
41 |
+
</ebizmarts_abandonedcart_general_template3>
|
42 |
+
</email>
|
43 |
+
</template>
|
44 |
+
<template>
|
45 |
+
<email>
|
46 |
+
<ebizmarts_abandonedcart_general_template4 translate="label" module="ebizmarts_abandonedcart">
|
47 |
+
<label>Fourth Abandoned Cart Mail</label>
|
48 |
+
<file>ebizmarts/abandonedcart/abandoned_cart_mail_generic.html</file>
|
49 |
+
<type>html</type>
|
50 |
+
</ebizmarts_abandonedcart_general_template4>
|
51 |
+
</email>
|
52 |
+
</template>
|
53 |
+
<template>
|
54 |
+
<email>
|
55 |
+
<ebizmarts_abandonedcart_general_template5 translate="label" module="ebizmarts_abandonedcart">
|
56 |
+
<label>Fifth Abandoned Cart Mail</label>
|
57 |
+
<file>ebizmarts/abandonedcart/abandoned_cart_mail_generic.html</file>
|
58 |
+
<type>html</type>
|
59 |
+
</ebizmarts_abandonedcart_general_template5>
|
60 |
</email>
|
61 |
</template>
|
62 |
<ebizmarts_abandonedcart>
|
180 |
<default>
|
181 |
<ebizmarts_abandonedcart>
|
182 |
<general>
|
183 |
+
<max>2</max>
|
184 |
+
<subject1>Having trouble?</subject1>
|
185 |
+
<subject2>Limited stock</subject2>
|
186 |
+
<subject3>Coupon Discount!</subject3>
|
187 |
+
<unit>1</unit>
|
188 |
+
<days1>1</days1>
|
189 |
+
<days2>1</days2>
|
190 |
+
<days3>2</days3>
|
191 |
+
<sendon>3</sendon>
|
192 |
<mandrill-tag>AbandonedCart</mandrill-tag>
|
193 |
<autologin>0</autologin>
|
194 |
<page>checkout/cart</page>
|
|
|
195 |
</general>
|
196 |
</ebizmarts_abandonedcart>
|
197 |
</default>
|
app/code/community/Ebizmarts/AbandonedCart/etc/system.xml
CHANGED
@@ -79,114 +79,275 @@
|
|
79 |
<active>1</active>
|
80 |
</depends>
|
81 |
</identity>
|
82 |
-
<
|
83 |
-
<label>
|
84 |
<frontend_type>select</frontend_type>
|
85 |
-
<config_path>ebizmarts_abandonedcart/general/
|
86 |
-
<source_model>
|
87 |
-
<sort_order>
|
88 |
<show_in_default>1</show_in_default>
|
89 |
<show_in_website>1</show_in_website>
|
90 |
<show_in_store>1</show_in_store>
|
|
|
91 |
<depends>
|
92 |
<active>1</active>
|
93 |
</depends>
|
94 |
-
</
|
95 |
-
<
|
96 |
-
<label>
|
97 |
-
<frontend_type>
|
98 |
-
<
|
99 |
-
<sort_order>23</sort_order>
|
100 |
<show_in_default>1</show_in_default>
|
101 |
<show_in_website>1</show_in_website>
|
102 |
<show_in_store>1</show_in_store>
|
103 |
<depends>
|
104 |
<active>1</active>
|
105 |
</depends>
|
106 |
-
</
|
107 |
-
<
|
108 |
-
<label>
|
109 |
-
<frontend_type>
|
110 |
-
<
|
|
|
111 |
<show_in_default>1</show_in_default>
|
112 |
<show_in_website>1</show_in_website>
|
113 |
<show_in_store>1</show_in_store>
|
114 |
<can_be_empty>0</can_be_empty>
|
115 |
-
<comment><![CDATA[
|
116 |
<depends>
|
117 |
<active>1</active>
|
118 |
</depends>
|
119 |
-
</
|
120 |
-
<
|
121 |
-
<label>
|
122 |
-
<frontend_type>
|
123 |
-
<
|
124 |
-
<source_model>ebizmarts_abandonedcart/system_config_cmspage</source_model>
|
125 |
-
<sort_order>26</sort_order>
|
126 |
<show_in_default>1</show_in_default>
|
127 |
<show_in_website>1</show_in_website>
|
128 |
<show_in_store>1</show_in_store>
|
129 |
-
<
|
|
|
130 |
<depends>
|
|
|
131 |
<active>1</active>
|
132 |
</depends>
|
133 |
-
</
|
134 |
-
<
|
135 |
-
<label>
|
136 |
-
<frontend_type>
|
137 |
-
<
|
|
|
|
|
138 |
<show_in_default>1</show_in_default>
|
139 |
<show_in_website>1</show_in_website>
|
140 |
<show_in_store>1</show_in_store>
|
141 |
<depends>
|
|
|
142 |
<active>1</active>
|
143 |
</depends>
|
144 |
-
</
|
145 |
-
<
|
146 |
<label>Send email after</label>
|
147 |
<frontend_type>text</frontend_type>
|
148 |
-
<sort_order>
|
149 |
<show_in_default>1</show_in_default>
|
150 |
<show_in_website>1</show_in_website>
|
151 |
<show_in_store>1</show_in_store>
|
152 |
<can_be_empty>0</can_be_empty>
|
153 |
<comment><![CDATA[This value depends of the next unit parameter]]></comment>
|
154 |
<depends>
|
|
|
155 |
<active>1</active>
|
156 |
</depends>
|
157 |
-
</
|
158 |
<unit translate="label comment">
|
159 |
<label>Unit</label>
|
160 |
<frontend_type>select</frontend_type>
|
161 |
<source_model>ebizmarts_abandonedcart/system_config_unit</source_model>
|
162 |
-
<sort_order>
|
163 |
<show_in_default>1</show_in_default>
|
164 |
<show_in_website>1</show_in_website>
|
165 |
<show_in_store>1</show_in_store>
|
166 |
<can_be_empty>0</can_be_empty>
|
167 |
<comment><![CDATA[Enter the unit for considering in the first email]]></comment>
|
168 |
<depends>
|
|
|
169 |
<active>1</active>
|
170 |
</depends>
|
171 |
</unit>
|
172 |
-
<
|
173 |
-
<label>
|
174 |
<frontend_type>text</frontend_type>
|
175 |
-
<sort_order>
|
176 |
<show_in_default>1</show_in_default>
|
177 |
<show_in_website>1</show_in_website>
|
178 |
<show_in_store>1</show_in_store>
|
179 |
<can_be_empty>0</can_be_empty>
|
180 |
-
<comment><![CDATA[
|
181 |
<depends>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
<active>1</active>
|
183 |
</depends>
|
184 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
<customer translate="label comment">
|
186 |
<label>Customer Groups</label>
|
187 |
<frontend_type>multiselect</frontend_type>
|
188 |
<source_model>ebizmarts_abandonedcart/system_config_customergroup</source_model>
|
189 |
-
<sort_order>
|
190 |
<show_in_default>1</show_in_default>
|
191 |
<show_in_website>1</show_in_website>
|
192 |
<show_in_store>1</show_in_store>
|
79 |
<active>1</active>
|
80 |
</depends>
|
81 |
</identity>
|
82 |
+
<page translate="label comment">
|
83 |
+
<label>Redirect page</label>
|
84 |
<frontend_type>select</frontend_type>
|
85 |
+
<config_path>ebizmarts_abandonedcart/general/page</config_path>
|
86 |
+
<source_model>ebizmarts_abandonedcart/system_config_cmspage</source_model>
|
87 |
+
<sort_order>26</sort_order>
|
88 |
<show_in_default>1</show_in_default>
|
89 |
<show_in_website>1</show_in_website>
|
90 |
<show_in_store>1</show_in_store>
|
91 |
+
<comment><![CDATA[Where to redirect the customer]]></comment>
|
92 |
<depends>
|
93 |
<active>1</active>
|
94 |
</depends>
|
95 |
+
</page>
|
96 |
+
<mandrill-tag translate="label">
|
97 |
+
<label>Mandrill Tag</label>
|
98 |
+
<frontend_type>text</frontend_type>
|
99 |
+
<sort_order>27</sort_order>
|
|
|
100 |
<show_in_default>1</show_in_default>
|
101 |
<show_in_website>1</show_in_website>
|
102 |
<show_in_store>1</show_in_store>
|
103 |
<depends>
|
104 |
<active>1</active>
|
105 |
</depends>
|
106 |
+
</mandrill-tag>
|
107 |
+
<max translate="label comment">
|
108 |
+
<label>Max number of email to send</label>
|
109 |
+
<frontend_type>select</frontend_type>
|
110 |
+
<source_model>ebizmarts_abandonedcart/system_config_maxemails</source_model>
|
111 |
+
<sort_order>33</sort_order>
|
112 |
<show_in_default>1</show_in_default>
|
113 |
<show_in_website>1</show_in_website>
|
114 |
<show_in_store>1</show_in_store>
|
115 |
<can_be_empty>0</can_be_empty>
|
116 |
+
<comment><![CDATA[Max]]></comment>
|
117 |
<depends>
|
118 |
<active>1</active>
|
119 |
</depends>
|
120 |
+
</max>
|
121 |
+
<subject1 translate="label comment">
|
122 |
+
<label>First Email Subject</label>
|
123 |
+
<frontend_type>text</frontend_type>
|
124 |
+
<sort_order>35</sort_order>
|
|
|
|
|
125 |
<show_in_default>1</show_in_default>
|
126 |
<show_in_website>1</show_in_website>
|
127 |
<show_in_store>1</show_in_store>
|
128 |
+
<can_be_empty>0</can_be_empty>
|
129 |
+
<comment><![CDATA[The subject for the first email abandoned cart]]></comment>
|
130 |
<depends>
|
131 |
+
<max separator=",">0,1,2,3,4</max>
|
132 |
<active>1</active>
|
133 |
</depends>
|
134 |
+
</subject1>
|
135 |
+
<template1 translate="label">
|
136 |
+
<label>First Email Template</label>
|
137 |
+
<frontend_type>select</frontend_type>
|
138 |
+
<config_path>ebizmarts_abandonedcart/general/template1</config_path>
|
139 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
140 |
+
<sort_order>36</sort_order>
|
141 |
<show_in_default>1</show_in_default>
|
142 |
<show_in_website>1</show_in_website>
|
143 |
<show_in_store>1</show_in_store>
|
144 |
<depends>
|
145 |
+
<max separator=",">0,1,2,3,4</max>
|
146 |
<active>1</active>
|
147 |
</depends>
|
148 |
+
</template1>
|
149 |
+
<days1 translate="label comment">
|
150 |
<label>Send email after</label>
|
151 |
<frontend_type>text</frontend_type>
|
152 |
+
<sort_order>37</sort_order>
|
153 |
<show_in_default>1</show_in_default>
|
154 |
<show_in_website>1</show_in_website>
|
155 |
<show_in_store>1</show_in_store>
|
156 |
<can_be_empty>0</can_be_empty>
|
157 |
<comment><![CDATA[This value depends of the next unit parameter]]></comment>
|
158 |
<depends>
|
159 |
+
<max separator=",">0,1,2,3,4</max>
|
160 |
<active>1</active>
|
161 |
</depends>
|
162 |
+
</days1>
|
163 |
<unit translate="label comment">
|
164 |
<label>Unit</label>
|
165 |
<frontend_type>select</frontend_type>
|
166 |
<source_model>ebizmarts_abandonedcart/system_config_unit</source_model>
|
167 |
+
<sort_order>38</sort_order>
|
168 |
<show_in_default>1</show_in_default>
|
169 |
<show_in_website>1</show_in_website>
|
170 |
<show_in_store>1</show_in_store>
|
171 |
<can_be_empty>0</can_be_empty>
|
172 |
<comment><![CDATA[Enter the unit for considering in the first email]]></comment>
|
173 |
<depends>
|
174 |
+
<max separator=",">0,1,2,3,4</max>
|
175 |
<active>1</active>
|
176 |
</depends>
|
177 |
</unit>
|
178 |
+
<subject2 translate="label comment">
|
179 |
+
<label>Second Email Subject</label>
|
180 |
<frontend_type>text</frontend_type>
|
181 |
+
<sort_order>41</sort_order>
|
182 |
<show_in_default>1</show_in_default>
|
183 |
<show_in_website>1</show_in_website>
|
184 |
<show_in_store>1</show_in_store>
|
185 |
<can_be_empty>0</can_be_empty>
|
186 |
+
<comment><![CDATA[The subject for the second email abandoned cart]]></comment>
|
187 |
<depends>
|
188 |
+
<max separator=",">1,2,3,4</max>
|
189 |
+
<active>1</active>
|
190 |
+
</depends>
|
191 |
+
</subject2>
|
192 |
+
<template2 translate="label">
|
193 |
+
<label>Second Email Template</label>
|
194 |
+
<frontend_type>select</frontend_type>
|
195 |
+
<config_path>ebizmarts_abandonedcart/general/template2</config_path>
|
196 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
197 |
+
<sort_order>42</sort_order>
|
198 |
+
<show_in_default>1</show_in_default>
|
199 |
+
<show_in_website>1</show_in_website>
|
200 |
+
<show_in_store>1</show_in_store>
|
201 |
+
<depends>
|
202 |
+
<max separator=",">1,2,3,4</max>
|
203 |
<active>1</active>
|
204 |
</depends>
|
205 |
+
</template2>
|
206 |
+
<days2 translate="label comment">
|
207 |
+
<label>Send email after</label>
|
208 |
+
<frontend_type>text</frontend_type>
|
209 |
+
<sort_order>43</sort_order>
|
210 |
+
<show_in_default>1</show_in_default>
|
211 |
+
<show_in_website>1</show_in_website>
|
212 |
+
<show_in_store>1</show_in_store>
|
213 |
+
<can_be_empty>0</can_be_empty>
|
214 |
+
<comment><![CDATA[This value is in days and is set since the moment cart was abandoned.]]></comment>
|
215 |
+
<depends>
|
216 |
+
<max separator=",">1,2,3,4</max>
|
217 |
+
<active>1</active>
|
218 |
+
</depends>
|
219 |
+
</days2>
|
220 |
+
<subject3 translate="label comment">
|
221 |
+
<label>Third Email Subject</label>
|
222 |
+
<frontend_type>text</frontend_type>
|
223 |
+
<sort_order>44</sort_order>
|
224 |
+
<show_in_default>1</show_in_default>
|
225 |
+
<show_in_website>1</show_in_website>
|
226 |
+
<show_in_store>1</show_in_store>
|
227 |
+
<can_be_empty>0</can_be_empty>
|
228 |
+
<comment><![CDATA[The subject for the third email abandoned cart]]></comment>
|
229 |
+
<depends>
|
230 |
+
<max separator=",">2,3,4</max>
|
231 |
+
<active>1</active>
|
232 |
+
</depends>
|
233 |
+
</subject3>
|
234 |
+
<template3 translate="label">
|
235 |
+
<label>Third Email Template</label>
|
236 |
+
<frontend_type>select</frontend_type>
|
237 |
+
<config_path>ebizmarts_abandonedcart/general/template3</config_path>
|
238 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
239 |
+
<sort_order>45</sort_order>
|
240 |
+
<show_in_default>1</show_in_default>
|
241 |
+
<show_in_website>1</show_in_website>
|
242 |
+
<show_in_store>1</show_in_store>
|
243 |
+
<depends>
|
244 |
+
<max separator=",">2,3,4</max>
|
245 |
+
<active>1</active>
|
246 |
+
</depends>
|
247 |
+
</template3>
|
248 |
+
<days3 translate="label comment">
|
249 |
+
<label>Send email after</label>
|
250 |
+
<frontend_type>text</frontend_type>
|
251 |
+
<sort_order>46</sort_order>
|
252 |
+
<show_in_default>1</show_in_default>
|
253 |
+
<show_in_website>1</show_in_website>
|
254 |
+
<show_in_store>1</show_in_store>
|
255 |
+
<can_be_empty>0</can_be_empty>
|
256 |
+
<comment><![CDATA[This value is in days and is set since the moment cart was abandoned.]]></comment>
|
257 |
+
<depends>
|
258 |
+
<max separator=",">2,3,4</max>
|
259 |
+
<active>1</active>
|
260 |
+
</depends>
|
261 |
+
</days3>
|
262 |
+
<subject4 translate="label comment">
|
263 |
+
<label>Fourth Email Subject</label>
|
264 |
+
<frontend_type>text</frontend_type>
|
265 |
+
<sort_order>47</sort_order>
|
266 |
+
<show_in_default>1</show_in_default>
|
267 |
+
<show_in_website>1</show_in_website>
|
268 |
+
<show_in_store>1</show_in_store>
|
269 |
+
<can_be_empty>0</can_be_empty>
|
270 |
+
<comment><![CDATA[The subject for the fourth email abandoned cart]]></comment>
|
271 |
+
<depends>
|
272 |
+
<max separator=",">3,4</max>
|
273 |
+
<active>1</active>
|
274 |
+
</depends>
|
275 |
+
</subject4>
|
276 |
+
<template4 translate="label">
|
277 |
+
<label>Fourth Email Template</label>
|
278 |
+
<frontend_type>select</frontend_type>
|
279 |
+
<config_path>ebizmarts_abandonedcart/general/template4</config_path>
|
280 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
281 |
+
<sort_order>48</sort_order>
|
282 |
+
<show_in_default>1</show_in_default>
|
283 |
+
<show_in_website>1</show_in_website>
|
284 |
+
<show_in_store>1</show_in_store>
|
285 |
+
<depends>
|
286 |
+
<max separator=",">3,4</max>
|
287 |
+
<active>1</active>
|
288 |
+
</depends>
|
289 |
+
</template4>
|
290 |
+
<days4 translate="label comment">
|
291 |
+
<label>Send email after</label>
|
292 |
+
<frontend_type>text</frontend_type>
|
293 |
+
<sort_order>49</sort_order>
|
294 |
+
<show_in_default>1</show_in_default>
|
295 |
+
<show_in_website>1</show_in_website>
|
296 |
+
<show_in_store>1</show_in_store>
|
297 |
+
<can_be_empty>0</can_be_empty>
|
298 |
+
<comment><![CDATA[This value is in days and is set since the moment cart was abandoned.]]></comment>
|
299 |
+
<depends>
|
300 |
+
<max separator=",">3,4</max>
|
301 |
+
<active>1</active>
|
302 |
+
</depends>
|
303 |
+
</days4>
|
304 |
+
<subject5 translate="label comment">
|
305 |
+
<label>Fourth Email Subject</label>
|
306 |
+
<frontend_type>text</frontend_type>
|
307 |
+
<sort_order>50</sort_order>
|
308 |
+
<show_in_default>1</show_in_default>
|
309 |
+
<show_in_website>1</show_in_website>
|
310 |
+
<show_in_store>1</show_in_store>
|
311 |
+
<can_be_empty>0</can_be_empty>
|
312 |
+
<comment><![CDATA[The subject for the fourth email abandoned cart]]></comment>
|
313 |
+
<depends>
|
314 |
+
<max separator=",">4</max>
|
315 |
+
<active>1</active>
|
316 |
+
</depends>
|
317 |
+
</subject5>
|
318 |
+
<template5 translate="label">
|
319 |
+
<label>Fifth Email Template</label>
|
320 |
+
<frontend_type>select</frontend_type>
|
321 |
+
<config_path>ebizmarts_abandonedcart/general/template5</config_path>
|
322 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
323 |
+
<sort_order>51</sort_order>
|
324 |
+
<show_in_default>1</show_in_default>
|
325 |
+
<show_in_website>1</show_in_website>
|
326 |
+
<show_in_store>1</show_in_store>
|
327 |
+
<depends>
|
328 |
+
<max separator=",">4</max>
|
329 |
+
<active>1</active>
|
330 |
+
</depends>
|
331 |
+
</template5>
|
332 |
+
<days5 translate="label comment">
|
333 |
+
<label>Send email after</label>
|
334 |
+
<frontend_type>text</frontend_type>
|
335 |
+
<sort_order>52</sort_order>
|
336 |
+
<show_in_default>1</show_in_default>
|
337 |
+
<show_in_website>1</show_in_website>
|
338 |
+
<show_in_store>1</show_in_store>
|
339 |
+
<can_be_empty>0</can_be_empty>
|
340 |
+
<comment><![CDATA[This value is in days and is set since the moment cart was abandoned.]]></comment>
|
341 |
+
<depends>
|
342 |
+
<max separator=",">4</max>
|
343 |
+
<active>1</active>
|
344 |
+
</depends>
|
345 |
+
</days5>
|
346 |
<customer translate="label comment">
|
347 |
<label>Customer Groups</label>
|
348 |
<frontend_type>multiselect</frontend_type>
|
349 |
<source_model>ebizmarts_abandonedcart/system_config_customergroup</source_model>
|
350 |
+
<sort_order>55</sort_order>
|
351 |
<show_in_default>1</show_in_default>
|
352 |
<show_in_website>1</show_in_website>
|
353 |
<show_in_store>1</show_in_store>
|
app/code/community/Ebizmarts/Autoresponder/Model/EventObserver.php
CHANGED
@@ -25,12 +25,12 @@ class Ebizmarts_Autoresponder_Model_EventObserver
|
|
25 |
$scope = "default";
|
26 |
}
|
27 |
$store = is_null($o->getEvent()->getStore()) ? Mage::app()->getDefaultStoreView()->getCode(): $o->getEvent()->getStore();
|
28 |
-
if(!Mage::helper('
|
29 |
$config = new Mage_Core_Model_Config();
|
30 |
$config->saveConfig(Ebizmarts_Autoresponder_Model_Config::GENERAL_ACTIVE,false,$scope,$store);
|
31 |
Mage::getConfig()->cleanCache();
|
32 |
}
|
33 |
-
if(!Mage::helper('
|
34 |
$config = new Mage_Core_Model_Config();
|
35 |
$config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ACTIVE,false,$scope,$store);
|
36 |
Mage::getConfig()->cleanCache();
|
25 |
$scope = "default";
|
26 |
}
|
27 |
$store = is_null($o->getEvent()->getStore()) ? Mage::app()->getDefaultStoreView()->getCode(): $o->getEvent()->getStore();
|
28 |
+
if(!Mage::helper('ebizmarts_mandrill')->useTransactionalService()) {
|
29 |
$config = new Mage_Core_Model_Config();
|
30 |
$config->saveConfig(Ebizmarts_Autoresponder_Model_Config::GENERAL_ACTIVE,false,$scope,$store);
|
31 |
Mage::getConfig()->cleanCache();
|
32 |
}
|
33 |
+
if(!Mage::helper('ebizmarts_mandrill')->useTransactionalService()) {
|
34 |
$config = new Mage_Core_Model_Config();
|
35 |
$config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ACTIVE,false,$scope,$store);
|
36 |
Mage::getConfig()->cleanCache();
|
app/code/community/Ebizmarts/Autoresponder/etc/config.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Ebizmarts_Autoresponder>
|
13 |
-
<version>0.1.
|
14 |
</Ebizmarts_Autoresponder>
|
15 |
</modules>
|
16 |
<global>
|
@@ -178,6 +178,15 @@
|
|
178 |
</observers>
|
179 |
</admin_system_config_changed_section_mandrill>
|
180 |
</events>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
</adminhtml>
|
182 |
<frontend>
|
183 |
<layout>
|
@@ -214,6 +223,15 @@
|
|
214 |
</observers>
|
215 |
</review_product_post_after>
|
216 |
</events>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
</frontend>
|
218 |
|
219 |
<crontab>
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Ebizmarts_Autoresponder>
|
13 |
+
<version>0.1.7</version>
|
14 |
</Ebizmarts_Autoresponder>
|
15 |
</modules>
|
16 |
<global>
|
178 |
</observers>
|
179 |
</admin_system_config_changed_section_mandrill>
|
180 |
</events>
|
181 |
+
<translate>
|
182 |
+
<modules>
|
183 |
+
<Ebizmarts_Autoresponder>
|
184 |
+
<files>
|
185 |
+
<default>Ebizmarts_Autoresponder.csv</default>
|
186 |
+
</files>
|
187 |
+
</Ebizmarts_Autoresponder>
|
188 |
+
</modules>
|
189 |
+
</translate>
|
190 |
</adminhtml>
|
191 |
<frontend>
|
192 |
<layout>
|
223 |
</observers>
|
224 |
</review_product_post_after>
|
225 |
</events>
|
226 |
+
<translate>
|
227 |
+
<modules>
|
228 |
+
<Ebizmarts_Autoresponder>
|
229 |
+
<files>
|
230 |
+
<default>Ebizmarts_Autoresponder.csv</default>
|
231 |
+
</files>
|
232 |
+
</Ebizmarts_Autoresponder>
|
233 |
+
</modules>
|
234 |
+
</translate>
|
235 |
</frontend>
|
236 |
|
237 |
<crontab>
|
app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/System/Config/Date.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 8/18/14
|
5 |
+
* Time : 9:27 AM
|
6 |
+
* File : Date.php
|
7 |
+
* Module : magemonkey
|
8 |
+
*/
|
9 |
+
class Ebizmarts_MageMonkey_Block_Adminhtml_System_Config_Date extends Mage_Adminhtml_Block_System_Config_Form_Field
|
10 |
+
{
|
11 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
12 |
+
{
|
13 |
+
$element->setFormat(Varien_Date::DATE_INTERNAL_FORMAT);
|
14 |
+
$element->setImage($this->getSkinUrl('images/grid-cal.gif'));
|
15 |
+
return parent::render($element);
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/System/Config/ResetLocalEcommerce.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 8/18/14
|
5 |
+
* Time : 3:23 PM
|
6 |
+
* File : ResetEcommerce.php
|
7 |
+
* Module : magemonkey
|
8 |
+
*/
|
9 |
+
class Ebizmarts_MageMonkey_Block_Adminhtml_System_Config_ResetLocalEcommerce extends Mage_Adminhtml_Block_System_Config_Form_Field
|
10 |
+
{
|
11 |
+
protected function _construct()
|
12 |
+
{
|
13 |
+
parent::_construct();
|
14 |
+
$this->setTemplate('magemonkey/system/config/resetlocal360.phtml');
|
15 |
+
}
|
16 |
+
|
17 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
18 |
+
{
|
19 |
+
return $this->_toHtml();
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Return ajax url for button
|
24 |
+
*
|
25 |
+
* @return string
|
26 |
+
*/
|
27 |
+
public function getAjaxCheckUrl()
|
28 |
+
{
|
29 |
+
$store = $this->getRequest()->getParam('store');
|
30 |
+
return Mage::helper('adminhtml')->getUrl('monkey/adminhtml_ecommerce/resetLocalEcommerce/store/'.$store);
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Generate button html
|
35 |
+
*
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public function getButtonHtml()
|
39 |
+
{
|
40 |
+
$button = $this->getLayout()->createBlock('adminhtml/widget_button')
|
41 |
+
->setData(array(
|
42 |
+
'id' => 'resetecommerce_button',
|
43 |
+
'label' => $this->helper('monkey')->__('Reset Local Orders Ecommerce360'),
|
44 |
+
'onclick' => 'javascript:check(); return false;'
|
45 |
+
));
|
46 |
+
|
47 |
+
return $button->toHtml();
|
48 |
+
}
|
49 |
+
}
|
app/code/community/Ebizmarts/MageMonkey/Block/Adminhtml/System/Config/ResetRemoteEcommerce.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 8/19/14
|
5 |
+
* Time : 12:52 AM
|
6 |
+
* File : ResetRemoteEcommerce.php
|
7 |
+
* Module : magemonkey
|
8 |
+
*/
|
9 |
+
class Ebizmarts_MageMonkey_Block_Adminhtml_System_Config_ResetRemoteEcommerce extends Mage_Adminhtml_Block_System_Config_Form_Field
|
10 |
+
{
|
11 |
+
protected function _construct()
|
12 |
+
{
|
13 |
+
parent::_construct();
|
14 |
+
$this->setTemplate('magemonkey/system/config/resetremote360.phtml');
|
15 |
+
}
|
16 |
+
|
17 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
18 |
+
{
|
19 |
+
return $this->_toHtml();
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Return ajax url for button
|
24 |
+
*
|
25 |
+
* @return string
|
26 |
+
*/
|
27 |
+
public function getAjaxCheckUrl()
|
28 |
+
{
|
29 |
+
$store = $this->getRequest()->getParam('store');
|
30 |
+
return Mage::helper('adminhtml')->getUrl('monkey/adminhtml_ecommerce/resetRemoteEcommerce/store/'.$store);
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Generate button html
|
35 |
+
*
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public function getButtonHtml()
|
39 |
+
{
|
40 |
+
$button = $this->getLayout()->createBlock('adminhtml/widget_button')
|
41 |
+
->setData(array(
|
42 |
+
'id' => 'resetecommerce_button',
|
43 |
+
'label' => $this->helper('monkey')->__('Reset Remote Orders Ecommerce360'),
|
44 |
+
'onclick' => 'javascript:check(); return false;'
|
45 |
+
));
|
46 |
+
|
47 |
+
return $button->toHtml();
|
48 |
+
}
|
49 |
+
}
|
app/code/community/Ebizmarts/MageMonkey/Block/Lists.php
CHANGED
@@ -102,10 +102,11 @@ class Ebizmarts_MageMonkey_Block_Lists extends Mage_Core_Block_Template
|
|
102 |
}else{
|
103 |
$listName = $this->__('General Subscription');
|
104 |
}
|
|
|
105 |
$this->_generalList = array(
|
106 |
'id' => $listData['data'][0]['id'],
|
107 |
'name' => $listName,
|
108 |
-
'interest_groupings' => $this->helper('monkey')->filterShowGroupings($
|
109 |
);
|
110 |
}
|
111 |
}
|
@@ -398,4 +399,16 @@ class Ebizmarts_MageMonkey_Block_Lists extends Mage_Core_Block_Template
|
|
398 |
|
399 |
return $checkbox->getLabelHtml() . $checkbox->getElementHtml();
|
400 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
}
|
102 |
}else{
|
103 |
$listName = $this->__('General Subscription');
|
104 |
}
|
105 |
+
$ig = $api->listInterestGroupings($listData['data'][0]['id']);
|
106 |
$this->_generalList = array(
|
107 |
'id' => $listData['data'][0]['id'],
|
108 |
'name' => $listName,
|
109 |
+
'interest_groupings' => $this->helper('monkey')->filterShowGroupings($ig),
|
110 |
);
|
111 |
}
|
112 |
}
|
399 |
|
400 |
return $checkbox->getLabelHtml() . $checkbox->getElementHtml();
|
401 |
}
|
402 |
+
public function getCanModify()
|
403 |
+
{
|
404 |
+
return Mage::getStoreConfig('monkey/general/changecustomergroup');
|
405 |
+
}
|
406 |
+
public function getForce()
|
407 |
+
{
|
408 |
+
$force = Mage::getStoreConfig('monkey/general/checkout_subscribe');
|
409 |
+
if($force==3||$force==4) {
|
410 |
+
return true;
|
411 |
+
}
|
412 |
+
return false;
|
413 |
+
}
|
414 |
}
|
app/code/community/Ebizmarts/MageMonkey/Helper/Data.php
CHANGED
@@ -789,11 +789,10 @@ class Ebizmarts_MageMonkey_Helper_Data extends Mage_Core_Helper_Abstract
|
|
789 |
$customer = Mage::registry('mc_guest_customer');
|
790 |
}
|
791 |
$email = $guestEmail ? $guestEmail : $customer->getEmail();
|
792 |
-
|
793 |
if( !empty($curlists) ){
|
794 |
|
795 |
//Handle Unsubscribe and groups update actions
|
796 |
-
|
797 |
|
798 |
if(FALSE === array_key_exists($listId, $lists)){
|
799 |
|
@@ -841,40 +840,42 @@ class Ebizmarts_MageMonkey_Helper_Data extends Mage_Core_Helper_Abstract
|
|
841 |
|
842 |
}
|
843 |
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
|
|
|
|
|
|
|
|
872 |
|
873 |
-
|
874 |
-
|
875 |
-
}
|
876 |
|
877 |
-
|
878 |
-
|
879 |
}
|
880 |
}
|
789 |
$customer = Mage::registry('mc_guest_customer');
|
790 |
}
|
791 |
$email = $guestEmail ? $guestEmail : $customer->getEmail();
|
|
|
792 |
if( !empty($curlists) ){
|
793 |
|
794 |
//Handle Unsubscribe and groups update actions
|
795 |
+
foreach($curlists as $listId => $list){
|
796 |
|
797 |
if(FALSE === array_key_exists($listId, $lists)){
|
798 |
|
840 |
|
841 |
}
|
842 |
|
843 |
+
//Subscribe to new lists
|
844 |
+
if (is_array($lists) && is_array($curlists)) {
|
845 |
+
$subscribe = array_diff_key($lists, $curlists);
|
846 |
+
if (!empty($subscribe)) {
|
847 |
+
|
848 |
+
foreach ($subscribe as $listId => $slist) {
|
849 |
+
|
850 |
+
if (!isset($slist['subscribed'])) {
|
851 |
+
continue;
|
852 |
+
}
|
853 |
+
|
854 |
+
$groupings = $lists[$listId];
|
855 |
+
unset($groupings['subscribed']);
|
856 |
+
if (!Mage::helper('monkey')->isAdmin() && (Mage::getStoreConfig(Mage_Newsletter_Model_Subscriber::XML_PATH_CONFIRMATION_FLAG, Mage::app()->getStore()->getId()) == 1)) {
|
857 |
+
$isConfirmNeed = TRUE;
|
858 |
+
}
|
859 |
+
if ($defaultList == $listId) {
|
860 |
+
$subscriber = Mage::getModel('newsletter/subscriber');
|
861 |
+
$subscriber->setListGroups($groupings);
|
862 |
+
$subscriber->setMcListId($listId);
|
863 |
+
$subscriber->setMcStoreId(Mage::app()->getStore()->getId());
|
864 |
+
$subscriber->setImportMode(TRUE);
|
865 |
+
$subscriber->subscribe($email);
|
866 |
+
} else {
|
867 |
+
$customer->setListGroups($groupings);
|
868 |
+
$customer->setMcListId($listId);
|
869 |
+
$mergeVars = Mage::helper('monkey')->getMergeVars($customer);
|
870 |
+
if(!Mage::getSingleton('core/session')->getMonkeyCheckout(TRUE) || Mage::getStoreConfig('monkey/general/checkout_async') != 1) {
|
871 |
+
$api->listSubscribe($listId, $email, $mergeVars, 'html', $isConfirmNeed);
|
872 |
+
}
|
873 |
+
|
874 |
+
}
|
875 |
|
876 |
+
}
|
|
|
|
|
877 |
|
878 |
+
}
|
879 |
+
}
|
880 |
}
|
881 |
}
|
app/code/community/Ebizmarts/MageMonkey/Model/Asyncorders.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 9/12/14
|
5 |
+
* Time : 1:30 AM
|
6 |
+
* File : Asyncorders.php
|
7 |
+
* Module : Ebizmarts_MageMonkey
|
8 |
+
*/
|
9 |
+
class Ebizmarts_MageMonkey_Model_Asyncorders extends Mage_Core_Model_Abstract
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* Initialize model
|
13 |
+
*
|
14 |
+
* @return void
|
15 |
+
*/
|
16 |
+
public function _construct()
|
17 |
+
{
|
18 |
+
parent::_construct();
|
19 |
+
$this->_init('monkey/asyncorders');
|
20 |
+
}
|
21 |
+
}
|
app/code/community/Ebizmarts/MageMonkey/Model/Asyncsubscribers.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 9/15/14
|
5 |
+
* Time : 12:46 PM
|
6 |
+
* File : Asyncsubscribers.php
|
7 |
+
* Module : Ebizmarts_MageMonkey
|
8 |
+
*/
|
9 |
+
class Ebizmarts_MageMonkey_Model_Asyncsubscribers extends Mage_Core_Model_Abstract
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* Initialize model
|
13 |
+
*
|
14 |
+
* @return void
|
15 |
+
*/
|
16 |
+
public function _construct()
|
17 |
+
{
|
18 |
+
parent::_construct();
|
19 |
+
$this->_init('monkey/asyncsubscribers');
|
20 |
+
}
|
21 |
+
}
|
app/code/community/Ebizmarts/MageMonkey/Model/Cron.php
CHANGED
@@ -417,9 +417,87 @@ class Ebizmarts_MageMonkey_Model_Cron
|
|
417 |
*/
|
418 |
public function processAutoExportJobs()
|
419 |
{
|
420 |
-
|
421 |
-
|
422 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
423 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
424 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
425 |
}
|
417 |
*/
|
418 |
public function processAutoExportJobs()
|
419 |
{
|
420 |
+
$allStores = Mage::app()->getStores();
|
421 |
+
foreach($allStores as $storeId => $val) {
|
422 |
+
if (Mage::getStoreConfig("monkey/general/ecommerce360",$storeId) == 3 && Mage::getModel('monkey/ecommerce360')->isActive()){
|
423 |
+
Mage::getModel('monkey/ecommerce360')->autoExportJobs($storeId);
|
424 |
+
}
|
425 |
+
}
|
426 |
+
}
|
427 |
+
public function processAutoExportOrders()
|
428 |
+
{
|
429 |
+
$allStores = Mage::app()->getStores();
|
430 |
+
foreach($allStores as $storeId => $val)
|
431 |
+
{
|
432 |
+
if(Mage::getStoreConfig("monkey/general/active",$storeId)) {
|
433 |
+
$this->_exportOrders($storeId);
|
434 |
+
}
|
435 |
+
}
|
436 |
+
}
|
437 |
+
public function sendordersAsync()
|
438 |
+
{
|
439 |
+
$collection = Mage::getModel('monkey/asyncorders')->getCollection();
|
440 |
+
$collection->addFieldToFilter('proccessed',array('eq'=>0));
|
441 |
+
$storeId = null;
|
442 |
+
foreach($collection as $item)
|
443 |
+
{
|
444 |
+
$info = (array)unserialize($item->getInfo());
|
445 |
+
$orderId = $info['order_id'];
|
446 |
+
unset($info['order_id']);
|
447 |
+
if($storeId!=$info['store_id']) {
|
448 |
+
$api = Mage::getSingleton('monkey/api',array('store' => $info['store_id']));
|
449 |
+
$storeId = $info['store_id'];
|
450 |
+
}
|
451 |
+
if(isset($info['campaign_id'])) {
|
452 |
+
$api->campaignEcommOrderAdd($info);
|
453 |
+
}
|
454 |
+
else {
|
455 |
+
$api->ecommOrderAdd($info);
|
456 |
+
$info['campaign_id'] = null;
|
457 |
+
}
|
458 |
+
$item->setProccessed(1)->save();
|
459 |
+
|
460 |
+
Mage::getModel('monkey/ecommerce')
|
461 |
+
->setOrderIncrementId($info['id'])
|
462 |
+
->setOrderId($orderId)
|
463 |
+
->setMcCampaignId($info['campaign_id'])
|
464 |
+
->setMcEmailId($info['email'])
|
465 |
+
->setCreatedAt( Mage::getModel('core/date')->gmtDate() )
|
466 |
+
->setStoreId($info['store_id'])
|
467 |
+
->save();
|
468 |
+
}
|
469 |
}
|
470 |
+
public function cleanordersAsync()
|
471 |
+
{
|
472 |
+
$collection = Mage::getModel('monkey/asyncorders')->getCollection();
|
473 |
+
$collection->addFieldToFilter('proccessed',array('eq'=>1));
|
474 |
+
foreach($collection as $item)
|
475 |
+
{
|
476 |
+
$item->delete();
|
477 |
+
}
|
478 |
+
}
|
479 |
+
public function sendSubscribersAsync()
|
480 |
+
{
|
481 |
+
$collection = Mage::getModel('monkey/asyncsubscribers')->getCollection();
|
482 |
+
$collection->addFieldToFilter('proccessed',array('eq'=>0));
|
483 |
+
foreach($collection as $item)
|
484 |
+
{
|
485 |
+
$mergeVars = unserialize($item->getMapfields());
|
486 |
+
$listId = $item->getLists();
|
487 |
+
$email = $item->getEmail();
|
488 |
+
$isConfirmNeed = $item->getConfirm();
|
489 |
+
Mage::getSingleton('monkey/api')->listSubscribe($listId, $email, $mergeVars, 'html', $isConfirmNeed);
|
490 |
+
$item->setProccessed(1)->save();
|
491 |
+
}
|
492 |
|
493 |
+
}
|
494 |
+
public function cleanSubscribersAsync()
|
495 |
+
{
|
496 |
+
$collection = Mage::getModel('nmonkey/asyncsubscribers')->getCollection();
|
497 |
+
$collection->addFieldToFilter('proccessed',array('eq'=>1));
|
498 |
+
foreach($collection as $item)
|
499 |
+
{
|
500 |
+
$item->delete();
|
501 |
+
}
|
502 |
+
}
|
503 |
}
|
app/code/community/Ebizmarts/MageMonkey/Model/Ecommerce360.php
CHANGED
@@ -116,8 +116,8 @@ class Ebizmarts_MageMonkey_Model_Ecommerce360
|
|
116 |
return false;
|
117 |
}
|
118 |
|
119 |
-
$subtotal = $this->_order->
|
120 |
-
$discount = (float)$this->_order->
|
121 |
if ($discount != 0) {
|
122 |
$subtotal = $subtotal + ($discount);
|
123 |
}
|
@@ -125,8 +125,8 @@ class Ebizmarts_MageMonkey_Model_Ecommerce360
|
|
125 |
$this->_info = array(
|
126 |
'id' => $this->_order->getIncrementId(),
|
127 |
'total' => $subtotal,
|
128 |
-
'shipping' => $this->_order->
|
129 |
-
'tax' => $this->_order->
|
130 |
'store_id' => $this->_order->getStoreId(),
|
131 |
'store_name' => $this->_order->getStoreName(),
|
132 |
'order_date' => $this->_order->getCreatedAt(),
|
@@ -138,16 +138,35 @@ class Ebizmarts_MageMonkey_Model_Ecommerce360
|
|
138 |
$campaignCookie = $this->_getCampaignCookie();
|
139 |
|
140 |
$this->setItemstoSend();
|
141 |
-
|
142 |
if($emailCookie && $campaignCookie){
|
143 |
$this->_info ['email_id']= $emailCookie;
|
144 |
$this->_info ['campaign_id']= $campaignCookie;
|
145 |
-
|
146 |
-
|
147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
}else{
|
149 |
$this->_info ['email']= $this->_order->getCustomerEmail();
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
}
|
152 |
|
153 |
if ( $rs === TRUE ){
|
@@ -173,7 +192,7 @@ class Ebizmarts_MageMonkey_Model_Ecommerce360
|
|
173 |
|
174 |
if(in_array($product->getTypeId(), $this->_productsToSkip) && $product->getPriceType() == 0){
|
175 |
if($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE){
|
176 |
-
$this->_auxPrice = $item->
|
177 |
}
|
178 |
continue;
|
179 |
}
|
@@ -199,7 +218,7 @@ class Ebizmarts_MageMonkey_Model_Ecommerce360
|
|
199 |
}
|
200 |
$mcitem['category_name'] = (count($names))? implode(" - ",array_reverse($names)) : 'None';
|
201 |
$mcitem['qty'] = $item->getQtyOrdered();
|
202 |
-
$mcitem['cost'] = ($this->_auxPrice > 0)? $this->_auxPrice : $item->
|
203 |
$this->_info['items'][] = $mcitem;
|
204 |
$this->_auxPrice = 0;
|
205 |
}
|
@@ -240,6 +259,7 @@ class Ebizmarts_MageMonkey_Model_Ecommerce360
|
|
240 |
->setMcCampaignId($this->_getCampaignCookie())
|
241 |
->setMcEmailId($this->_getEmailCookie())
|
242 |
->setCreatedAt( Mage::getModel('core/date')->gmtDate() )
|
|
|
243 |
->save();
|
244 |
}
|
245 |
|
@@ -247,15 +267,19 @@ class Ebizmarts_MageMonkey_Model_Ecommerce360
|
|
247 |
*
|
248 |
*
|
249 |
*/
|
250 |
-
public function autoExportJobs(){
|
251 |
$allow_sent = false;
|
252 |
-
$orders = Mage::getResourceModel('sales/order_collection');
|
253 |
$orders->getSelect()->joinLeft( array('ecommerce'=> Mage::getSingleton('core/resource')->getTableName('monkey/ecommerce')), 'main_table.entity_id = ecommerce.order_id', 'main_table.*')->where('ecommerce.order_id is null');
|
254 |
|
255 |
//Get status options selected in the Configuration
|
256 |
-
$states = explode(',', Mage::helper('monkey')->config('order_status'));
|
257 |
-
|
|
|
258 |
foreach($orders as $order){
|
|
|
|
|
|
|
259 |
foreach($states as $state){
|
260 |
if($order->getStatus() == $state || $state == 'all_status'){
|
261 |
$allow_sent = true;
|
@@ -269,8 +293,8 @@ class Ebizmarts_MageMonkey_Model_Ecommerce360
|
|
269 |
return false;
|
270 |
}
|
271 |
|
272 |
-
$subtotal = $this->_order->
|
273 |
-
$discount = (float)$this->_order->
|
274 |
if ($discount != 0) {
|
275 |
$subtotal = $subtotal + ($discount);
|
276 |
}
|
@@ -278,8 +302,8 @@ class Ebizmarts_MageMonkey_Model_Ecommerce360
|
|
278 |
$this->_info = array(
|
279 |
'id' => $this->_order->getIncrementId(),
|
280 |
'total' => $subtotal,
|
281 |
-
'shipping' => $this->_order->
|
282 |
-
'tax' => $this->_order->
|
283 |
'store_id' => $this->_order->getStoreId(),
|
284 |
'store_name' => $this->_order->getStoreName(),
|
285 |
'order_date' => $this->_order->getCreatedAt(),
|
@@ -304,6 +328,7 @@ class Ebizmarts_MageMonkey_Model_Ecommerce360
|
|
304 |
$allow_sent = false;
|
305 |
if ( isset($rs['complete']) && $rs['complete'] == TRUE ) {
|
306 |
$this->_logCall();
|
|
|
307 |
}
|
308 |
}
|
309 |
|
116 |
return false;
|
117 |
}
|
118 |
|
119 |
+
$subtotal = $this->_order->getBaseSubtotal();
|
120 |
+
$discount = (float)$this->_order->getBaseDiscountAmount();
|
121 |
if ($discount != 0) {
|
122 |
$subtotal = $subtotal + ($discount);
|
123 |
}
|
125 |
$this->_info = array(
|
126 |
'id' => $this->_order->getIncrementId(),
|
127 |
'total' => $subtotal,
|
128 |
+
'shipping' => $this->_order->getBaseShippingAmount(),
|
129 |
+
'tax' => $this->_order->getBaseTaxAmount(),
|
130 |
'store_id' => $this->_order->getStoreId(),
|
131 |
'store_name' => $this->_order->getStoreName(),
|
132 |
'order_date' => $this->_order->getCreatedAt(),
|
138 |
$campaignCookie = $this->_getCampaignCookie();
|
139 |
|
140 |
$this->setItemstoSend();
|
141 |
+
$rs = false;
|
142 |
if($emailCookie && $campaignCookie){
|
143 |
$this->_info ['email_id']= $emailCookie;
|
144 |
$this->_info ['campaign_id']= $campaignCookie;
|
145 |
+
if(Mage::getStoreConfig('monkey/general/checkout_async')) {
|
146 |
+
$sync = Mage::getModel('monkey/asyncorders');
|
147 |
+
$this->_info['order_id'] = $this->_order->getId();
|
148 |
+
$sync->setInfo(serialize($this->_info))
|
149 |
+
->setCreatedAt(Mage::getModel('core/date')->gmtDate())
|
150 |
+
->setProccessed(0)
|
151 |
+
->save();
|
152 |
+
}
|
153 |
+
else {
|
154 |
+
//Send order to MailChimp
|
155 |
+
$rs = $api->campaignEcommOrderAdd($this->_info);
|
156 |
+
}
|
157 |
}else{
|
158 |
$this->_info ['email']= $this->_order->getCustomerEmail();
|
159 |
+
if(Mage::getStoreConfig('monkey/general/checkout_async')) {
|
160 |
+
$sync = Mage::getModel('monkey/asyncorders');
|
161 |
+
$this->_info['order_id'] = $this->_order->getId();
|
162 |
+
$sync->setInfo(serialize($this->_info))
|
163 |
+
->setCreatedAt(Mage::getModel('core/date')->gmtDate())
|
164 |
+
->setProccessed(0)
|
165 |
+
->save();
|
166 |
+
}
|
167 |
+
else {
|
168 |
+
$rs = $api->ecommOrderAdd($this->_info);
|
169 |
+
}
|
170 |
}
|
171 |
|
172 |
if ( $rs === TRUE ){
|
192 |
|
193 |
if(in_array($product->getTypeId(), $this->_productsToSkip) && $product->getPriceType() == 0){
|
194 |
if($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE){
|
195 |
+
$this->_auxPrice = $item->getBasePrice();
|
196 |
}
|
197 |
continue;
|
198 |
}
|
218 |
}
|
219 |
$mcitem['category_name'] = (count($names))? implode(" - ",array_reverse($names)) : 'None';
|
220 |
$mcitem['qty'] = $item->getQtyOrdered();
|
221 |
+
$mcitem['cost'] = ($this->_auxPrice > 0)? $this->_auxPrice : $item->getBasePrice();
|
222 |
$this->_info['items'][] = $mcitem;
|
223 |
$this->_auxPrice = 0;
|
224 |
}
|
259 |
->setMcCampaignId($this->_getCampaignCookie())
|
260 |
->setMcEmailId($this->_getEmailCookie())
|
261 |
->setCreatedAt( Mage::getModel('core/date')->gmtDate() )
|
262 |
+
->setStoreId($this->_order->getStoreId())
|
263 |
->save();
|
264 |
}
|
265 |
|
267 |
*
|
268 |
*
|
269 |
*/
|
270 |
+
public function autoExportJobs($storeId){
|
271 |
$allow_sent = false;
|
272 |
+
$orders = Mage::getResourceModel('sales/order_collection')->addFieldToFilter('main_table.store_id',array('eq'=>$storeId));
|
273 |
$orders->getSelect()->joinLeft( array('ecommerce'=> Mage::getSingleton('core/resource')->getTableName('monkey/ecommerce')), 'main_table.entity_id = ecommerce.order_id', 'main_table.*')->where('ecommerce.order_id is null');
|
274 |
|
275 |
//Get status options selected in the Configuration
|
276 |
+
$states = explode(',', Mage::helper('monkey')->config('order_status',$storeId));
|
277 |
+
$max = Mage::getStoreConfig("monkey/general/order_max",$storeId);
|
278 |
+
$counter = 0;
|
279 |
foreach($orders as $order){
|
280 |
+
if($counter>$max) {
|
281 |
+
break;
|
282 |
+
}
|
283 |
foreach($states as $state){
|
284 |
if($order->getStatus() == $state || $state == 'all_status'){
|
285 |
$allow_sent = true;
|
293 |
return false;
|
294 |
}
|
295 |
|
296 |
+
$subtotal = $this->_order->getBaseSubtotal();
|
297 |
+
$discount = (float)$this->_order->getBaseDiscountAmount();
|
298 |
if ($discount != 0) {
|
299 |
$subtotal = $subtotal + ($discount);
|
300 |
}
|
302 |
$this->_info = array(
|
303 |
'id' => $this->_order->getIncrementId(),
|
304 |
'total' => $subtotal,
|
305 |
+
'shipping' => $this->_order->getBaseShippingAmount(),
|
306 |
+
'tax' => $this->_order->getBaseTaxAmount(),
|
307 |
'store_id' => $this->_order->getStoreId(),
|
308 |
'store_name' => $this->_order->getStoreName(),
|
309 |
'order_date' => $this->_order->getCreatedAt(),
|
328 |
$allow_sent = false;
|
329 |
if ( isset($rs['complete']) && $rs['complete'] == TRUE ) {
|
330 |
$this->_logCall();
|
331 |
+
$counter++;
|
332 |
}
|
333 |
}
|
334 |
|
app/code/community/Ebizmarts/MageMonkey/Model/MCAPI.php
CHANGED
@@ -2471,6 +2471,7 @@ class Ebizmarts_MageMonkey_Model_MCAPI
|
|
2471 |
|
2472 |
list($headers, $response) = explode("\r\n\r\n", $response, 2);
|
2473 |
$headers = explode("\r\n", $headers);
|
|
|
2474 |
$errored = false;
|
2475 |
foreach($headers as $h){
|
2476 |
if (substr($h,0,26)==="X-MailChimp-API-Error-Code"){
|
2471 |
|
2472 |
list($headers, $response) = explode("\r\n\r\n", $response, 2);
|
2473 |
$headers = explode("\r\n", $headers);
|
2474 |
+
|
2475 |
$errored = false;
|
2476 |
foreach($headers as $h){
|
2477 |
if (substr($h,0,26)==="X-MailChimp-API-Error-Code"){
|
app/code/community/Ebizmarts/MageMonkey/Model/Mysql4/Asyncorders.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 9/12/14
|
5 |
+
* Time : 1:09 AM
|
6 |
+
* File : AsyncOrders.php
|
7 |
+
* Module : Ebizmarts_MageMonkey
|
8 |
+
*/
|
9 |
+
class Ebizmarts_MageMonkey_Model_Mysql4_Asyncorders extends Mage_Core_Model_Mysql4_Abstract
|
10 |
+
{
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Initialize
|
14 |
+
*
|
15 |
+
* @return void
|
16 |
+
*/
|
17 |
+
public function _construct()
|
18 |
+
{
|
19 |
+
$this->_init('monkey/asyncorders', 'id');
|
20 |
+
}
|
21 |
+
}
|
app/code/community/Ebizmarts/MageMonkey/Model/Mysql4/Asyncorders/Collection.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 9/12/14
|
5 |
+
* Time : 1:17 AM
|
6 |
+
* File : Collection.php
|
7 |
+
* Module : Ebizmarts_MageMonkey
|
8 |
+
*/
|
9 |
+
class Ebizmarts_MageMonkey_Model_Mysql4_Asyncorders_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
10 |
+
{
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Set resource type
|
14 |
+
*
|
15 |
+
* @return void
|
16 |
+
*/
|
17 |
+
public function _construct()
|
18 |
+
{
|
19 |
+
parent::_construct();
|
20 |
+
$this->_init('monkey/asyncorders');
|
21 |
+
}
|
22 |
+
}
|
app/code/community/Ebizmarts/MageMonkey/Model/Mysql4/Asyncsubscribers.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 9/12/14
|
5 |
+
* Time : 1:14 AM
|
6 |
+
* File : Asyncsubscribers.php
|
7 |
+
* Module : Ebizmarts_MageMonkey
|
8 |
+
*/
|
9 |
+
class Ebizmarts_MageMonkey_Model_Mysql4_Asyncsubscribers extends Mage_Core_Model_Mysql4_Abstract
|
10 |
+
{
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Initialize
|
14 |
+
*
|
15 |
+
* @return void
|
16 |
+
*/
|
17 |
+
public function _construct()
|
18 |
+
{
|
19 |
+
$this->_init('monkey/asyncsubscribers', 'id');
|
20 |
+
}
|
21 |
+
}
|
app/code/community/Ebizmarts/MageMonkey/Model/Mysql4/Asyncsubscribers/Collection.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 9/12/14
|
5 |
+
* Time : 1:19 AM
|
6 |
+
* File : Collection.php
|
7 |
+
* Module : Ebizmarts_MageMonkey
|
8 |
+
*/
|
9 |
+
class Ebizmarts_MageMonkey_Model_Mysql4_Asyncsubscribers_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
10 |
+
{
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Set resource type
|
14 |
+
*
|
15 |
+
* @return void
|
16 |
+
*/
|
17 |
+
public function _construct()
|
18 |
+
{
|
19 |
+
parent::_construct();
|
20 |
+
$this->_init('monkey/asyncsubscribers');
|
21 |
+
}
|
22 |
+
}
|
app/code/community/Ebizmarts/MageMonkey/Model/Observer.php
CHANGED
@@ -19,7 +19,7 @@ class Ebizmarts_MageMonkey_Model_Observer
|
|
19 |
*/
|
20 |
public function handleSubscriber(Varien_Event_Observer $observer)
|
21 |
{
|
22 |
-
|
23 |
return $observer;
|
24 |
}
|
25 |
|
@@ -33,12 +33,13 @@ class Ebizmarts_MageMonkey_Model_Observer
|
|
33 |
return $observer;
|
34 |
}
|
35 |
|
36 |
-
|
|
|
37 |
return $observer;
|
38 |
}
|
39 |
|
40 |
$email = $subscriber->getSubscriberEmail();
|
41 |
-
if($subscriber->getMcStoreId()){
|
42 |
$listId = Mage::helper('monkey')->getDefaultList($subscriber->getMcStoreId());
|
43 |
}
|
44 |
elseif($subscriber->getStoreId()){
|
@@ -46,7 +47,7 @@ class Ebizmarts_MageMonkey_Model_Observer
|
|
46 |
}
|
47 |
else{
|
48 |
$listId = Mage::helper('monkey')->getDefaultList(Mage::app()->getStore()->getId());
|
49 |
-
}
|
50 |
$subscriber->setImportMode(TRUE);
|
51 |
$isConfirmNeed = FALSE;
|
52 |
if( !Mage::helper('monkey')->isAdmin() &&
|
@@ -59,11 +60,15 @@ class Ebizmarts_MageMonkey_Model_Observer
|
|
59 |
}
|
60 |
|
61 |
//Check if customer is not yet subscribed on MailChimp
|
|
|
|
|
|
|
|
|
|
|
62 |
$isOnMailChimp = Mage::helper('monkey')->subscribedToList($email, $listId);
|
63 |
|
64 |
//Flag only is TRUE when changing to SUBSCRIBE
|
65 |
if( TRUE === $subscriber->getIsStatusChanged() ){
|
66 |
-
|
67 |
if($isOnMailChimp == 1){
|
68 |
return $observer;
|
69 |
}
|
@@ -73,8 +78,26 @@ class Ebizmarts_MageMonkey_Model_Observer
|
|
73 |
Mage::getSingleton('core/session')->addSuccess(Mage::helper('monkey')->__('Confirmation request has been sent.'));
|
74 |
}
|
75 |
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
|
|
|
|
|
|
|
78 |
}
|
79 |
// This code unsubscribe users if it's on MailChimp and the status it's unconfirmed
|
80 |
/*else{
|
@@ -315,7 +338,7 @@ class Ebizmarts_MageMonkey_Model_Observer
|
|
315 |
{
|
316 |
$post = Mage::app()->getRequest()->getPost();
|
317 |
if(!Mage::helper('monkey')->canMonkey()){
|
318 |
-
return;
|
319 |
}
|
320 |
|
321 |
$customer = $observer->getEvent()->getCustomer();
|
@@ -327,7 +350,6 @@ class Ebizmarts_MageMonkey_Model_Observer
|
|
327 |
if(!$oldEmail){
|
328 |
return $observer;
|
329 |
}
|
330 |
-
|
331 |
$mergeVars = $this->_mergeVars($customer, TRUE);
|
332 |
$api = Mage::getSingleton('monkey/api', array('store' => $customer->getStoreId()));
|
333 |
$lists = $api->listsForEmail($oldEmail);
|
@@ -360,12 +382,12 @@ class Ebizmarts_MageMonkey_Model_Observer
|
|
360 |
}
|
361 |
|
362 |
if(Mage::app()->getRequest()->isPost()){
|
363 |
-
$subscribe
|
|
|
364 |
|
365 |
Mage::getSingleton('core/session')->setMonkeyPost( serialize(Mage::app()->getRequest()->getPost()) );
|
366 |
-
|
367 |
-
|
368 |
-
Mage::getSingleton('core/session')->setMonkeyCheckout($subscribe);
|
369 |
}
|
370 |
}
|
371 |
}
|
@@ -378,8 +400,9 @@ class Ebizmarts_MageMonkey_Model_Observer
|
|
378 |
*/
|
379 |
public function registerCheckoutSuccess(Varien_Event_Observer $observer)
|
380 |
{
|
|
|
381 |
if(!Mage::helper('monkey')->canMonkey()){
|
382 |
-
return;
|
383 |
}
|
384 |
|
385 |
$orderId = (int)current($observer->getEvent()->getOrderIds());
|
@@ -395,8 +418,9 @@ class Ebizmarts_MageMonkey_Model_Observer
|
|
395 |
$order->setEbizmartsMagemonkeyCampaignId($campaign_id);
|
396 |
}
|
397 |
$sessionFlag = Mage::getSingleton('core/session')->getMonkeyCheckout();
|
398 |
-
$forceSubscription = Mage::helper('monkey')->canCheckoutSubscribe();
|
399 |
-
|
|
|
400 |
//Guest Checkout
|
401 |
if( (int)$order->getCustomerGroupId() === Mage_Customer_Model_Group::NOT_LOGGED_IN_ID ){
|
402 |
Mage::helper('monkey')->registerGuestCustomer($order);
|
@@ -413,7 +437,7 @@ class Ebizmarts_MageMonkey_Model_Observer
|
|
413 |
}
|
414 |
|
415 |
//Multiple lists on checkout
|
416 |
-
$monkeyPost = Mage::getSingleton('core/session')->getMonkeyPost(
|
417 |
if($monkeyPost){
|
418 |
|
419 |
$post = unserialize($monkeyPost);
|
@@ -435,44 +459,104 @@ class Ebizmarts_MageMonkey_Model_Observer
|
|
435 |
* @param bool $includeEmail
|
436 |
* @return array
|
437 |
*/
|
438 |
-
protected function _mergeVars($object = NULL, $includeEmail = FALSE)
|
439 |
-
|
440 |
-
//Initialize as GUEST customer
|
441 |
-
$customer = new Varien_Object;
|
442 |
-
|
443 |
-
$regCustomer = Mage::registry('current_customer');
|
444 |
-
$guestCustomer = Mage::registry('mc_guest_customer');
|
445 |
-
|
446 |
-
if( Mage::helper('customer')->isLoggedIn() ){
|
447 |
-
$customer = Mage::helper('customer')->getCustomer();
|
448 |
-
}elseif($regCustomer){
|
449 |
-
$customer = $regCustomer;
|
450 |
-
}elseif($guestCustomer){
|
451 |
-
$customer = $guestCustomer;
|
452 |
-
}else{
|
453 |
-
if(is_null($object)){
|
454 |
-
$customer->setEmail($object->getSubscriberEmail())
|
455 |
-
->setStoreId($object->getStoreId());
|
456 |
-
}else{
|
457 |
-
$customer = $object;
|
458 |
-
}
|
459 |
|
460 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
461 |
|
462 |
-
|
463 |
-
if($object->getListGroups()){
|
464 |
-
$customer->setListGroups($object->getListGroups());
|
465 |
-
}
|
466 |
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
|
472 |
-
|
|
|
|
|
|
|
473 |
|
474 |
-
|
475 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
|
477 |
/** Add mass action option to Sales -> Order grid in admin panel to send orders to MC (Ecommerce360)
|
478 |
*
|
19 |
*/
|
20 |
public function handleSubscriber(Varien_Event_Observer $observer)
|
21 |
{
|
22 |
+
if(!Mage::helper('monkey')->canMonkey()){
|
23 |
return $observer;
|
24 |
}
|
25 |
|
33 |
return $observer;
|
34 |
}
|
35 |
|
36 |
+
|
37 |
+
if(!Mage::getSingleton('core/session')->getMonkeyCheckout()){
|
38 |
return $observer;
|
39 |
}
|
40 |
|
41 |
$email = $subscriber->getSubscriberEmail();
|
42 |
+
/*if($subscriber->getMcStoreId()){
|
43 |
$listId = Mage::helper('monkey')->getDefaultList($subscriber->getMcStoreId());
|
44 |
}
|
45 |
elseif($subscriber->getStoreId()){
|
47 |
}
|
48 |
else{
|
49 |
$listId = Mage::helper('monkey')->getDefaultList(Mage::app()->getStore()->getId());
|
50 |
+
}*/
|
51 |
$subscriber->setImportMode(TRUE);
|
52 |
$isConfirmNeed = FALSE;
|
53 |
if( !Mage::helper('monkey')->isAdmin() &&
|
60 |
}
|
61 |
|
62 |
//Check if customer is not yet subscribed on MailChimp
|
63 |
+
$monkeyPost = Mage::getSingleton('core/session')->getMonkeyPost();
|
64 |
+
if($monkeyPost) {
|
65 |
+
$post = unserialize($monkeyPost);
|
66 |
+
foreach($post['list'] as $listSubscribed){
|
67 |
+
$listId = $listSubscribed['subscribed'];
|
68 |
$isOnMailChimp = Mage::helper('monkey')->subscribedToList($email, $listId);
|
69 |
|
70 |
//Flag only is TRUE when changing to SUBSCRIBE
|
71 |
if( TRUE === $subscriber->getIsStatusChanged() ){
|
|
|
72 |
if($isOnMailChimp == 1){
|
73 |
return $observer;
|
74 |
}
|
78 |
Mage::getSingleton('core/session')->addSuccess(Mage::helper('monkey')->__('Confirmation request has been sent.'));
|
79 |
}
|
80 |
|
81 |
+
$mergeVars = $this->_mergeVars($subscriber, FALSE, $listId);
|
82 |
+
|
83 |
+
if(Mage::getStoreConfig('monkey/general/checkout_async'))
|
84 |
+
{
|
85 |
+
$subs = Mage::getModel('monkey/asyncsubscribers');
|
86 |
+
$subs->setMapfields(serialize($mergeVars))
|
87 |
+
->setEmail($email)
|
88 |
+
->setLists($listId)
|
89 |
+
->setConfirm($isConfirmNeed)
|
90 |
+
->setProccessed(0)
|
91 |
+
->setCreatedAt(Mage::getModel('core/date')->gmtDate())
|
92 |
+
->save();
|
93 |
+
}
|
94 |
+
else {
|
95 |
+
Mage::getSingleton('monkey/api')->listSubscribe($listId, $email, $mergeVars, 'html', $isConfirmNeed);
|
96 |
+
}
|
97 |
|
98 |
+
}
|
99 |
+
}
|
100 |
+
Mage::getSingleton('core/session')->getMonkeyPost(TRUE);
|
101 |
}
|
102 |
// This code unsubscribe users if it's on MailChimp and the status it's unconfirmed
|
103 |
/*else{
|
338 |
{
|
339 |
$post = Mage::app()->getRequest()->getPost();
|
340 |
if(!Mage::helper('monkey')->canMonkey()){
|
341 |
+
return $observer;
|
342 |
}
|
343 |
|
344 |
$customer = $observer->getEvent()->getCustomer();
|
350 |
if(!$oldEmail){
|
351 |
return $observer;
|
352 |
}
|
|
|
353 |
$mergeVars = $this->_mergeVars($customer, TRUE);
|
354 |
$api = Mage::getSingleton('monkey/api', array('store' => $customer->getStoreId()));
|
355 |
$lists = $api->listsForEmail($oldEmail);
|
382 |
}
|
383 |
|
384 |
if(Mage::app()->getRequest()->isPost()){
|
385 |
+
$subscribe = Mage::app()->getRequest()->getPost('magemonkey_subscribe');
|
386 |
+
$force = Mage::app()->getRequest()->getPost('magemonkey_force');
|
387 |
|
388 |
Mage::getSingleton('core/session')->setMonkeyPost( serialize(Mage::app()->getRequest()->getPost()) );
|
389 |
+
if(!is_null($subscribe)||!is_null($force)){
|
390 |
+
Mage::getSingleton('core/session')->setMonkeyCheckout(true);
|
|
|
391 |
}
|
392 |
}
|
393 |
}
|
400 |
*/
|
401 |
public function registerCheckoutSuccess(Varien_Event_Observer $observer)
|
402 |
{
|
403 |
+
|
404 |
if(!Mage::helper('monkey')->canMonkey()){
|
405 |
+
return $observer;
|
406 |
}
|
407 |
|
408 |
$orderId = (int)current($observer->getEvent()->getOrderIds());
|
418 |
$order->setEbizmartsMagemonkeyCampaignId($campaign_id);
|
419 |
}
|
420 |
$sessionFlag = Mage::getSingleton('core/session')->getMonkeyCheckout();
|
421 |
+
// $forceSubscription = Mage::helper('monkey')->canCheckoutSubscribe();
|
422 |
+
// if($sessionFlag || $forceSubscription == 3 || $forceSubscription == 4){
|
423 |
+
if($sessionFlag){
|
424 |
//Guest Checkout
|
425 |
if( (int)$order->getCustomerGroupId() === Mage_Customer_Model_Group::NOT_LOGGED_IN_ID ){
|
426 |
Mage::helper('monkey')->registerGuestCustomer($order);
|
437 |
}
|
438 |
|
439 |
//Multiple lists on checkout
|
440 |
+
$monkeyPost = Mage::getSingleton('core/session')->getMonkeyPost();
|
441 |
if($monkeyPost){
|
442 |
|
443 |
$post = unserialize($monkeyPost);
|
459 |
* @param bool $includeEmail
|
460 |
* @return array
|
461 |
*/
|
462 |
+
protected function _mergeVars($object = NULL, $includeEmail = FALSE, $currentList = NULL)
|
463 |
+
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
464 |
|
465 |
+
//Initialize as GUEST customer
|
466 |
+
$customer = new Varien_Object;
|
467 |
+
|
468 |
+
$regCustomer = Mage::registry('current_customer');
|
469 |
+
$guestCustomer = Mage::registry('mc_guest_customer');
|
470 |
+
|
471 |
+
if (Mage::helper('customer')->isLoggedIn()) {
|
472 |
+
$customer = Mage::helper('customer')->getCustomer();
|
473 |
+
} elseif ($regCustomer) {
|
474 |
+
$customer = $regCustomer;
|
475 |
+
} elseif ($guestCustomer) {
|
476 |
+
$customer = $guestCustomer;
|
477 |
+
} else {
|
478 |
+
if (is_null($object)) {
|
479 |
+
$customer->setEmail($object->getSubscriberEmail())
|
480 |
+
->setStoreId($object->getStoreId());
|
481 |
+
} else {
|
482 |
+
$customer = $object;
|
483 |
+
}
|
484 |
|
485 |
+
}
|
|
|
|
|
|
|
486 |
|
487 |
+
if (is_object($object)) {
|
488 |
+
if ($object->getListGroups()) {
|
489 |
+
$customer->setListGroups($object->getListGroups());
|
490 |
+
}
|
491 |
|
492 |
+
if ($object->getMcListId()) {
|
493 |
+
$customer->setMcListId($object->getMcListId());
|
494 |
+
}
|
495 |
+
}
|
496 |
|
497 |
+
$mergeVars = Mage::helper('monkey')->getMergeVars($customer, $includeEmail);
|
498 |
+
// add groups
|
499 |
+
$monkeyPost = Mage::getSingleton('core/session')->getMonkeyPost();
|
500 |
+
$defaultList = Mage::getStoreConfig('monkey/general/list', $object->getStoreId());
|
501 |
+
|
502 |
+
|
503 |
+
if ($monkeyPost) {
|
504 |
+
$post = unserialize($monkeyPost);
|
505 |
+
//if can change customer set the groups set by customer else set the groups on MailChimp config
|
506 |
+
if ($currentList && Mage::getStoreConfig('monkey/general/changecustomergroup', $object->getStoreId()) == 1) {
|
507 |
+
$subscribeGroups = array(0 => array());
|
508 |
+
foreach ($post['list'][$currentList] as $toGroups => $value) {
|
509 |
+
if (is_numeric($toGroups)) {
|
510 |
+
$subscribeGroups[0]['id'] = $toGroups;
|
511 |
+
$subscribeGroups[0]['groups'] = implode(', ', array_unique($post['list'][$currentList][$subscribeGroups[0]['id']]));
|
512 |
+
}
|
513 |
+
}
|
514 |
+
$groups = NULL;
|
515 |
+
} else {
|
516 |
+
$groups = Mage::getStoreConfig('monkey/general/cutomergroup', $object->getStoreId());
|
517 |
+
$groups = explode(",", $groups);
|
518 |
+
if (is_array($groups)) {
|
519 |
+
$subscribeGroups = array();
|
520 |
+
$_prevGroup = null;
|
521 |
+
$checkboxes = array();
|
522 |
+
foreach ($groups as $group) {
|
523 |
+
$item = explode("_", $group);
|
524 |
+
$currentGroup = $item[0];
|
525 |
+
if ($currentGroup == $_prevGroup || $_prevGroup == null) {
|
526 |
+
$checkboxes[] = $item[1];
|
527 |
+
$_prevGroup = $currentGroup;
|
528 |
+
} else {
|
529 |
+
$subscribeGroups[] = array('id' => $_prevGroup, "groups" => str_replace('%C%', '\\,', implode(', ', $checkboxes)));
|
530 |
+
$checkboxes = array();
|
531 |
+
$_prevGroup = $currentGroup;
|
532 |
+
$checkboxes[] = $item[1];
|
533 |
+
}
|
534 |
+
}
|
535 |
+
$subscribeGroups[] = array('id' => $currentGroup, "groups" => str_replace('%C%', '\\,', implode(', ', $checkboxes)));
|
536 |
+
|
537 |
+
}
|
538 |
+
}
|
539 |
+
if ($subscribeGroups[0]['id'] && $subscribeGroups[0]['id'] != -1) {
|
540 |
+
$mergeVars["GROUPINGS"] = $subscribeGroups;
|
541 |
+
}
|
542 |
+
|
543 |
+
$force = Mage::getStoreConfig('monkey/general/checkout_subscribe', $object->getStoreId());
|
544 |
+
$map = Mage::getStoreConfig('monkey/general/markfield', $object->getStoreId());
|
545 |
+
if ($post['magemonkey_subscribe'] && $map != "") {
|
546 |
+
$listsChecked = explode(',', $post['magemonkey_subscribe']);
|
547 |
+
$hasClicked = in_array($currentList, $listsChecked);
|
548 |
+
if ($hasClicked && $force != 3) {
|
549 |
+
$mergeVars[$map] = "Yes";
|
550 |
+
} else {
|
551 |
+
$mergeVars[$map] = "No";
|
552 |
+
}
|
553 |
+
} else {
|
554 |
+
$mergeVars[$map] = "No";
|
555 |
+
}
|
556 |
+
}
|
557 |
+
|
558 |
+
return $mergeVars;
|
559 |
+
}
|
560 |
|
561 |
/** Add mass action option to Sales -> Order grid in admin panel to send orders to MC (Ecommerce360)
|
562 |
*
|
app/code/community/Ebizmarts/MageMonkey/Model/System/Config/Source/Checkoutsubscribe.php
CHANGED
@@ -21,7 +21,8 @@ class Ebizmarts_MageMonkey_Model_System_Config_Source_Checkoutsubscribe
|
|
21 |
return array(
|
22 |
array('value' => 1, 'label' => Mage::helper('monkey')->__('Enabled - Checked by default')),
|
23 |
array('value' => 2, 'label' => Mage::helper('monkey')->__('Enabled - Not Checked by default')),
|
24 |
-
array('value' => 3, 'label' => Mage::helper('monkey')->__('Enabled - Force subscription')),
|
|
|
25 |
array('value' => 0, 'label' => Mage::helper('monkey')->__('-- Disabled --'))
|
26 |
);
|
27 |
}
|
21 |
return array(
|
22 |
array('value' => 1, 'label' => Mage::helper('monkey')->__('Enabled - Checked by default')),
|
23 |
array('value' => 2, 'label' => Mage::helper('monkey')->__('Enabled - Not Checked by default')),
|
24 |
+
array('value' => 3, 'label' => Mage::helper('monkey')->__('Enabled - Force subscription not showing')),
|
25 |
+
array('value' => 4, 'label' => Mage::helper('monkey')->__('Enabled - Force subscription')),
|
26 |
array('value' => 0, 'label' => Mage::helper('monkey')->__('-- Disabled --'))
|
27 |
);
|
28 |
}
|
app/code/community/Ebizmarts/MageMonkey/Model/System/Config/Source/CustomerGroup.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 8/29/14
|
5 |
+
* Time : 3:36 PM
|
6 |
+
* File : CustomerGroup.php
|
7 |
+
* Module : magemonkey
|
8 |
+
*/
|
9 |
+
class Ebizmarts_MageMonkey_Model_System_Config_Source_CustomerGroup
|
10 |
+
{
|
11 |
+
protected $_group = null;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Load lists and store on class property
|
15 |
+
*
|
16 |
+
* @return void
|
17 |
+
*/
|
18 |
+
public function __construct()
|
19 |
+
{
|
20 |
+
$listId = Mage::getStoreConfig('monkey/general/list');
|
21 |
+
if( is_null($this->_group) ){
|
22 |
+
$this->_group = Mage::getSingleton('monkey/api')
|
23 |
+
->listInterestGroupings($listId);
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Options getter
|
29 |
+
*
|
30 |
+
* @return array
|
31 |
+
*/
|
32 |
+
public function toOptionArray()
|
33 |
+
{
|
34 |
+
$lists = array();
|
35 |
+
|
36 |
+
// if(is_array($this->_group)){
|
37 |
+
// foreach($this->_group as $group) {
|
38 |
+
// $lists[] = array('value'=> $group['id'], 'label' => $group['name'],'style'=>'font-weight: bold;');
|
39 |
+
// $prefix = $group['id'];
|
40 |
+
// foreach($group['groups'] as $key=>$list){
|
41 |
+
// $lists []= array('value' => $prefix.'_'.$key, 'label' => $list['name'],'style'=>'padding-left:20px');
|
42 |
+
// }
|
43 |
+
// }
|
44 |
+
//
|
45 |
+
// }else{
|
46 |
+
// $lists []= array('value' => '', 'label' => Mage::helper('monkey')->__('--- No data ---'));
|
47 |
+
// }
|
48 |
+
|
49 |
+
return $lists;
|
50 |
+
}
|
51 |
+
|
52 |
+
}
|
app/code/community/Ebizmarts/MageMonkey/Model/System/Config/Source/OrderProcessLimit.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 8/18/14
|
5 |
+
* Time : 2:33 PM
|
6 |
+
* File : OrderProcessLimit.php
|
7 |
+
* Module : magemonkey
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Ebizmarts_MageMonkey_Model_System_Config_Source_OrderProcessLimit
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* Options getter
|
14 |
+
*
|
15 |
+
* @return array
|
16 |
+
*/
|
17 |
+
public function toOptionArray()
|
18 |
+
{
|
19 |
+
return array(
|
20 |
+
array('value' => 100, 'label' => Mage::helper('monkey')->__('100')),
|
21 |
+
array('value' => 200, 'label' => Mage::helper('monkey')->__('200')),
|
22 |
+
array('value' => 500, 'label' => Mage::helper('monkey')->__('500')),
|
23 |
+
array('value' => 1000, 'label' => Mage::helper('monkey')->__('1000')),
|
24 |
+
);
|
25 |
+
}
|
26 |
+
}
|
app/code/community/Ebizmarts/MageMonkey/controllers/Adminhtml/ConfigController.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 8/29/14
|
5 |
+
* Time : 5:47 PM
|
6 |
+
* File : ConfigController.php
|
7 |
+
* Module : magemonkey
|
8 |
+
*/
|
9 |
+
class Ebizmarts_MageMonkey_Adminhtml_ConfigController extends Mage_Adminhtml_Controller_Action
|
10 |
+
{
|
11 |
+
public function getGroupsAction()
|
12 |
+
{
|
13 |
+
$params = $this->getRequest()->getParams();
|
14 |
+
$listId = $params['list'];
|
15 |
+
if(isset($params['store'])) {
|
16 |
+
$store = $params['store'];
|
17 |
+
$store =$this->_getStoreByCode($$store);
|
18 |
+
$storeId = $store->getId();
|
19 |
+
}
|
20 |
+
else {
|
21 |
+
$storeId = null;
|
22 |
+
}
|
23 |
+
$originalGroups = Mage::getStoreConfig('monkey/general/cutomergroup',$storeId);
|
24 |
+
$originalGroups = explode(",",$originalGroups);
|
25 |
+
$groups = Mage::getSingleton('monkey/api')->listInterestGroupings($listId);
|
26 |
+
$rc = array();
|
27 |
+
if(is_array($groups)) {
|
28 |
+
foreach($groups as $group)
|
29 |
+
{
|
30 |
+
$rc[] = array('value'=>$group['id'],'label'=>$group['name'],'disabled'=>1,'style'=>'font-weight: bold');
|
31 |
+
$prefix = $group['id'];
|
32 |
+
foreach($group['groups'] as $item)
|
33 |
+
{
|
34 |
+
if(in_array($prefix.'_'.$item['name'],$originalGroups)) {
|
35 |
+
$rc[] = array('value'=>$prefix.'_'.$item['name'],'label'=>$item['name'],'style'=>'padding-left:20px',"selected"=>true);
|
36 |
+
}
|
37 |
+
else {
|
38 |
+
$rc[] = array('value'=>$prefix.'_'.$item['name'],'label'=>$item['name'],'style'=>'padding-left:20px',"selected"=>false);
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
43 |
+
$this->getResponse()->setHeader('Content-type', 'application/json');
|
44 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($rc));
|
45 |
+
return;
|
46 |
+
|
47 |
+
}
|
48 |
+
protected function _getStoreByCode($storeCode)
|
49 |
+
{
|
50 |
+
$stores = array_keys(Mage::app()->getStores());
|
51 |
+
foreach($stores as $id){
|
52 |
+
$store = Mage::app()->getStore($id);
|
53 |
+
if($store->getCode()==$storeCode) {
|
54 |
+
return $store;
|
55 |
+
}
|
56 |
+
}
|
57 |
+
return false;
|
58 |
+
}
|
59 |
+
|
60 |
+
}
|
app/code/community/Ebizmarts/MageMonkey/controllers/Adminhtml/EcommerceController.php
CHANGED
@@ -108,5 +108,76 @@ class Ebizmarts_MageMonkey_Adminhtml_EcommerceController extends Mage_Adminhtml_
|
|
108 |
}
|
109 |
$this->_redirect('*/*/index');
|
110 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
|
112 |
}
|
108 |
}
|
109 |
$this->_redirect('*/*/index');
|
110 |
}
|
111 |
+
public function resetLocalEcommerceAction()
|
112 |
+
{
|
113 |
+
$result = 1;
|
114 |
+
$store = $this->getRequest()->getParam('store');
|
115 |
+
if(!$store)
|
116 |
+
{
|
117 |
+
$collection = Mage::getModel('monkey/ecommerce')->getCollection();
|
118 |
+
}
|
119 |
+
else {
|
120 |
+
$allStores = Mage::app()->getStores();
|
121 |
+
foreach($allStores as $_store)
|
122 |
+
{
|
123 |
+
if($store==$_store->getCode())
|
124 |
+
break;
|
125 |
+
}
|
126 |
+
$storeId = $_store->getId();
|
127 |
+
$collection = Mage::getModel('monkey/ecommerce')->getCollection();
|
128 |
+
$collection->addFieldToFilter('main_table.store_id',array('eq'=>$storeId));
|
129 |
+
}
|
130 |
+
foreach($collection as $item)
|
131 |
+
{
|
132 |
+
try {
|
133 |
+
$item->delete();
|
134 |
+
}
|
135 |
+
catch(exception $e)
|
136 |
+
{
|
137 |
+
$result = 0;
|
138 |
+
}
|
139 |
+
}
|
140 |
+
Mage::app()->getResponse()->setBody($result);
|
141 |
+
}
|
142 |
+
|
143 |
+
public function resetRemoteEcommerceAction()
|
144 |
+
{
|
145 |
+
$result = 1;
|
146 |
+
$store = $this->getRequest()->getParam('store');
|
147 |
+
$storeId = null;
|
148 |
+
|
149 |
+
if(!$store)
|
150 |
+
{
|
151 |
+
$api = Mage::getSingleton('monkey/api');
|
152 |
+
}
|
153 |
+
else {
|
154 |
+
$allStores = Mage::app()->getStores();
|
155 |
+
foreach($allStores as $_store)
|
156 |
+
{
|
157 |
+
if($store==$_store->getCode())
|
158 |
+
break;
|
159 |
+
}
|
160 |
+
$storeId = $_store->getId();
|
161 |
+
$api = Mage::getSingleton('monkey/api', array('store' => $store));
|
162 |
+
}
|
163 |
+
$start = 0;
|
164 |
+
$max = 500;
|
165 |
+
$orders = $api->ecommOrders($start,$max);
|
166 |
+
while($orders['total']>0)
|
167 |
+
{
|
168 |
+
$orders = $orders['data'];
|
169 |
+
foreach($orders as $order)
|
170 |
+
{
|
171 |
+
if($order['store_id']==$storeId||$storeId==null) {
|
172 |
+
$api->ecommOrderDel($order['store_id'],$order['order_id']);
|
173 |
+
}
|
174 |
+
else {
|
175 |
+
$start++;
|
176 |
+
}
|
177 |
+
}
|
178 |
+
$orders = $api->ecommOrders($start,$max);
|
179 |
+
}
|
180 |
+
Mage::app()->getResponse()->setBody($result);
|
181 |
+
}
|
182 |
|
183 |
}
|
app/code/community/Ebizmarts/MageMonkey/etc/adminhtml.xml
CHANGED
@@ -45,6 +45,30 @@
|
|
45 |
<children>
|
46 |
<magemonkey translate="title" module="monkey">
|
47 |
<title>MailChimp</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
</magemonkey>
|
49 |
</children>
|
50 |
</newsletter>
|
45 |
<children>
|
46 |
<magemonkey translate="title" module="monkey">
|
47 |
<title>MailChimp</title>
|
48 |
+
<children>
|
49 |
+
<ecommerce translate="title" module="monkey">
|
50 |
+
<title>Ecommerce 360 Orders</title>
|
51 |
+
<children>
|
52 |
+
<commerce translate="title" module="monkey">
|
53 |
+
<title>Magento sent orders</title>
|
54 |
+
</commerce>
|
55 |
+
<apicommerce translate="title" module="monkey">
|
56 |
+
<title>ALL orders from API</title>
|
57 |
+
</apicommerce>
|
58 |
+
</children>
|
59 |
+
</ecommerce>
|
60 |
+
<bulksync translate="title" module="monkey">
|
61 |
+
<title>Bulk Sync</title>
|
62 |
+
<children>
|
63 |
+
<mage_to_mc translate="title" module="monkey">
|
64 |
+
<title>Export</title>
|
65 |
+
</mage_to_mc>
|
66 |
+
<mc_to_mage translate="title" module="monkey">
|
67 |
+
<title>Import</title>
|
68 |
+
</mc_to_mage>
|
69 |
+
</children>
|
70 |
+
</bulksync>
|
71 |
+
</children>
|
72 |
</magemonkey>
|
73 |
</children>
|
74 |
</newsletter>
|
app/code/community/Ebizmarts/MageMonkey/etc/config.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Ebizmarts_MageMonkey>
|
13 |
-
<version>1.1.
|
14 |
</Ebizmarts_MageMonkey>
|
15 |
</modules>
|
16 |
<global>
|
@@ -52,6 +52,8 @@
|
|
52 |
<ecommerce><table>magemonkey_ecommerce360</table></ecommerce>
|
53 |
<bulksync_export><table>magemonkey_bulksync_export</table></bulksync_export>
|
54 |
<bulksync_import><table>magemonkey_bulksync_import</table></bulksync_import>
|
|
|
|
|
55 |
</entities>
|
56 |
</monkey_mysql4>
|
57 |
</models>
|
@@ -235,6 +237,8 @@
|
|
235 |
<cron_export>1000</cron_export>
|
236 |
<order_status>all_status</order_status>
|
237 |
<enable_log>1</enable_log>
|
|
|
|
|
238 |
</general>
|
239 |
<notifications>
|
240 |
<updates_url><![CDATA[http://store.ebizmarts.com/media/feeds/]]></updates_url>
|
@@ -256,6 +260,22 @@
|
|
256 |
<schedule><cron_expr>0 * * * *</cron_expr></schedule>
|
257 |
<run><model>monkey/cron::processAutoExportJobs</model></run>
|
258 |
</magemonkey_autoexport_subscribers>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
</jobs>
|
260 |
</crontab>
|
261 |
</config>
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Ebizmarts_MageMonkey>
|
13 |
+
<version>1.1.22</version>
|
14 |
</Ebizmarts_MageMonkey>
|
15 |
</modules>
|
16 |
<global>
|
52 |
<ecommerce><table>magemonkey_ecommerce360</table></ecommerce>
|
53 |
<bulksync_export><table>magemonkey_bulksync_export</table></bulksync_export>
|
54 |
<bulksync_import><table>magemonkey_bulksync_import</table></bulksync_import>
|
55 |
+
<asyncsubscribers><table>magemonkey_async_subscribers</table></asyncsubscribers>
|
56 |
+
<asyncorders><table>magemonkey_async_orders</table></asyncorders>
|
57 |
</entities>
|
58 |
</monkey_mysql4>
|
59 |
</models>
|
237 |
<cron_export>1000</cron_export>
|
238 |
<order_status>all_status</order_status>
|
239 |
<enable_log>1</enable_log>
|
240 |
+
<checkout_async>1</checkout_async>
|
241 |
+
<markfield>HASCLICKED</markfield>
|
242 |
</general>
|
243 |
<notifications>
|
244 |
<updates_url><![CDATA[http://store.ebizmarts.com/media/feeds/]]></updates_url>
|
260 |
<schedule><cron_expr>0 * * * *</cron_expr></schedule>
|
261 |
<run><model>monkey/cron::processAutoExportJobs</model></run>
|
262 |
</magemonkey_autoexport_subscribers>
|
263 |
+
<magemonkey_sendorders_asynch>
|
264 |
+
<schedule><cron_expr>*/15 * * * *</cron_expr></schedule>
|
265 |
+
<run><model>monkey/cron::sendordersAsync</model></run>
|
266 |
+
</magemonkey_sendorders_asynch>
|
267 |
+
<magemonkey_cleanorders_asynch>
|
268 |
+
<schedule><cron_expr>0 0 1 * *</cron_expr></schedule>
|
269 |
+
<run><model>monkey/cron::cleanordersAsync</model></run>
|
270 |
+
</magemonkey_cleanorders_asynch>
|
271 |
+
<magemonkey_sendsubscribers_asynch>
|
272 |
+
<schedule><cron_expr>*/15 * * * *</cron_expr></schedule>
|
273 |
+
<run><model>monkey/cron::sendSubscribersAsync</model></run>
|
274 |
+
</magemonkey_sendsubscribers_asynch>
|
275 |
+
<magemonkey_cleansubscribers_asynch>
|
276 |
+
<schedule><cron_expr>0 0 1 * *</cron_expr></schedule>
|
277 |
+
<run><model>monkey/cron::cleanSubscribersAsync</model></run>
|
278 |
+
</magemonkey_cleansubscribers_asynch>
|
279 |
</jobs>
|
280 |
</crontab>
|
281 |
</config>
|
app/code/community/Ebizmarts/MageMonkey/etc/system.xml
CHANGED
@@ -78,6 +78,26 @@
|
|
78 |
<show_in_website>0</show_in_website>
|
79 |
<show_in_store>1</show_in_store>
|
80 |
</account_details>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
<list translate="label comment">
|
82 |
<label>General Subscription</label>
|
83 |
<frontend_type>select</frontend_type>
|
@@ -89,6 +109,25 @@
|
|
89 |
<can_be_empty>1</can_be_empty>
|
90 |
<comment>Synchronize Magento's General Subscription List with this MailChimp list</comment>
|
91 |
</list>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
<showreallistname translate="label comment">
|
93 |
<label>Show Original List Name</label>
|
94 |
<frontend_type>select</frontend_type>
|
@@ -144,6 +183,19 @@
|
|
144 |
<ecommerce360>3</ecommerce360>
|
145 |
</depends>
|
146 |
</order_status>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
<map_fields translate="label comment">
|
148 |
<label>Customer Fields Mapping</label>
|
149 |
<frontend_model>monkey/adminhtml_system_config_form_field_mapfields</frontend_model>
|
@@ -182,11 +234,32 @@
|
|
182 |
<show_in_store>1</show_in_store>
|
183 |
<comment>Show Newsletter Subscribe checkbox in the last Checkout Step (Order Review)</comment>
|
184 |
</checkout_subscribe>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
<cron_import translate="label comment">
|
186 |
<label>Limit of Customers to Import</label>
|
187 |
<frontend_type>select</frontend_type>
|
188 |
<source_model>monkey/system_config_source_cronProcessLimit</source_model>
|
189 |
-
<sort_order>
|
190 |
<show_in_default>1</show_in_default>
|
191 |
<show_in_website>0</show_in_website>
|
192 |
<show_in_store>1</show_in_store>
|
@@ -196,7 +269,7 @@
|
|
196 |
<label>Limit of Customers to Export</label>
|
197 |
<frontend_type>select</frontend_type>
|
198 |
<source_model>monkey/system_config_source_cronProcessLimit</source_model>
|
199 |
-
<sort_order>
|
200 |
<show_in_default>1</show_in_default>
|
201 |
<show_in_website>0</show_in_website>
|
202 |
<show_in_store>1</show_in_store>
|
@@ -206,7 +279,7 @@
|
|
206 |
<label>Webhooks Delete action</label>
|
207 |
<frontend_type>select</frontend_type>
|
208 |
<source_model>monkey/system_config_source_webhookDelete</source_model>
|
209 |
-
<sort_order>
|
210 |
<show_in_default>1</show_in_default>
|
211 |
<show_in_website>0</show_in_website>
|
212 |
<show_in_store>1</show_in_store>
|
@@ -216,7 +289,7 @@
|
|
216 |
<label>Show Admin Notifications</label>
|
217 |
<frontend_type>select</frontend_type>
|
218 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
219 |
-
<sort_order>
|
220 |
<show_in_default>1</show_in_default>
|
221 |
<show_in_website>0</show_in_website>
|
222 |
<show_in_store>1</show_in_store>
|
@@ -226,7 +299,7 @@
|
|
226 |
<label>Enable Log</label>
|
227 |
<frontend_type>select</frontend_type>
|
228 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
229 |
-
<sort_order>
|
230 |
<show_in_default>1</show_in_default>
|
231 |
<show_in_website>0</show_in_website>
|
232 |
<show_in_store>1</show_in_store>
|
78 |
<show_in_website>0</show_in_website>
|
79 |
<show_in_store>1</show_in_store>
|
80 |
</account_details>
|
81 |
+
<reset_localecommerce360 translate="label comment">
|
82 |
+
<label>Reset Local Ecommerce360</label>
|
83 |
+
<frontend_type>button</frontend_type>
|
84 |
+
<frontend_model>monkey/adminhtml_system_config_resetLocalEcommerce</frontend_model>
|
85 |
+
<sort_order>26</sort_order>
|
86 |
+
<show_in_default>1</show_in_default>
|
87 |
+
<show_in_website>0</show_in_website>
|
88 |
+
<show_in_store>1</show_in_store>
|
89 |
+
<comment>Select carefully the correct scope</comment>
|
90 |
+
</reset_localecommerce360>
|
91 |
+
<reset_remoteecommerce360 translate="label comment">
|
92 |
+
<label>Reset Remote Ecommerce360</label>
|
93 |
+
<frontend_type>button</frontend_type>
|
94 |
+
<frontend_model>monkey/adminhtml_system_config_resetRemoteEcommerce</frontend_model>
|
95 |
+
<sort_order>28</sort_order>
|
96 |
+
<show_in_default>1</show_in_default>
|
97 |
+
<show_in_website>0</show_in_website>
|
98 |
+
<show_in_store>1</show_in_store>
|
99 |
+
<comment><![CDATA[Keep in mind, all your orders in Malchimp will be removed.<br>Select carefully the correct scope]]></comment>
|
100 |
+
</reset_remoteecommerce360>
|
101 |
<list translate="label comment">
|
102 |
<label>General Subscription</label>
|
103 |
<frontend_type>select</frontend_type>
|
109 |
<can_be_empty>1</can_be_empty>
|
110 |
<comment>Synchronize Magento's General Subscription List with this MailChimp list</comment>
|
111 |
</list>
|
112 |
+
<cutomergroup translate="label comment">
|
113 |
+
<label>Customer Group</label>
|
114 |
+
<frontend_type>multiselect</frontend_type>
|
115 |
+
<source_model>monkey/system_config_source_customerGroup</source_model>
|
116 |
+
<sort_order>33</sort_order>
|
117 |
+
<show_in_default>1</show_in_default>
|
118 |
+
<show_in_website>0</show_in_website>
|
119 |
+
<show_in_store>1</show_in_store>
|
120 |
+
<can_be_empty>1</can_be_empty>
|
121 |
+
</cutomergroup>
|
122 |
+
<changecustomergroup translate="label comment">
|
123 |
+
<label>Customer can change groups</label>
|
124 |
+
<frontend_type>select</frontend_type>
|
125 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
126 |
+
<sort_order>34</sort_order>
|
127 |
+
<show_in_default>1</show_in_default>
|
128 |
+
<show_in_website>0</show_in_website>
|
129 |
+
<show_in_store>1</show_in_store>
|
130 |
+
</changecustomergroup>
|
131 |
<showreallistname translate="label comment">
|
132 |
<label>Show Original List Name</label>
|
133 |
<frontend_type>select</frontend_type>
|
183 |
<ecommerce360>3</ecommerce360>
|
184 |
</depends>
|
185 |
</order_status>
|
186 |
+
<order_max translate="label comment">
|
187 |
+
<label>Max Orders by run</label>
|
188 |
+
<frontend_type>select</frontend_type>
|
189 |
+
<source_model>monkey/system_config_source_orderProcessLimit</source_model>
|
190 |
+
<sort_order>67</sort_order>
|
191 |
+
<show_in_default>1</show_in_default>
|
192 |
+
<show_in_website>0</show_in_website>
|
193 |
+
<show_in_store>1</show_in_store>
|
194 |
+
<comment></comment>
|
195 |
+
<depends>
|
196 |
+
<ecommerce360>3</ecommerce360>
|
197 |
+
</depends>
|
198 |
+
</order_max>
|
199 |
<map_fields translate="label comment">
|
200 |
<label>Customer Fields Mapping</label>
|
201 |
<frontend_model>monkey/adminhtml_system_config_form_field_mapfields</frontend_model>
|
234 |
<show_in_store>1</show_in_store>
|
235 |
<comment>Show Newsletter Subscribe checkbox in the last Checkout Step (Order Review)</comment>
|
236 |
</checkout_subscribe>
|
237 |
+
<markfield translate="label comment">
|
238 |
+
<label>Map field to mark</label>
|
239 |
+
<frontend_type>text</frontend_type>
|
240 |
+
<sort_order>103</sort_order>
|
241 |
+
<show_in_default>1</show_in_default>
|
242 |
+
<show_in_website>0</show_in_website>
|
243 |
+
<show_in_store>1</show_in_store>
|
244 |
+
<comment>Field to distinguish if the user subscribe</comment>
|
245 |
+
</markfield>
|
246 |
+
<checkout_async translate="label comment">
|
247 |
+
<label>Use Async subscribe in checkout</label>
|
248 |
+
<frontend_type>select</frontend_type>
|
249 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
250 |
+
<sort_order>105</sort_order>
|
251 |
+
<show_in_default>1</show_in_default>
|
252 |
+
<show_in_website>0</show_in_website>
|
253 |
+
<show_in_store>1</show_in_store>
|
254 |
+
<depends>
|
255 |
+
<checkout_subscribe separator=",">1,2,3,4</checkout_subscribe>
|
256 |
+
</depends>
|
257 |
+
</checkout_async>
|
258 |
<cron_import translate="label comment">
|
259 |
<label>Limit of Customers to Import</label>
|
260 |
<frontend_type>select</frontend_type>
|
261 |
<source_model>monkey/system_config_source_cronProcessLimit</source_model>
|
262 |
+
<sort_order>110</sort_order>
|
263 |
<show_in_default>1</show_in_default>
|
264 |
<show_in_website>0</show_in_website>
|
265 |
<show_in_store>1</show_in_store>
|
269 |
<label>Limit of Customers to Export</label>
|
270 |
<frontend_type>select</frontend_type>
|
271 |
<source_model>monkey/system_config_source_cronProcessLimit</source_model>
|
272 |
+
<sort_order>120</sort_order>
|
273 |
<show_in_default>1</show_in_default>
|
274 |
<show_in_website>0</show_in_website>
|
275 |
<show_in_store>1</show_in_store>
|
279 |
<label>Webhooks Delete action</label>
|
280 |
<frontend_type>select</frontend_type>
|
281 |
<source_model>monkey/system_config_source_webhookDelete</source_model>
|
282 |
+
<sort_order>150</sort_order>
|
283 |
<show_in_default>1</show_in_default>
|
284 |
<show_in_website>0</show_in_website>
|
285 |
<show_in_store>1</show_in_store>
|
289 |
<label>Show Admin Notifications</label>
|
290 |
<frontend_type>select</frontend_type>
|
291 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
292 |
+
<sort_order>160</sort_order>
|
293 |
<show_in_default>1</show_in_default>
|
294 |
<show_in_website>0</show_in_website>
|
295 |
<show_in_store>1</show_in_store>
|
299 |
<label>Enable Log</label>
|
300 |
<frontend_type>select</frontend_type>
|
301 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
302 |
+
<sort_order>170</sort_order>
|
303 |
<show_in_default>1</show_in_default>
|
304 |
<show_in_website>0</show_in_website>
|
305 |
<show_in_store>1</show_in_store>
|
app/code/community/Ebizmarts/MageMonkey/sql/monkey_setup/mysql4-upgrade-1.1.21-1.1.22.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->getConnection()->addColumn(
|
8 |
+
$installer->getTable('magemonkey_ecommerce360'), 'store_id', 'smallint(5)'
|
9 |
+
);
|
10 |
+
|
11 |
+
$installer->run("
|
12 |
+
UPDATE `{$installer->getTable('magemonkey_ecommerce360')}` A JOIN `{$installer->getTable('sales_flat_order')}` B
|
13 |
+
ON A.order_id = B.entity_id
|
14 |
+
SET A.store_id = B.store_id
|
15 |
+
");
|
16 |
+
|
17 |
+
$installer->run("
|
18 |
+
|
19 |
+
CREATE TABLE IF NOT EXISTS `{$this->getTable('magemonkey_async_subscribers')}` (
|
20 |
+
`id` INT(10) unsigned NOT NULL auto_increment,
|
21 |
+
`email` varchar(128),
|
22 |
+
`confirm`smallint(1) default 0,
|
23 |
+
`lists` TEXT NOT NULL,
|
24 |
+
`mapfields` TEXT,
|
25 |
+
`created_at` DATETIME NOT NULL ,
|
26 |
+
`proccessed` smallint(1) default 0,
|
27 |
+
PRIMARY KEY (`id`)
|
28 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
29 |
+
|
30 |
+
CREATE TABLE IF NOT EXISTS `{$this->getTable('magemonkey_async_orders')}` (
|
31 |
+
`id` INT(10) unsigned NOT NULL auto_increment,
|
32 |
+
`info` TEXT NOT NULL,
|
33 |
+
`created_at` DATETIME NOT NULL ,
|
34 |
+
`proccessed` smallint(1) default 0,
|
35 |
+
PRIMARY KEY (`id`)
|
36 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
37 |
+
|
38 |
+
");
|
39 |
+
$installer->endSetup();
|
40 |
+
|
app/code/community/Ebizmarts/Mandrill/Block/Adminhtml/System/Config/Fieldset/Hint.php
CHANGED
@@ -12,7 +12,7 @@ class Ebizmarts_Mandrill_Block_Adminhtml_System_Config_Fieldset_Hint
|
|
12 |
extends Mage_Adminhtml_Block_Abstract
|
13 |
implements Varien_Data_Form_Element_Renderer_Interface {
|
14 |
|
15 |
-
protected $_template = 'mandrill/system/config/fieldset/hint.phtml';
|
16 |
|
17 |
/**
|
18 |
* Render fieldset html
|
12 |
extends Mage_Adminhtml_Block_Abstract
|
13 |
implements Varien_Data_Form_Element_Renderer_Interface {
|
14 |
|
15 |
+
protected $_template = 'ebizmarts/mandrill/system/config/fieldset/hint.phtml';
|
16 |
|
17 |
/**
|
18 |
* Render fieldset html
|
app/code/community/Ebizmarts/Mandrill/Block/Adminhtml/Templates/Templates.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 8/16/14
|
5 |
+
* Time : 5:18 PM
|
6 |
+
* File : Templates.php
|
7 |
+
* Module : magemonkey
|
8 |
+
*/
|
9 |
+
class Ebizmarts_Mandrill_Block_Adminhtml_Templates_Templates extends Mage_Adminhtml_Block_Widget_Grid_Container
|
10 |
+
{
|
11 |
+
|
12 |
+
public function __construct()
|
13 |
+
{
|
14 |
+
$this->_controller = 'adminhtml_templates_templates';
|
15 |
+
$this->_blockGroup = 'ebizmarts_mandrill';
|
16 |
+
$this->_headerText = Mage::helper('ebizmarts_mandrill')->__('Mandrill Templates');
|
17 |
+
|
18 |
+
parent::__construct();
|
19 |
+
|
20 |
+
// $this->removeButton('add');
|
21 |
+
|
22 |
+
}
|
23 |
+
|
24 |
+
public function getGridHtml()
|
25 |
+
{
|
26 |
+
return $this->getChildHtml('store_switcher') . $this->getChildHtml('grid');
|
27 |
+
}
|
28 |
+
|
29 |
+
public function getCreateUrl()
|
30 |
+
{
|
31 |
+
return $this->getUrl('*/*/new', array('store' => $this->getRequest()->getParam('store', 0)));
|
32 |
+
}
|
33 |
+
|
34 |
+
}
|
app/code/community/Ebizmarts/Mandrill/Block/Adminhtml/Templates/Templates/Grid.php
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 8/16/14
|
5 |
+
* Time : 5:21 PM
|
6 |
+
* File : Grid.php
|
7 |
+
* Module : magemonkey
|
8 |
+
*/
|
9 |
+
class Ebizmarts_Mandrill_Block_Adminhtml_Templates_Templates_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
10 |
+
{
|
11 |
+
|
12 |
+
public function __construct()
|
13 |
+
{
|
14 |
+
parent::__construct();
|
15 |
+
$this->setId('mandrill_templates');
|
16 |
+
$this->setUseAjax(false);
|
17 |
+
$this->setSaveParametersInSession(false);
|
18 |
+
$this->setPagerVisibility(false);
|
19 |
+
$this->setFilterVisibility(false);
|
20 |
+
}
|
21 |
+
|
22 |
+
protected function _prepareCollection()
|
23 |
+
{
|
24 |
+
// $helper = Mage::helper('ebizmarts_mandrill');
|
25 |
+
// $mail = $helper->api()->setApiKey($helper->getApiKey());
|
26 |
+
// $emails = $mail->usersSenders();
|
27 |
+
$storeId = Mage::app()->getStore()->getId();
|
28 |
+
$api = new Mandrill_Message(Mage::getStoreConfig(Ebizmarts_Mandrill_Model_System_Config::APIKEY,$storeId));
|
29 |
+
$emails = $api->users->senders();
|
30 |
+
if($emails !== FALSE){
|
31 |
+
// $_emails = array();
|
32 |
+
// foreach($emails as $email){
|
33 |
+
//
|
34 |
+
// $email = new Varien_Object((array)$email);
|
35 |
+
// $_emails []= array(
|
36 |
+
// 'email' => $email->getAddress(),
|
37 |
+
// 'sent' => $email->getSent(),
|
38 |
+
// 'rejects' => $email->getRejects(),
|
39 |
+
// 'complaints' => $email->getComplaints(),
|
40 |
+
// 'unsubs' => $email->getUnsubs(),
|
41 |
+
// 'opens' => $email->getUniqueOpens(),
|
42 |
+
// 'clicks' => $email->getUniqueClicks(),
|
43 |
+
// 'hard_bounces' => $email->getHardBounces(),
|
44 |
+
// 'soft_bounces' => $email->getSoftBounces(),
|
45 |
+
// 'created_at' => $email->getCreatedAt(),
|
46 |
+
// );
|
47 |
+
// }
|
48 |
+
$collection = Mage::getModel('ebizmarts_mandrill/customcollection', array($emails));
|
49 |
+
}else{
|
50 |
+
$collection = Mage::getModel('ebizmarts_mandrill/customcollection', array(array()));
|
51 |
+
}
|
52 |
+
|
53 |
+
$this->setCollection($collection);
|
54 |
+
return parent::_prepareCollection();
|
55 |
+
}
|
56 |
+
|
57 |
+
protected function _prepareColumns()
|
58 |
+
{
|
59 |
+
$this->addColumn('email', array(
|
60 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('Email Address'),
|
61 |
+
'index' => 'address',
|
62 |
+
'filter' => false,
|
63 |
+
'sortable' => false
|
64 |
+
));
|
65 |
+
$this->addColumn('sent', array(
|
66 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of messages sent'),
|
67 |
+
'index' => 'sent',
|
68 |
+
'filter' => false,
|
69 |
+
'sortable' => false
|
70 |
+
));
|
71 |
+
$this->addColumn('rejects', array(
|
72 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of rejected messages'),
|
73 |
+
'index' => 'rejects',
|
74 |
+
'filter' => false,
|
75 |
+
'sortable' => false
|
76 |
+
));
|
77 |
+
$this->addColumn('complaints', array(
|
78 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of spam complaints'),
|
79 |
+
'index' => 'complaints',
|
80 |
+
'filter' => false,
|
81 |
+
'sortable' => false
|
82 |
+
));
|
83 |
+
$this->addColumn('unsubs', array(
|
84 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of unsubscribe requests'),
|
85 |
+
'index' => 'unsubs',
|
86 |
+
'filter' => false,
|
87 |
+
'sortable' => false
|
88 |
+
));
|
89 |
+
$this->addColumn('opens', array(
|
90 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of unique opens'),
|
91 |
+
'index' => 'opens',
|
92 |
+
'filter' => false,
|
93 |
+
'sortable' => false
|
94 |
+
));
|
95 |
+
$this->addColumn('clicks', array(
|
96 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of times unique tracked URLs have been clicked'),
|
97 |
+
'index' => 'clicks',
|
98 |
+
'filter' => false,
|
99 |
+
'sortable' => false
|
100 |
+
));
|
101 |
+
$this->addColumn('hard_bounces', array(
|
102 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of hard bounces'),
|
103 |
+
'index' => 'hard_bounces',
|
104 |
+
'filter' => false,
|
105 |
+
'sortable' => false
|
106 |
+
));
|
107 |
+
$this->addColumn('soft_bounces', array(
|
108 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of soft bounces'),
|
109 |
+
'index' => 'soft_bounces',
|
110 |
+
'filter' => false,
|
111 |
+
'sortable' => false
|
112 |
+
));
|
113 |
+
$this->addColumn('created_at', array(
|
114 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('Created At'),
|
115 |
+
'index' => 'created_at',
|
116 |
+
'filter' => false,
|
117 |
+
'sortable' => false
|
118 |
+
));
|
119 |
+
|
120 |
+
return parent::_prepareColumns();
|
121 |
+
}
|
122 |
+
|
123 |
+
public function getRowUrl($row)
|
124 |
+
{
|
125 |
+
return false;
|
126 |
+
}
|
127 |
+
|
128 |
+
public function getGridUrl()
|
129 |
+
{
|
130 |
+
return $this->getUrl('*/*/grid', array('_current' => true));
|
131 |
+
}
|
132 |
+
}
|
app/code/community/Ebizmarts/Mandrill/Block/Adminhtml/Users/Senders.php
CHANGED
@@ -15,8 +15,8 @@ class Ebizmarts_Mandrill_Block_Adminhtml_Users_Senders extends Mage_Adminhtml_Bl
|
|
15 |
public function __construct()
|
16 |
{
|
17 |
$this->_controller = 'adminhtml_users_senders';
|
18 |
-
$this->_blockGroup = '
|
19 |
-
$this->_headerText = Mage::helper('
|
20 |
|
21 |
parent::__construct();
|
22 |
|
15 |
public function __construct()
|
16 |
{
|
17 |
$this->_controller = 'adminhtml_users_senders';
|
18 |
+
$this->_blockGroup = 'ebizmarts_mandrill';
|
19 |
+
$this->_headerText = Mage::helper('ebizmarts_mandrill')->__('Verified Email Addresses (%s)', "the senders that have tried to use this account, both verified and unverified.");
|
20 |
|
21 |
parent::__construct();
|
22 |
|
app/code/community/Ebizmarts/Mandrill/Block/Adminhtml/Users/Senders/Grid.php
CHANGED
@@ -24,31 +24,34 @@ class Ebizmarts_Mandrill_Block_Adminhtml_Users_Senders_Grid extends Mage_Adminht
|
|
24 |
|
25 |
protected function _prepareCollection()
|
26 |
{
|
27 |
-
$helper = Mage::helper('
|
28 |
-
$mail = $helper->api()->setApiKey($helper->getApiKey());
|
29 |
-
$emails = $mail->usersSenders();
|
30 |
-
|
|
|
|
|
|
|
31 |
if($emails !== FALSE){
|
32 |
-
$_emails = array();
|
33 |
-
foreach($emails as $email){
|
34 |
-
|
35 |
-
$email = new Varien_Object((array)$email);
|
36 |
-
$_emails []= array(
|
37 |
-
'email' => $email->getAddress(),
|
38 |
-
'sent' => $email->getSent(),
|
39 |
-
'rejects' => $email->getRejects(),
|
40 |
-
'complaints' => $email->getComplaints(),
|
41 |
-
'unsubs' => $email->getUnsubs(),
|
42 |
-
'opens' => $email->getUniqueOpens(),
|
43 |
-
'clicks' => $email->getUniqueClicks(),
|
44 |
-
'hard_bounces' => $email->getHardBounces(),
|
45 |
-
'soft_bounces' => $email->getSoftBounces(),
|
46 |
-
'created_at' => $email->getCreatedAt(),
|
47 |
-
);
|
48 |
-
}
|
49 |
-
$collection = Mage::getModel('
|
50 |
}else{
|
51 |
-
$collection = Mage::getModel('
|
52 |
}
|
53 |
|
54 |
$this->setCollection($collection);
|
@@ -58,61 +61,61 @@ class Ebizmarts_Mandrill_Block_Adminhtml_Users_Senders_Grid extends Mage_Adminht
|
|
58 |
protected function _prepareColumns()
|
59 |
{
|
60 |
$this->addColumn('email', array(
|
61 |
-
'header'=> Mage::helper('
|
62 |
-
'index' => '
|
63 |
'filter' => false,
|
64 |
'sortable' => false
|
65 |
));
|
66 |
$this->addColumn('sent', array(
|
67 |
-
'header'=> Mage::helper('
|
68 |
'index' => 'sent',
|
69 |
'filter' => false,
|
70 |
'sortable' => false
|
71 |
));
|
72 |
$this->addColumn('rejects', array(
|
73 |
-
'header'=> Mage::helper('
|
74 |
'index' => 'rejects',
|
75 |
'filter' => false,
|
76 |
'sortable' => false
|
77 |
));
|
78 |
$this->addColumn('complaints', array(
|
79 |
-
'header'=> Mage::helper('
|
80 |
'index' => 'complaints',
|
81 |
'filter' => false,
|
82 |
'sortable' => false
|
83 |
));
|
84 |
$this->addColumn('unsubs', array(
|
85 |
-
'header'=> Mage::helper('
|
86 |
'index' => 'unsubs',
|
87 |
'filter' => false,
|
88 |
'sortable' => false
|
89 |
));
|
90 |
$this->addColumn('opens', array(
|
91 |
-
'header'=> Mage::helper('
|
92 |
'index' => 'opens',
|
93 |
'filter' => false,
|
94 |
'sortable' => false
|
95 |
));
|
96 |
$this->addColumn('clicks', array(
|
97 |
-
'header'=> Mage::helper('
|
98 |
'index' => 'clicks',
|
99 |
'filter' => false,
|
100 |
'sortable' => false
|
101 |
));
|
102 |
$this->addColumn('hard_bounces', array(
|
103 |
-
'header'=> Mage::helper('
|
104 |
'index' => 'hard_bounces',
|
105 |
'filter' => false,
|
106 |
'sortable' => false
|
107 |
));
|
108 |
$this->addColumn('soft_bounces', array(
|
109 |
-
'header'=> Mage::helper('
|
110 |
'index' => 'soft_bounces',
|
111 |
'filter' => false,
|
112 |
'sortable' => false
|
113 |
));
|
114 |
$this->addColumn('created_at', array(
|
115 |
-
'header'=> Mage::helper('
|
116 |
'index' => 'created_at',
|
117 |
'filter' => false,
|
118 |
'sortable' => false
|
24 |
|
25 |
protected function _prepareCollection()
|
26 |
{
|
27 |
+
// $helper = Mage::helper('ebizmarts_mandrill');
|
28 |
+
// $mail = $helper->api()->setApiKey($helper->getApiKey());
|
29 |
+
// $emails = $mail->usersSenders();
|
30 |
+
$storeId = Mage::app()->getStore()->getId();
|
31 |
+
$api = new Mandrill_Message(Mage::getStoreConfig(Ebizmarts_Mandrill_Model_System_Config::APIKEY,$storeId));
|
32 |
+
$emails = $api->users->senders();
|
33 |
+
Mage::log($emails);
|
34 |
if($emails !== FALSE){
|
35 |
+
// $_emails = array();
|
36 |
+
// foreach($emails as $email){
|
37 |
+
//
|
38 |
+
// $email = new Varien_Object((array)$email);
|
39 |
+
// $_emails []= array(
|
40 |
+
// 'email' => $email->getAddress(),
|
41 |
+
// 'sent' => $email->getSent(),
|
42 |
+
// 'rejects' => $email->getRejects(),
|
43 |
+
// 'complaints' => $email->getComplaints(),
|
44 |
+
// 'unsubs' => $email->getUnsubs(),
|
45 |
+
// 'opens' => $email->getUniqueOpens(),
|
46 |
+
// 'clicks' => $email->getUniqueClicks(),
|
47 |
+
// 'hard_bounces' => $email->getHardBounces(),
|
48 |
+
// 'soft_bounces' => $email->getSoftBounces(),
|
49 |
+
// 'created_at' => $email->getCreatedAt(),
|
50 |
+
// );
|
51 |
+
// }
|
52 |
+
$collection = Mage::getModel('ebizmarts_mandrill/customcollection', array($emails));
|
53 |
}else{
|
54 |
+
$collection = Mage::getModel('ebizmarts_mandrill/customcollection', array(array()));
|
55 |
}
|
56 |
|
57 |
$this->setCollection($collection);
|
61 |
protected function _prepareColumns()
|
62 |
{
|
63 |
$this->addColumn('email', array(
|
64 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('Email Address'),
|
65 |
+
'index' => 'address',
|
66 |
'filter' => false,
|
67 |
'sortable' => false
|
68 |
));
|
69 |
$this->addColumn('sent', array(
|
70 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of messages sent'),
|
71 |
'index' => 'sent',
|
72 |
'filter' => false,
|
73 |
'sortable' => false
|
74 |
));
|
75 |
$this->addColumn('rejects', array(
|
76 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of rejected messages'),
|
77 |
'index' => 'rejects',
|
78 |
'filter' => false,
|
79 |
'sortable' => false
|
80 |
));
|
81 |
$this->addColumn('complaints', array(
|
82 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of spam complaints'),
|
83 |
'index' => 'complaints',
|
84 |
'filter' => false,
|
85 |
'sortable' => false
|
86 |
));
|
87 |
$this->addColumn('unsubs', array(
|
88 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of unsubscribe requests'),
|
89 |
'index' => 'unsubs',
|
90 |
'filter' => false,
|
91 |
'sortable' => false
|
92 |
));
|
93 |
$this->addColumn('opens', array(
|
94 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of unique opens'),
|
95 |
'index' => 'opens',
|
96 |
'filter' => false,
|
97 |
'sortable' => false
|
98 |
));
|
99 |
$this->addColumn('clicks', array(
|
100 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of times unique tracked URLs have been clicked'),
|
101 |
'index' => 'clicks',
|
102 |
'filter' => false,
|
103 |
'sortable' => false
|
104 |
));
|
105 |
$this->addColumn('hard_bounces', array(
|
106 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of hard bounces'),
|
107 |
'index' => 'hard_bounces',
|
108 |
'filter' => false,
|
109 |
'sortable' => false
|
110 |
));
|
111 |
$this->addColumn('soft_bounces', array(
|
112 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('# of soft bounces'),
|
113 |
'index' => 'soft_bounces',
|
114 |
'filter' => false,
|
115 |
'sortable' => false
|
116 |
));
|
117 |
$this->addColumn('created_at', array(
|
118 |
+
'header'=> Mage::helper('ebizmarts_mandrill')->__('Created At'),
|
119 |
'index' => 'created_at',
|
120 |
'filter' => false,
|
121 |
'sortable' => false
|
app/code/community/Ebizmarts/Mandrill/Helper/Data.php
CHANGED
@@ -25,18 +25,15 @@ class Ebizmarts_Mandrill_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
25 |
return ($active && (strlen($key)));
|
26 |
}
|
27 |
|
28 |
-
public function api() {
|
29 |
-
return new Mandrill_API();
|
30 |
-
}
|
31 |
-
|
32 |
/**
|
33 |
* Retrieves Mandrill API KEY from Magento's configuration
|
34 |
*
|
35 |
* @return string
|
36 |
*/
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
40 |
|
41 |
/**
|
42 |
* Get module User-Agent to use on API requests
|
@@ -66,4 +63,4 @@ class Ebizmarts_Mandrill_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
66 |
}
|
67 |
}
|
68 |
|
69 |
-
}
|
25 |
return ($active && (strlen($key)));
|
26 |
}
|
27 |
|
|
|
|
|
|
|
|
|
28 |
/**
|
29 |
* Retrieves Mandrill API KEY from Magento's configuration
|
30 |
*
|
31 |
* @return string
|
32 |
*/
|
33 |
+
public function getApiKey($storeId=null)
|
34 |
+
{
|
35 |
+
return Mage::getStoreConfig(Ebizmarts_Mandrill_Model_System_Config::APIKEY,$storeId);
|
36 |
+
}
|
37 |
|
38 |
/**
|
39 |
* Get module User-Agent to use on API requests
|
63 |
}
|
64 |
}
|
65 |
|
66 |
+
}
|
app/code/community/Ebizmarts/Mandrill/Model/Email/Template.php
CHANGED
@@ -1,178 +1,132 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
* @license http://opensource.org/licenses/osl-3.0.php
|
10 |
*/
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
protected $replyTo = null;
|
16 |
-
protected $_bcc = array();
|
17 |
-
|
18 |
-
public function getMail() {
|
19 |
-
|
20 |
-
//Check if should use Mandrill Transactional Email Service
|
21 |
-
if(FALSE === Mage::helper('mandrill')->useTransactionalService()){
|
22 |
-
return parent::getMail();
|
23 |
-
}
|
24 |
-
|
25 |
-
if(is_null($this->_mandrill)){
|
26 |
-
$this->_mandrill = Mage::helper('mandrill')->api();
|
27 |
-
$this->_mandrill->setApiKey(Mage::helper('mandrill')->getApiKey());
|
28 |
-
}
|
29 |
-
return $this->_mandrill;
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Add BCC emails to list to send.
|
34 |
-
*
|
35 |
-
* @return Ebizmarts_Mandrill_Model_Email_Template
|
36 |
-
*/
|
37 |
-
public function addBcc($bcc) {
|
38 |
-
$helper = Mage::helper('mandrill');
|
39 |
-
if(FALSE === $helper->useTransactionalService()){
|
40 |
-
return parent::addBcc($bcc);
|
41 |
-
}
|
42 |
-
if (is_array($bcc)) {
|
43 |
-
foreach ($bcc as $email) {
|
44 |
-
$this->_bcc[] = $email;
|
45 |
-
}
|
46 |
-
}
|
47 |
-
elseif ($bcc) {
|
48 |
-
$this->_bcc[] = $bcc;
|
49 |
-
}
|
50 |
-
return $this;
|
51 |
-
|
52 |
-
}
|
53 |
|
54 |
/**
|
55 |
-
*
|
56 |
-
*
|
57 |
-
* @param
|
58 |
-
* @
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
//Check if should use Mandrill Transactional Email Service
|
67 |
-
if(FALSE === $helper->useTransactionalService()){
|
68 |
-
return parent::send($email, $name, $variables);
|
69 |
}
|
70 |
-
|
71 |
if (!$this->isValidForSend()) {
|
72 |
Mage::logException(new Exception('This letter cannot be sent.')); // translation is intentionally omitted
|
73 |
return false;
|
74 |
}
|
75 |
-
|
76 |
-
$
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
}else{
|
82 |
-
$bccEmail = '';
|
83 |
-
}
|
84 |
-
|
85 |
-
$names = is_array($name) ? $name : (array)$name;
|
86 |
-
$names = array_values($names);
|
87 |
-
foreach ($emails as $key => $email) {
|
88 |
-
if (!isset($names[$key])) {
|
89 |
-
$names[$key] = substr($email, 0, strpos($email, '@'));
|
90 |
}
|
91 |
}
|
92 |
|
93 |
-
|
94 |
-
$
|
95 |
-
|
96 |
-
$
|
97 |
-
|
98 |
-
$this->setUseAbsoluteLinks(true);
|
99 |
-
$text = $this->getProcessedTemplate($variables, true);
|
100 |
|
101 |
-
|
102 |
|
103 |
-
|
104 |
-
'subject' => $this->getProcessedTemplateSubject($variables),
|
105 |
-
'from_name' => $this->getSenderName(),
|
106 |
-
'from_email' => $this->getSenderEmail(),
|
107 |
-
'to_email' => $emails,
|
108 |
-
'to_name' => $names,
|
109 |
-
'bcc_address' => $bccEmail,
|
110 |
-
'headers' => array('Reply-To' => $this->replyTo)
|
111 |
-
);
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
$message ['tags'] = $variables['tags'];
|
120 |
}
|
121 |
else {
|
122 |
-
$
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
} else {
|
127 |
-
if($this->getTemplateCode()){
|
128 |
-
$message ['tags'] = array(substr($this->getTemplateCode(), 0, 50));
|
129 |
-
} else {
|
130 |
-
$message ['tags'] = array(substr($templateId, 0, 50));
|
131 |
-
}
|
132 |
-
}
|
133 |
}
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
Mage::logException($e);
|
142 |
-
return false;
|
143 |
}
|
144 |
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
return parent::setReplyTo($email);
|
151 |
}
|
152 |
|
153 |
-
|
154 |
-
|
155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
|
|
163 |
|
164 |
-
|
165 |
-
|
166 |
-
|
|
|
|
|
|
|
|
|
|
|
167 |
|
168 |
}
|
169 |
|
170 |
-
|
|
|
|
|
|
|
171 |
{
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
}
|
177 |
-
|
178 |
-
}
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 8/7/14
|
5 |
+
* Time : 4:27 PM
|
6 |
+
* File : Template.php
|
7 |
+
* Module : Ebizmarts_Mandrill
|
|
|
8 |
*/
|
9 |
+
class Ebizmarts_Mandrill_Model_Email_Template extends Mage_Core_Model_Email_Template
|
10 |
+
{
|
11 |
+
// protected $_bcc = array();
|
12 |
+
protected $_mail = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
/**
|
15 |
+
* @param array|string $email
|
16 |
+
* @param null $name
|
17 |
+
* @param array $variables
|
18 |
+
* @return bool
|
19 |
+
*/
|
20 |
+
public function send($email, $name = null, array $variables = array())
|
21 |
+
{
|
22 |
+
$storeId = Mage::app()->getStore()->getId();
|
23 |
+
if(!Mage::getStoreConfig(Ebizmarts_Mandrill_Model_System_Config::ENABLE,$storeId)) {
|
24 |
+
return parent::send($email, $name,$variables);
|
|
|
|
|
|
|
|
|
25 |
}
|
|
|
26 |
if (!$this->isValidForSend()) {
|
27 |
Mage::logException(new Exception('This letter cannot be sent.')); // translation is intentionally omitted
|
28 |
return false;
|
29 |
}
|
30 |
+
$emails = array_values( (array)$email );
|
31 |
+
$names = is_array( $name ) ? $name : (array)$name;
|
32 |
+
$names = array_values( $names );
|
33 |
+
foreach ( $emails as $key => $email ) {
|
34 |
+
if ( ! isset( $names[$key] ) ) {
|
35 |
+
$names[ $key ] = substr( $email, 0, strpos( $email, '@' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
}
|
38 |
|
39 |
+
// Get message
|
40 |
+
$this->setUseAbsoluteLinks( true );
|
41 |
+
$variables['email'] = reset( $emails );
|
42 |
+
$variables['name'] = reset( $names );
|
43 |
+
$message = $this->getProcessedTemplate( $variables, true );
|
|
|
|
|
44 |
|
45 |
+
$email = array( 'subject' => $this->getProcessedTemplateSubject( $variables ), 'to' => array() );
|
46 |
|
47 |
+
$mail = $this->getMail();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
+
for ( $i = 0; $i < count( $emails ); $i++ ) {
|
50 |
+
if ( isset( $names[ $i ] ) ) {
|
51 |
+
$email['to'][] = array(
|
52 |
+
'email' => $emails[ $i ],
|
53 |
+
'name' => $names[ $i ]
|
54 |
+
);
|
|
|
55 |
}
|
56 |
else {
|
57 |
+
$email['to'][] = array(
|
58 |
+
'email' => $emails[ $i ],
|
59 |
+
'name' => ''
|
60 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
+
}
|
63 |
+
foreach($mail->getBcc() as $bcc)
|
64 |
+
{
|
65 |
+
$email['to'][] = array(
|
66 |
+
'email' => $bcc,
|
67 |
+
'type' => 'bcc'
|
68 |
+
);
|
|
|
|
|
69 |
}
|
70 |
|
71 |
+
$email['from_name'] = $this->getSenderName();
|
72 |
+
$email['from_email'] = $this->getSenderEmail();
|
73 |
+
$email['headers'] = $mail->getHeaders();
|
74 |
+
if(isset($variables['tags']) && count($variables['tags'])) {
|
75 |
+
$email ['tags'] = $variables['tags'];
|
|
|
76 |
}
|
77 |
|
78 |
+
if(isset($variables['tags']) && count($variables['tags'])) {
|
79 |
+
$email ['tags'] = $variables['tags'];
|
80 |
+
}
|
81 |
+
else {
|
82 |
+
$templateId = (string)$this->getId();
|
83 |
+
$templates = parent::getDefaultTemplates();
|
84 |
+
if (isset($templates[$templateId])) {
|
85 |
+
$email ['tags'] = array(substr($templates[$templateId]['label'], 0, 50));
|
86 |
+
} else {
|
87 |
+
if($this->getTemplateCode()){
|
88 |
+
$email ['tags'] = array(substr($this->getTemplateCode(), 0, 50));
|
89 |
+
} else {
|
90 |
+
$email ['tags'] = array(substr($templateId, 0, 50));
|
91 |
+
}
|
92 |
+
}
|
93 |
+
}
|
94 |
|
95 |
+
if($att = $mail->getAttachments()) {
|
96 |
+
$email['attachments'] = $att;
|
97 |
+
}
|
98 |
+
if( $this->isPlain() )
|
99 |
+
$email['text'] = $message;
|
100 |
+
else
|
101 |
+
$email['html'] = $message;
|
102 |
|
103 |
+
try {
|
104 |
+
$result = $mail->messages->send( $email );
|
105 |
+
}
|
106 |
+
catch( Exception $e ) {
|
107 |
+
Mage::logException( $e );
|
108 |
+
return false;
|
109 |
+
}
|
110 |
+
return true;
|
111 |
|
112 |
}
|
113 |
|
114 |
+
/**
|
115 |
+
* @return Mandrill_Message|Zend_Mail
|
116 |
+
*/
|
117 |
+
public function getMail()
|
118 |
{
|
119 |
+
$storeId = Mage::app()->getStore()->getId();
|
120 |
+
if(!Mage::getStoreConfig(Ebizmarts_Mandrill_Model_System_Config::ENABLE,$storeId)) {
|
121 |
+
return parent::getMail();
|
122 |
+
}
|
123 |
+
if($this->_mail) {
|
124 |
+
return $this->_mail;
|
125 |
+
}
|
126 |
+
else {
|
127 |
+
$storeId = Mage::app()->getStore()->getId();
|
128 |
+
$this->_mail = new Mandrill_Message(Mage::getStoreConfig( Ebizmarts_Mandrill_Model_System_Config::APIKEY,$storeId ));
|
129 |
+
return $this->_mail;
|
130 |
+
}
|
131 |
}
|
132 |
+
}
|
|
app/code/community/Ebizmarts/Mandrill/Model/System/Config.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 8/6/14
|
5 |
+
* Time : 1:32 AM
|
6 |
+
* File : Config.php
|
7 |
+
* Module : Ebizmarts_Mandrill
|
8 |
+
*/
|
9 |
+
class Ebizmarts_Mandrill_Model_System_Config
|
10 |
+
{
|
11 |
+
const ENABLE = 'mandrill/general/active';
|
12 |
+
const APIKEY = 'mandrill/general/apikey';
|
13 |
+
const ENABLE_LOG = 'mandrill/general/enable_log';
|
14 |
+
}
|
app/code/community/Ebizmarts/Mandrill/Model/System/Config/Source/Userinfo.php
CHANGED
@@ -1,52 +1,50 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
-
*
|
5 |
-
*
|
6 |
-
*
|
7 |
-
*
|
8 |
-
*
|
9 |
-
* @license http://opensource.org/licenses/osl-3.0.php
|
10 |
*/
|
11 |
-
|
12 |
class Ebizmarts_Mandrill_Model_System_Config_Source_Userinfo
|
13 |
{
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
protected $_account_details;
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
public function __construct()
|
29 |
{
|
30 |
-
|
31 |
-
|
32 |
-
$
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
}
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
public function toOptionArray()
|
44 |
{
|
45 |
-
$helper = Mage::helper('
|
46 |
-
if(
|
47 |
-
|
48 |
-
$this->_account_details = (array)$this->_account_details;
|
49 |
-
|
50 |
return array(
|
51 |
array('value' => 0, 'label' => $helper->__("<strong>Username</strong>: %s %s", $this->_account_details["username"], "<small>used for SMTP authentication</small>")),
|
52 |
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 8/6/14
|
5 |
+
* Time : 12:16 AM
|
6 |
+
* File : Userinfo.php
|
7 |
+
* Module : Ebizmarts_Mandrill
|
|
|
8 |
*/
|
|
|
9 |
class Ebizmarts_Mandrill_Model_System_Config_Source_Userinfo
|
10 |
{
|
11 |
|
12 |
+
/**
|
13 |
+
* Account details storage
|
14 |
+
*
|
15 |
+
* @access protected
|
16 |
+
* @var bool|array
|
17 |
+
*/
|
18 |
protected $_account_details;
|
19 |
|
20 |
+
/**
|
21 |
+
* Set AccountDetails on class attribute if not already set
|
22 |
+
*
|
23 |
+
* @return void
|
24 |
+
*/
|
25 |
public function __construct()
|
26 |
{
|
27 |
+
$storeId = Mage::app()->getStore()->getId();
|
28 |
+
if (!$this->_account_details&&Mage::getStoreConfig( Ebizmarts_Mandrill_Model_System_Config::APIKEY,$storeId)) {
|
29 |
+
$api = new Mandrill_Message(Mage::getStoreConfig( Ebizmarts_Mandrill_Model_System_Config::APIKEY,$storeId));
|
30 |
+
try {
|
31 |
+
$this->_account_details = $api->users->info();
|
32 |
+
}
|
33 |
+
catch(Exception $e) {
|
34 |
+
$this->_account_details = "Invalid API key";
|
35 |
+
}
|
36 |
}
|
37 |
}
|
38 |
|
39 |
+
/**
|
40 |
+
* Return data if API key is entered
|
41 |
+
*
|
42 |
+
* @return array
|
43 |
+
*/
|
44 |
public function toOptionArray()
|
45 |
{
|
46 |
+
$helper = Mage::helper('ebizmarts_mandrill');
|
47 |
+
if(is_array($this->_account_details)){
|
|
|
|
|
|
|
48 |
return array(
|
49 |
array('value' => 0, 'label' => $helper->__("<strong>Username</strong>: %s %s", $this->_account_details["username"], "<small>used for SMTP authentication</small>")),
|
50 |
|
app/code/community/Ebizmarts/Mandrill/etc/adminhtml.xml
CHANGED
@@ -3,19 +3,19 @@
|
|
3 |
<menu>
|
4 |
<system>
|
5 |
<children>
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
</children>
|
20 |
</system>
|
21 |
<newsletter>
|
@@ -27,24 +27,25 @@
|
|
27 |
</ebizmarts_mandrill>
|
28 |
</children>
|
29 |
</newsletter>
|
|
|
30 |
</menu>
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
</config>
|
3 |
<menu>
|
4 |
<system>
|
5 |
<children>
|
6 |
+
<email_template>
|
7 |
+
<children>
|
8 |
+
<mandrill translate="title" module="ebizmarts_mandrill">
|
9 |
+
<title>Mandrill</title>
|
10 |
+
<children>
|
11 |
+
<users_senders translate="title" module="ebizmarts_mandrill">
|
12 |
+
<title>Senders</title>
|
13 |
+
<action>adminhtml/mandrill_users/senders</action>
|
14 |
+
</users_senders>
|
15 |
+
</children>
|
16 |
+
</mandrill>
|
17 |
+
</children>
|
18 |
+
</email_template>
|
19 |
</children>
|
20 |
</system>
|
21 |
<newsletter>
|
27 |
</ebizmarts_mandrill>
|
28 |
</children>
|
29 |
</newsletter>
|
30 |
+
|
31 |
</menu>
|
32 |
+
<acl>
|
33 |
+
<resources>
|
34 |
+
<admin>
|
35 |
+
<children>
|
36 |
+
<system>
|
37 |
+
<children>
|
38 |
+
<config>
|
39 |
+
<children>
|
40 |
+
<mandrill translate="title" module="ebizmarts_mandrill">
|
41 |
+
<title>Mandrill Configuration</title>
|
42 |
+
</mandrill>
|
43 |
+
</children>
|
44 |
+
</config>
|
45 |
+
</children>
|
46 |
+
</system>
|
47 |
+
</children>
|
48 |
+
</admin>
|
49 |
+
</resources>
|
50 |
+
</acl>
|
51 |
</config>
|
app/code/community/Ebizmarts/Mandrill/etc/config.xml
CHANGED
@@ -1,23 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
Configuration file for Ebizmarts_Mandrill module, touch at you entire responsibility
|
4 |
-
|
5 |
-
@category Ebizmarts
|
6 |
-
@package Ebizmarts_Mandrill
|
7 |
-
@author Ebizmarts Team <info@ebizmarts.com>
|
8 |
-
@license http://opensource.org/licenses/osl-3.0.php
|
9 |
-
-->
|
10 |
<config>
|
11 |
<modules>
|
12 |
<Ebizmarts_Mandrill>
|
13 |
-
|
14 |
</Ebizmarts_Mandrill>
|
15 |
</modules>
|
16 |
<global>
|
17 |
<models>
|
18 |
-
<
|
19 |
<class>Ebizmarts_Mandrill_Model</class>
|
20 |
-
|
|
|
|
|
|
|
|
|
21 |
<core>
|
22 |
<rewrite>
|
23 |
<email_template>Ebizmarts_Mandrill_Model_Email_Template</email_template>
|
@@ -25,15 +21,16 @@
|
|
25 |
</core>
|
26 |
</models>
|
27 |
<blocks>
|
28 |
-
<
|
29 |
<class>Ebizmarts_Mandrill_Block</class>
|
30 |
-
</
|
31 |
</blocks>
|
32 |
<helpers>
|
33 |
-
<
|
34 |
<class>Ebizmarts_Mandrill_Helper</class>
|
35 |
-
</
|
36 |
</helpers>
|
|
|
37 |
</global>
|
38 |
<frontend>
|
39 |
<translate>
|
@@ -48,23 +45,23 @@
|
|
48 |
</frontend>
|
49 |
<admin>
|
50 |
<routers>
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
</routers>
|
59 |
</admin>
|
60 |
<adminhtml>
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
<translate>
|
69 |
<modules>
|
70 |
<Ebizmarts_Mandrill>
|
@@ -76,10 +73,10 @@
|
|
76 |
</translate>
|
77 |
</adminhtml>
|
78 |
<default>
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
</default>
|
85 |
-
</config>
|
1 |
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Ebizmarts_Mandrill>
|
5 |
+
<version>2.0.0</version>
|
6 |
</Ebizmarts_Mandrill>
|
7 |
</modules>
|
8 |
<global>
|
9 |
<models>
|
10 |
+
<ebizmarts_mandrill>
|
11 |
<class>Ebizmarts_Mandrill_Model</class>
|
12 |
+
<resourceModel>ebizmarts_mandrill_resource</resourceModel>
|
13 |
+
</ebizmarts_mandrill>
|
14 |
+
<ebizmarts_mandrill_resource>
|
15 |
+
<class>Ebizmarts_Mandrill_Model_Resource</class>
|
16 |
+
</ebizmarts_mandrill_resource>
|
17 |
<core>
|
18 |
<rewrite>
|
19 |
<email_template>Ebizmarts_Mandrill_Model_Email_Template</email_template>
|
21 |
</core>
|
22 |
</models>
|
23 |
<blocks>
|
24 |
+
<ebizmarts_mandrill>
|
25 |
<class>Ebizmarts_Mandrill_Block</class>
|
26 |
+
</ebizmarts_mandrill>
|
27 |
</blocks>
|
28 |
<helpers>
|
29 |
+
<ebizmarts_mandrill>
|
30 |
<class>Ebizmarts_Mandrill_Helper</class>
|
31 |
+
</ebizmarts_mandrill>
|
32 |
</helpers>
|
33 |
+
|
34 |
</global>
|
35 |
<frontend>
|
36 |
<translate>
|
45 |
</frontend>
|
46 |
<admin>
|
47 |
<routers>
|
48 |
+
<adminhtml>
|
49 |
+
<args>
|
50 |
+
<modules>
|
51 |
+
<mandrill before="Mage_Adminhtml">Ebizmarts_Mandrill_Adminhtml</mandrill>
|
52 |
+
</modules>
|
53 |
+
</args>
|
54 |
+
</adminhtml>
|
55 |
</routers>
|
56 |
</admin>
|
57 |
<adminhtml>
|
58 |
+
<layout>
|
59 |
+
<updates>
|
60 |
+
<mandrill>
|
61 |
+
<file>ebizmarts/mandrill.xml</file>
|
62 |
+
</mandrill>
|
63 |
+
</updates>
|
64 |
+
</layout>
|
65 |
<translate>
|
66 |
<modules>
|
67 |
<Ebizmarts_Mandrill>
|
73 |
</translate>
|
74 |
</adminhtml>
|
75 |
<default>
|
76 |
+
<mandrill>
|
77 |
+
<general>
|
78 |
+
<active>0</active>
|
79 |
+
</general>
|
80 |
+
</mandrill>
|
81 |
</default>
|
82 |
+
</config>
|
app/code/community/Ebizmarts/Mandrill/etc/system.xml
CHANGED
@@ -1,15 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
Configuration file for Ebizmarts_Mandrill module, touch at you entire responsibility
|
4 |
-
|
5 |
-
@category Ebizmarts
|
6 |
-
@package Ebizmarts_Mandrill
|
7 |
-
@author Ebizmarts Team <info@ebizmarts.com>
|
8 |
-
@license http://opensource.org/licenses/osl-3.0.php
|
9 |
-
-->
|
10 |
<config>
|
11 |
<sections>
|
12 |
-
<mandrill translate="label" module="
|
13 |
<label><![CDATA[Mandrill]]></label>
|
14 |
<class>mandrill-section separator-top</class>
|
15 |
<header_css>mandrill-header</header_css>
|
@@ -20,7 +12,7 @@
|
|
20 |
<show_in_store>1</show_in_store>
|
21 |
<groups>
|
22 |
<hint>
|
23 |
-
<frontend_model>
|
24 |
<sort_order>0</sort_order>
|
25 |
<show_in_default>1</show_in_default>
|
26 |
<show_in_website>1</show_in_website>
|
@@ -52,6 +44,9 @@
|
|
52 |
<show_in_website>1</show_in_website>
|
53 |
<show_in_store>1</show_in_store>
|
54 |
<comment><![CDATA[Your API Key]]></comment>
|
|
|
|
|
|
|
55 |
</apikey>
|
56 |
<enable_log translate="label comment">
|
57 |
<label>Enable Log</label>
|
@@ -62,16 +57,22 @@
|
|
62 |
<show_in_website>0</show_in_website>
|
63 |
<show_in_store>1</show_in_store>
|
64 |
<comment>File is {{base_dir}}/var/log/Ebizmarts_Mandrill.log</comment>
|
|
|
|
|
|
|
65 |
</enable_log>
|
66 |
<user_info translate="label comment">
|
67 |
<label>Account Info</label>
|
68 |
-
<frontend_model>
|
69 |
-
<source_model>
|
70 |
<sort_order>40</sort_order>
|
71 |
<show_in_default>1</show_in_default>
|
72 |
<show_in_website>1</show_in_website>
|
73 |
<show_in_store>1</show_in_store>
|
74 |
<comment><![CDATA[]]></comment>
|
|
|
|
|
|
|
75 |
</user_info>
|
76 |
</fields>
|
77 |
</general>
|
1 |
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<config>
|
3 |
<sections>
|
4 |
+
<mandrill translate="label" module="ebizmarts_mandrill">
|
5 |
<label><![CDATA[Mandrill]]></label>
|
6 |
<class>mandrill-section separator-top</class>
|
7 |
<header_css>mandrill-header</header_css>
|
12 |
<show_in_store>1</show_in_store>
|
13 |
<groups>
|
14 |
<hint>
|
15 |
+
<frontend_model>ebizmarts_mandrill/adminhtml_system_config_fieldset_hint</frontend_model>
|
16 |
<sort_order>0</sort_order>
|
17 |
<show_in_default>1</show_in_default>
|
18 |
<show_in_website>1</show_in_website>
|
44 |
<show_in_website>1</show_in_website>
|
45 |
<show_in_store>1</show_in_store>
|
46 |
<comment><![CDATA[Your API Key]]></comment>
|
47 |
+
<depends>
|
48 |
+
<active>1</active>
|
49 |
+
</depends>
|
50 |
</apikey>
|
51 |
<enable_log translate="label comment">
|
52 |
<label>Enable Log</label>
|
57 |
<show_in_website>0</show_in_website>
|
58 |
<show_in_store>1</show_in_store>
|
59 |
<comment>File is {{base_dir}}/var/log/Ebizmarts_Mandrill.log</comment>
|
60 |
+
<depends>
|
61 |
+
<active>1</active>
|
62 |
+
</depends>
|
63 |
</enable_log>
|
64 |
<user_info translate="label comment">
|
65 |
<label>Account Info</label>
|
66 |
+
<frontend_model>ebizmarts_mandrill/adminhtml_system_config_userinfo</frontend_model>
|
67 |
+
<source_model>ebizmarts_mandrill/system_config_source_userinfo</source_model>
|
68 |
<sort_order>40</sort_order>
|
69 |
<show_in_default>1</show_in_default>
|
70 |
<show_in_website>1</show_in_website>
|
71 |
<show_in_store>1</show_in_store>
|
72 |
<comment><![CDATA[]]></comment>
|
73 |
+
<depends>
|
74 |
+
<active>1</active>
|
75 |
+
</depends>
|
76 |
</user_info>
|
77 |
</fields>
|
78 |
</general>
|
app/design/adminhtml/default/default/layout/ebizmarts/mandrill.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout>
|
3 |
+
<adminhtml_system_config_edit>
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addCss"><stylesheet>ebizmarts/mandrill/mandrill.css</stylesheet></action>
|
6 |
+
</reference>
|
7 |
+
</adminhtml_system_config_edit>
|
8 |
+
|
9 |
+
<adminhtml_mandrill_users_senders>
|
10 |
+
<reference name="content">
|
11 |
+
<block type="ebizmarts_mandrill/adminhtml_users_senders" name="mc_transactionalemail_mandrill">
|
12 |
+
<block type="adminhtml/store_switcher" name="store_switcher" as="store_switcher">
|
13 |
+
<action method="setUseConfirm"><params>0</params></action>
|
14 |
+
</block>
|
15 |
+
</block>
|
16 |
+
</reference>
|
17 |
+
</adminhtml_mandrill_users_senders>
|
18 |
+
</layout>
|
app/design/adminhtml/default/default/layout/mandrill.xml
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<layout>
|
3 |
-
<adminhtml_system_config_edit>
|
4 |
-
<reference name="head">
|
5 |
-
<action method="addCss"><stylesheet>mandrill/mandrill.css</stylesheet></action>
|
6 |
-
</reference>
|
7 |
-
</adminhtml_system_config_edit>
|
8 |
-
|
9 |
-
<adminhtml_mandrill_users_senders>
|
10 |
-
<reference name="content">
|
11 |
-
<block type="mandrill/adminhtml_users_senders" name="mc_transactionalemail_mandrill">
|
12 |
-
<block type="adminhtml/store_switcher" name="store_switcher" as="store_switcher">
|
13 |
-
<action method="setUseConfirm"><params>0</params></action>
|
14 |
-
</block>
|
15 |
-
</block>
|
16 |
-
</reference>
|
17 |
-
</adminhtml_mandrill_users_senders>
|
18 |
-
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/template/ebizmarts/abandonedcart/dashboard/totalbar.phtml
CHANGED
@@ -35,7 +35,7 @@
|
|
35 |
extension to 1.0.5 or up and configure <a class="action-link-holder" href="http://mandrill.com/signup/?pid=ebizmart&source=website" target="_blank">Mandrill</a> is free
|
36 |
</div>
|
37 |
<?php else: ?>
|
38 |
-
<?php if(!Mage::helper('
|
39 |
<div class="warning-msg">
|
40 |
You may obtain more statistics if enable and configure <a class="action-link-holder" href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/system_config/edit/section/mandrill"); ?>" >Mandrill</a> extension
|
41 |
</div>
|
35 |
extension to 1.0.5 or up and configure <a class="action-link-holder" href="http://mandrill.com/signup/?pid=ebizmart&source=website" target="_blank">Mandrill</a> is free
|
36 |
</div>
|
37 |
<?php else: ?>
|
38 |
+
<?php if(!Mage::helper('ebizmarts_mandrill')->useTransactionalService()): ?>
|
39 |
<div class="warning-msg">
|
40 |
You may obtain more statistics if enable and configure <a class="action-link-holder" href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/system_config/edit/section/mandrill"); ?>" >Mandrill</a> extension
|
41 |
</div>
|
app/design/adminhtml/default/default/template/ebizmarts/abandonedcart/system/config/fieldset/hint.phtml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<h4>
|
3 |
<img src="http://ebizmarts.com/extension-logo.php?<?php echo $this->getPxParams(); ?>" /><br>
|
4 |
<?php echo Mage::helper('ebizmarts_abandonedcart')->__('<strong style="color:#EA7601;">Ebizmarts Abandoned Cart v%s</strong> <br>Need help? See our <a href="http://wiki.ebizmarts.com/abandoned-carts/" target="_blank">Wiki</a> or browse our <a href="http://ebizmarts.com/forums/view/1" target="_blank">support forums</a> Got feedback? <a href="mailto:info@ebizmarts.com?Subject=Support Abandoned Cart Version %s">Email us</a>', $this->getVersion(),$this->getVersion())?>
|
5 |
-
<?php if(!Mage::helper('
|
6 |
<div class="box error-msg" style="padding-left: 30px;">
|
7 |
You must setup <a class="action-link-holder" href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/system_config/edit/section/mandrill"); ?>" >Mandrill</a> extension to use this extension
|
8 |
</div>
|
2 |
<h4>
|
3 |
<img src="http://ebizmarts.com/extension-logo.php?<?php echo $this->getPxParams(); ?>" /><br>
|
4 |
<?php echo Mage::helper('ebizmarts_abandonedcart')->__('<strong style="color:#EA7601;">Ebizmarts Abandoned Cart v%s</strong> <br>Need help? See our <a href="http://wiki.ebizmarts.com/abandoned-carts/" target="_blank">Wiki</a> or browse our <a href="http://ebizmarts.com/forums/view/1" target="_blank">support forums</a> Got feedback? <a href="mailto:info@ebizmarts.com?Subject=Support Abandoned Cart Version %s">Email us</a>', $this->getVersion(),$this->getVersion())?>
|
5 |
+
<?php if(!Mage::helper('ebizmarts_mandrill')->useTransactionalService()): ?>
|
6 |
<div class="box error-msg" style="padding-left: 30px;">
|
7 |
You must setup <a class="action-link-holder" href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/system_config/edit/section/mandrill"); ?>" >Mandrill</a> extension to use this extension
|
8 |
</div>
|
app/design/adminhtml/default/default/template/ebizmarts/autoresponder/system/config/fieldset/hint.phtml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<img src="http://ebizmarts.com/extension-logo.php?<?php echo $this->getPxParams(); ?>" /><br>
|
4 |
<?php echo Mage::helper('ebizmarts_autoresponder')->__('<strong style="color:#EA7601;">Ebizmarts Autoresponder v%s</strong> <br>Need help? See our <a href="http://wiki.ebizmarts.com/configuration" target="_blank">Wiki</a> or browse our <a href="http://ebizmarts.com/forums/view/1" target="_blank">support forums</a> Got feedback? <a href="mailto:info@ebizmarts.com?Subject=Support Autoresponder Version %s">Email us</a>', $this->getVersion(),$this->getVersion())?>
|
5 |
|
6 |
-
<?php if(!Mage::helper('
|
7 |
<div class="box error-msg" style="padding-left: 30px;">
|
8 |
You must setup <a class="action-link-holder" href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/system_config/edit/section/mandrill"); ?>" >Mandrill</a> extension to use this extension
|
9 |
</div>
|
3 |
<img src="http://ebizmarts.com/extension-logo.php?<?php echo $this->getPxParams(); ?>" /><br>
|
4 |
<?php echo Mage::helper('ebizmarts_autoresponder')->__('<strong style="color:#EA7601;">Ebizmarts Autoresponder v%s</strong> <br>Need help? See our <a href="http://wiki.ebizmarts.com/configuration" target="_blank">Wiki</a> or browse our <a href="http://ebizmarts.com/forums/view/1" target="_blank">support forums</a> Got feedback? <a href="mailto:info@ebizmarts.com?Subject=Support Autoresponder Version %s">Email us</a>', $this->getVersion(),$this->getVersion())?>
|
5 |
|
6 |
+
<?php if(!Mage::helper('ebizmarts_mandrill')->useTransactionalService()): ?>
|
7 |
<div class="box error-msg" style="padding-left: 30px;">
|
8 |
You must setup <a class="action-link-holder" href="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/system_config/edit/section/mandrill"); ?>" >Mandrill</a> extension to use this extension
|
9 |
</div>
|
app/design/adminhtml/default/default/template/{mandrill → ebizmarts/mandrill}/system/config/fieldset/hint.phtml
RENAMED
File without changes
|
app/design/adminhtml/default/default/template/magemonkey/system/config/resetlocal360.phtml
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script type="text/javascript">
|
2 |
+
//<![CDATA[
|
3 |
+
function check() {
|
4 |
+
new Ajax.Request('<?php echo $this->getAjaxCheckUrl() ?>', {
|
5 |
+
method: 'get',
|
6 |
+
onSuccess: function(transport){
|
7 |
+
|
8 |
+
if (transport.responseText == 1){
|
9 |
+
alert('All local orders for Ecommerce360 was deleted')
|
10 |
+
}
|
11 |
+
else {
|
12 |
+
alert('En error happens deleting local orders in Ecommerce360')
|
13 |
+
}
|
14 |
+
}
|
15 |
+
});
|
16 |
+
}
|
17 |
+
function reloadGroups(evt) {
|
18 |
+
var $list = $('monkey_general_list').getValue();
|
19 |
+
$url = "<?php echo Mage::helper('adminhtml')->getUrl('monkey/adminhtml_config/getGroups') ?>"+"list/"+$list;
|
20 |
+
new Ajax.Request($url, {
|
21 |
+
method: 'get',
|
22 |
+
onSuccess: function (transport) {
|
23 |
+
$el = $('monkey_general_cutomergroup');
|
24 |
+
while($el.firstChild) {
|
25 |
+
$el.removeChild($el.firstChild)
|
26 |
+
}
|
27 |
+
if(transport.responseJSON.length==0) {
|
28 |
+
opt = document.createElement('option');
|
29 |
+
opt.text = '--- No data ---';
|
30 |
+
opt.value = -1;
|
31 |
+
$el.options.add(opt);
|
32 |
+
}
|
33 |
+
else {
|
34 |
+
transport.responseJSON.each(function(i) {
|
35 |
+
opt = document.createElement('option');
|
36 |
+
opt.text = i.label;
|
37 |
+
opt.value = i.value;
|
38 |
+
if(i.style) {
|
39 |
+
opt.style = i.style;
|
40 |
+
}
|
41 |
+
if(i.disabled)
|
42 |
+
{
|
43 |
+
opt.disabled = 1;
|
44 |
+
}
|
45 |
+
opt.selected = i.selected;
|
46 |
+
$el.options.add(opt);
|
47 |
+
}
|
48 |
+
);
|
49 |
+
}
|
50 |
+
}
|
51 |
+
});
|
52 |
+
}
|
53 |
+
document.observe("dom:loaded", function() {
|
54 |
+
if($('monkey_general_list')) {
|
55 |
+
Element.observe('monkey_general_list','change',reloadGroups);
|
56 |
+
Element.observe(window,'load',reloadGroups);
|
57 |
+
}
|
58 |
+
});
|
59 |
+
//]]>
|
60 |
+
</script>
|
61 |
+
|
62 |
+
<?php echo $this->getButtonHtml() ?>
|
app/design/adminhtml/default/default/template/magemonkey/system/config/resetremote360.phtml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script type="text/javascript">
|
2 |
+
//<![CDATA[
|
3 |
+
function check() {
|
4 |
+
new Ajax.Request('<?php echo $this->getAjaxCheckUrl() ?>', {
|
5 |
+
method: 'get',
|
6 |
+
onSuccess: function(transport){
|
7 |
+
|
8 |
+
if (transport.responseText == 1){
|
9 |
+
alert('All remote orders for Ecommerce360 was deleted')
|
10 |
+
}
|
11 |
+
else {
|
12 |
+
alert('En error happens deleting remote orders in Ecommerce360')
|
13 |
+
}
|
14 |
+
}
|
15 |
+
});
|
16 |
+
}
|
17 |
+
//]]>
|
18 |
+
</script>
|
19 |
+
|
20 |
+
<?php echo $this->getButtonHtml() ?>
|
app/design/adminhtml/default/default/template/mandrill/.DS_Store
DELETED
Binary file
|
app/design/adminhtml/default/default/template/mandrill/system/.DS_Store
DELETED
Binary file
|
app/design/adminhtml/default/default/template/mandrill/system/config/.DS_Store
DELETED
Binary file
|
app/design/frontend/base/default/layout/ebizmarts/autoresponder.xml
CHANGED
@@ -29,7 +29,7 @@
|
|
29 |
</customer_account>
|
30 |
<catalog_product_view>
|
31 |
<reference name="head">
|
32 |
-
<action method="addJs"><script>ebizmarts/autoresponders/visitedproducts.js</script></action>
|
33 |
</reference>
|
34 |
</catalog_product_view>
|
35 |
<!--review_product_list>
|
29 |
</customer_account>
|
30 |
<catalog_product_view>
|
31 |
<reference name="head">
|
32 |
+
<action method="addJs" ifconfig="ebizmarts_autoresponder/visitedproducts/active"><script>ebizmarts/autoresponders/visitedproducts.js</script></action>
|
33 |
</reference>
|
34 |
</catalog_product_view>
|
35 |
<!--review_product_list>
|
app/design/frontend/base/default/template/ebizmarts_abandonedcart/email/order/items.phtml
CHANGED
@@ -4,6 +4,7 @@
|
|
4 |
<tr>
|
5 |
<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Item') ?></th>
|
6 |
<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Sku') ?></th>
|
|
|
7 |
<th align="center" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Qty') ?></th>
|
8 |
<th align="right" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Subtotal') ?></th>
|
9 |
</tr>
|
@@ -57,11 +58,13 @@
|
|
57 |
endif; ?>
|
58 |
<tbody<?php echo $i%2 ? ' bgcolor="#F6F6F6"' : '' ?>>
|
59 |
<tr>
|
60 |
-
<?php echo '<td valign="top" align="left" style="padding:3px 9px">'. $_item['name']
|
|
|
61 |
<?php echo '<td valign="top" align="left" style="padding:3px 9px">'. $_item['sku'] .'</td>'; ?>
|
|
|
62 |
<?php echo '<td valign="top" align="center" style="padding:3px 9px">'. $_item['qty'] .'</td>'; ?>
|
63 |
<?php echo '<td valign="top" align="right" style="padding:3px 9px">' . $this->getTax($_item) .'</td>'; ?>
|
64 |
-
|
65 |
</tr>
|
66 |
</tbody>
|
67 |
<?php endforeach; ?>
|
4 |
<tr>
|
5 |
<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Item') ?></th>
|
6 |
<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Sku') ?></th>
|
7 |
+
<th align="center" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Image') ?></th>
|
8 |
<th align="center" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Qty') ?></th>
|
9 |
<th align="right" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Subtotal') ?></th>
|
10 |
</tr>
|
58 |
endif; ?>
|
59 |
<tbody<?php echo $i%2 ? ' bgcolor="#F6F6F6"' : '' ?>>
|
60 |
<tr>
|
61 |
+
<?php echo '<td valign="top" align="left" style="padding:3px 9px">'. $_item['name']; ?>
|
62 |
+
<?php if(isset($options) && is_array($options)) : foreach($options as $option) : echo '<br /><strong><em>'.$option['label'].'</em></strong> '.$option['value']; if(isset($option['sku'])) : echo ' ' . $option['sku']; endif; endforeach; $options = null; endif; ?>
|
63 |
<?php echo '<td valign="top" align="left" style="padding:3px 9px">'. $_item['sku'] .'</td>'; ?>
|
64 |
+
<?php echo '<td valign="top" align="left" style="padding:3px 9px"><img src="'.$this->getImage($_item).'"/></td>'; ?>
|
65 |
<?php echo '<td valign="top" align="center" style="padding:3px 9px">'. $_item['qty'] .'</td>'; ?>
|
66 |
<?php echo '<td valign="top" align="right" style="padding:3px 9px">' . $this->getTax($_item) .'</td>'; ?>
|
67 |
+
|
68 |
</tr>
|
69 |
</tbody>
|
70 |
<?php endforeach; ?>
|
app/design/frontend/base/default/template/magemonkey/checkout/subscribe.phtml
CHANGED
@@ -1,176 +1,209 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
7 |
?>
|
8 |
<script type="text/javascript">
|
9 |
-
addSubscribeToPost = function (element){
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
var listValue = new Element('input', { name: element.readAttribute('name'), id: "subscribe", value: element.getValue(), type: "hidden" });
|
18 |
-
try{
|
19 |
-
Element.insert(Form.findFirstElement(payment.form), inputer);
|
20 |
-
Element.insert(Form.findFirstElement(payment.form), listValue);
|
21 |
-
}catch(notelem){
|
22 |
-
$("co-payment-form").insert(inputer);
|
23 |
-
$("co-payment-form").insert(listValue);
|
24 |
}
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
addGroupToPost = function (element){
|
29 |
-
if(element.checked){
|
30 |
-
try{
|
31 |
-
var group = new Element('input', { name: element.readAttribute('name'), id: element.readAttribute('id'), value: element.getValue(), checked:true, type: "checkbox" });
|
32 |
-
Element.insert(Form.findFirstElement(payment.form), group);
|
33 |
-
}catch(notelem){
|
34 |
-
$("co-payment-form").insert(group);
|
35 |
}
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
-
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
-
|
47 |
|
48 |
-
|
49 |
|
50 |
-
}
|
51 |
</script>
|
52 |
<div class="buttons-set"<?php if($check === 3): ?> style="display:none;"<?php endif;?>>
|
53 |
-
<!-- General Subscription -->
|
54 |
-
<div class="page-title">
|
55 |
-
|
56 |
-
</div>
|
57 |
-
<?php echo $this->getBlockHtml('formkey'); ?>
|
58 |
-
<ul class="monkey-additional-lists">
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
</ul>
|
76 |
-
<!-- General Subscription -->
|
77 |
-
|
78 |
-
<!-- Additional Lists -->
|
79 |
-
<div class="monkey-multisubscribe">
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
</div>
|
108 |
-
<!-- Additional Lists -->
|
109 |
</div>
|
110 |
<?php
|
111 |
//Check if there's additional list selected, if not Dont show this section
|
112 |
if(count($lists) > 0):
|
113 |
-
|
114 |
endif;
|
115 |
?>
|
116 |
|
117 |
<script type="text/javascript">
|
118 |
-
//Handle newsletter subscribe/unsubscribe checkbox events
|
119 |
-
$$('input.monkey-list-subscriber').each(function(chk){
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
});
|
142 |
-
|
143 |
-
addSubscribeToPost($('magemonkey-trigger'));
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
</script>
|
1 |
<?php
|
2 |
+
$lists = $this->getLists();
|
3 |
+
$check = $this->checkStatus();
|
4 |
+
$myLists = $this->getSubscribedLists();
|
5 |
+
$generalList = $this->getGeneralList();
|
6 |
+
$auto = (($check === 1) or ($check === 3) or ($check === 4));
|
7 |
+
$force = $this->getForce();
|
8 |
?>
|
9 |
<script type="text/javascript">
|
10 |
+
addSubscribeToPost = function (element){
|
11 |
+
|
12 |
+
//save old clicked lists and then removes element
|
13 |
+
var subscribeValue = '';
|
14 |
+
if($('magemonkey-subscribe')){
|
15 |
+
var checkedLists = $('magemonkey-subscribe').getValue();
|
16 |
+
subscribeValue = checkedLists+',';
|
17 |
+
$('magemonkey-subscribe').remove();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
+
var id = "subscribe-"+element.readAttribute('value');
|
20 |
+
if($(id)) {
|
21 |
+
$(id).remove();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
+
//if checked add this element else remove it
|
24 |
+
if(element.checked){
|
25 |
+
var inputer = new Element('input', { name: "magemonkey_subscribe", id: "magemonkey-subscribe", value: subscribeValue+element.readAttribute('value'), type: "hidden" });
|
26 |
+
var listValue = new Element('input', { name: element.readAttribute('name'), id: "subscribe-"+element.readAttribute('value'), value: element.readAttribute('value'), type: "hidden" });
|
27 |
+
var force = new Element('input', { name: "magemonkey_force", id: "magemonkey-force", value: "1", type: "hidden" });
|
28 |
+
try{
|
29 |
+
Element.insert(Form.findFirstElement(payment.form), inputer);
|
30 |
+
Element.insert(Form.findFirstElement(payment.form), listValue);
|
31 |
+
<?php if($force): ?>
|
32 |
+
Element.insert(Form.findFirstElement(payment.form), force);
|
33 |
+
<?php endif; ?>
|
34 |
+
}catch(notelem){
|
35 |
+
$("co-payment-form").insert(inputer);
|
36 |
+
$("co-payment-form").insert(listValue);
|
37 |
+
}
|
38 |
+
}else{
|
39 |
+
var arrCheckedLists = checkedLists.split(',');
|
40 |
+
var pos = jQuery.inArray(element.readAttribute('value'), arrCheckedLists);
|
41 |
+
if(pos != -1) {
|
42 |
+
arrCheckedLists.splice(pos, 1);
|
43 |
+
checkedLists = arrCheckedLists.join(',');
|
44 |
+
var inputer = new Element('input', { name: "magemonkey_subscribe", id: "magemonkey-subscribe", value: checkedLists, type: "hidden" });
|
45 |
+
try{
|
46 |
+
Element.insert(Form.findFirstElement(payment.form), inputer);
|
47 |
+
}catch(notelem){
|
48 |
+
$("co-payment-form").insert(inputer);
|
49 |
+
}
|
50 |
+
}
|
51 |
|
52 |
+
}
|
53 |
+
|
54 |
+
}
|
55 |
+
addGroupToPost = function (element){
|
56 |
+
if(element.checked){
|
57 |
|
58 |
+
try{
|
59 |
+
var group = new Element('input', { name: element.readAttribute('name'), id: element.readAttribute('id'), value: element.getValue(), checked:true, type: "checkbox" });
|
60 |
+
Element.insert(Form.findFirstElement(payment.form), group);
|
61 |
+
}catch(notelem){
|
62 |
+
$("co-payment-form").insert(group);
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
66 |
+
addElementToPost = function (element){
|
67 |
+
var formInputId = element.readAttribute('id') + '-serialize';
|
68 |
+
if($(formInputId)){
|
69 |
+
$(formInputId).remove();
|
70 |
+
}
|
71 |
|
72 |
+
var inp = new Element('input', { name: element.readAttribute('name'), id: formInputId, value: element.getValue(), type: "hidden" });
|
73 |
|
74 |
+
Element.insert( Form.findFirstElement(payment.form), inp);
|
75 |
|
76 |
+
}
|
77 |
</script>
|
78 |
<div class="buttons-set"<?php if($check === 3): ?> style="display:none;"<?php endif;?>>
|
79 |
+
<!-- General Subscription -->
|
80 |
+
<div class="page-title">
|
81 |
+
<h1><?php echo $this->__('Newsletter Subscription'); ?></h1>
|
82 |
+
</div>
|
83 |
+
<?php echo $this->getBlockHtml('formkey'); ?>
|
84 |
+
<ul class="monkey-additional-lists">
|
85 |
+
<li class="listdata"><?php echo $generalList['name']; ?>
|
86 |
+
<input<?php if($auto): ?> checked="checked"<?php endif;?> type="checkbox" onchange="addSubscribeToPost(this);" name="list[<?php echo $generalList['id'] ?>][subscribed]" id="magemonkey-trigger" value="<?php echo $generalList['id']; ?>" title="<?php echo $generalList['name']; ?>" class="monkey-list-subscriber" />
|
87 |
+
<?php if(is_array($generalList['interest_groupings']) && $this->getCanModify() == 1): ?>
|
88 |
+
<div id="interest_groupings_<?php echo $generalList['id']; ?>" class="interest-groupings">
|
89 |
+
<?php foreach($generalList['interest_groupings'] as $group): ?>
|
90 |
+
<?php if($group['name'] != 'MAGE_CUSTOMER_GROUPS'): ?>
|
91 |
+
<div class="grouping">
|
92 |
+
<?php if ($group['form_field'] != 'hidden'): ?><strong><?php echo $group['name']; ?></strong><?php endif; ?>
|
93 |
+
<?php echo $this->renderGroup($group, $generalList); ?>
|
94 |
+
</div>
|
95 |
+
<?php endif; ?>
|
96 |
+
<?php endforeach; ?>
|
97 |
+
</div>
|
98 |
+
|
99 |
+
<?php endif; ?>
|
100 |
+
</li>
|
101 |
+
</ul>
|
102 |
+
<!-- General Subscription -->
|
103 |
+
|
104 |
+
<!-- Additional Lists -->
|
105 |
+
<div class="monkey-multisubscribe">
|
106 |
+
<ul class="monkey-additional-lists">
|
107 |
+
<?php
|
108 |
+
foreach($lists as $list):
|
109 |
+
|
110 |
+
if($this->notInMyAccount() && in_array($list['id'], $myLists)){
|
111 |
+
continue;
|
112 |
+
}
|
113 |
+
$igroups = $list['interest_groupings'];
|
114 |
+
?>
|
115 |
+
<li class="listdata"><?php echo $list['name']; ?>
|
116 |
+
<input<?php if($auto): ?> checked="checked"<?php endif;?> type="checkbox" onchange="addSubscribeToPost(this);" name="list[<?php echo $list['id'] ?>][subscribed]" id="magemonkey-trigger-<?php echo $list['id']; ?>" value="<?php echo $list['id']; ?>" title="<?php echo $list['name']; ?>" class="monkey-list-subscriber" />
|
117 |
+
<?php if(is_array($igroups)): ?>
|
118 |
+
<div id="interest_groupings_<?php echo $list['id']; ?>" class="interest-groupings">
|
119 |
+
<?php foreach($igroups as $group): ?>
|
120 |
+
<?php if($group['name'] != 'MAGE_CUSTOMER_GROUPS'): ?>
|
121 |
+
<div class="grouping">
|
122 |
+
<strong><?php echo $group['name']; ?></strong>
|
123 |
+
<?php echo $this->renderGroup($group, $list); ?>
|
124 |
+
</div>
|
125 |
+
<?php endif; ?>
|
126 |
+
<?php endforeach; ?>
|
127 |
+
</div>
|
128 |
+
|
129 |
+
<?php endif; ?>
|
130 |
+
</li>
|
131 |
+
<?php endforeach; ?>
|
132 |
+
</ul>
|
133 |
+
</div>
|
134 |
+
<!-- Additional Lists -->
|
135 |
</div>
|
136 |
<?php
|
137 |
//Check if there's additional list selected, if not Dont show this section
|
138 |
if(count($lists) > 0):
|
139 |
+
//echo $this->getChildHtml('left.monkeysignup');
|
140 |
endif;
|
141 |
?>
|
142 |
|
143 |
<script type="text/javascript">
|
144 |
+
//Handle newsletter subscribe/unsubscribe checkbox events
|
145 |
+
$$('input.monkey-list-subscriber').each(function(chk){
|
146 |
+
|
147 |
+
if( !chk.checked ){
|
148 |
+
var groupings = $('interest_groupings_'+chk.value);
|
149 |
+
if(groupings){
|
150 |
+
groupings.select('select', 'input').invoke('writeAttribute', 'disabled', 'disabled');
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
chk.observe('change', function(){
|
155 |
+
|
156 |
+
var groupings = $('interest_groupings_'+this.value);
|
157 |
+
if(groupings){
|
158 |
+
var elements = groupings.select('select', 'input');
|
159 |
+
if(this.checked){
|
160 |
+
elements.invoke('removeAttribute', 'disabled');
|
161 |
+
}else{
|
162 |
+
elements.invoke('writeAttribute', 'disabled', 'disabled');
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
});
|
167 |
+
});
|
168 |
+
//If force subscription or checked by default set the elements as clicked
|
169 |
+
<?php if($auto):?>addSubscribeToPost($('magemonkey-trigger'));<?php endif; ?>
|
170 |
+
<?php if($auto):
|
171 |
+
foreach($lists as $list):
|
172 |
+
$string = "magemonkey-trigger-".$list['id'];
|
173 |
+
?>addSubscribeToPost($(<?php Print(json_encode($string)); ?>));
|
174 |
+
<?php endforeach; ?>
|
175 |
+
<?php endif; ?>
|
176 |
+
|
177 |
+
|
178 |
+
if( $$('div#checkout-step-review div.monkey-multisubscribe').length ){
|
179 |
+
|
180 |
+
var event = 'change';
|
181 |
+
|
182 |
+
//Radio||Checkbox
|
183 |
+
/*$$('div#checkout-step-review div.monkey-multisubscribe input').each(function(input){
|
184 |
+
|
185 |
+
if(input.readAttribute('type') == 'radio'){
|
186 |
+
event = 'click';
|
187 |
+
}
|
188 |
+
|
189 |
+
input.observe(event, function(){
|
190 |
+
addElementToPost(this);
|
191 |
+
});
|
192 |
+
});*/
|
193 |
+
|
194 |
+
$$('div#checkout-step-review div.monkey-multisubscribe select').each(function(ddl){
|
195 |
+
ddl.observe(event, function(){
|
196 |
+
addElementToPost(this);
|
197 |
+
});
|
198 |
+
});
|
199 |
+
|
200 |
+
}
|
201 |
+
//Handle newsletter subscribe/unsubscribe checkbox events
|
202 |
+
$$('.interest-groupings input').each(function(group){
|
203 |
+
group.observe('change', function(){
|
204 |
+
if(group.checked){
|
205 |
+
addGroupToPost(group);
|
206 |
+
}
|
207 |
+
});
|
208 |
+
});
|
209 |
</script>
|
app/design/frontend/base/default/template/magemonkey/lists.phtml
CHANGED
@@ -4,6 +4,7 @@ $lists = $this->getLists();
|
|
4 |
$myLists = $this->getSubscribedLists();
|
5 |
$generalList = $this->getGeneralList();
|
6 |
$canShowButton = $this->getCanShowButton();
|
|
|
7 |
|
8 |
?>
|
9 |
<div class="monkey-multisubscribe">
|
@@ -23,7 +24,7 @@ $canShowButton = $this->getCanShowButton();
|
|
23 |
<div id="interest_groupings_<?php echo $generalList['id']; ?>" class="interest-groupings">
|
24 |
<?php foreach($generalList['interest_groupings'] as $group): ?>
|
25 |
<?php if($group['name'] != 'MAGE_CUSTOMER_GROUPS'): ?>
|
26 |
-
<div class="grouping"
|
27 |
<?php if ($group['form_field'] != 'hidden'): ?><strong><?php echo $group['name']; ?></strong><?php endif; ?>
|
28 |
<?php echo $this->renderGroup($group, $generalList); ?>
|
29 |
</div>
|
4 |
$myLists = $this->getSubscribedLists();
|
5 |
$generalList = $this->getGeneralList();
|
6 |
$canShowButton = $this->getCanShowButton();
|
7 |
+
$canmodify = $this->getCanModify();
|
8 |
|
9 |
?>
|
10 |
<div class="monkey-multisubscribe">
|
24 |
<div id="interest_groupings_<?php echo $generalList['id']; ?>" class="interest-groupings">
|
25 |
<?php foreach($generalList['interest_groupings'] as $group): ?>
|
26 |
<?php if($group['name'] != 'MAGE_CUSTOMER_GROUPS'): ?>
|
27 |
+
<div class="grouping" <?php if(!$canmodify) echo 'style="display: none;"' ?>>
|
28 |
<?php if ($group['form_field'] != 'hidden'): ?><strong><?php echo $group['name']; ?></strong><?php endif; ?>
|
29 |
<?php echo $this->renderGroup($group, $generalList); ?>
|
30 |
</div>
|
app/locale/en_US/Ebizmarts_Autoresponder.csv
ADDED
File without changes
|
app/locale/en_US/template/email/ebizmarts/abandonedcart/abandoned_cart_mail_1.html
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
|
2 |
+
<div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
|
3 |
+
<table cellspacing="0" cellpadding="0" border="0" width="100%">
|
4 |
+
<tr>
|
5 |
+
<td align="center" valign="top" style="padding:20px 0 20px 0">
|
6 |
+
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
+
<!-- [ header starts here] -->
|
8 |
+
<tr>
|
9 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
10 |
+
</tr>
|
11 |
+
<!-- [ middle starts here] -->
|
12 |
+
<tr>
|
13 |
+
<td valign="top">
|
14 |
+
<h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello, {{htmlescape var=$name}}</h1>
|
15 |
+
<p style="font-size:12px; line-height:16px; margin:0;">
|
16 |
+
You have an abandoned cart at {{var store.getFrontendName()}}.
|
17 |
+
We would be glad to help you feel comfortable with our checkout process. if you are having technical issues contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or call us at <span class="nobr">{{config path='general/store_information/phone'}}</span> Monday - Friday, 8am - 5pm PST.
|
18 |
+
<br>You can access your cart <a href="{{var url}}" style="color:#1E7EC8;">here</a>.
|
19 |
+
{{depend couponcode}}
|
20 |
+
<br>You can use this coupon code <b>{{var couponcode}}</b>
|
21 |
+
{{/depend}}
|
22 |
+
{{depend discount}}
|
23 |
+
and obtain a discount of {{var discount}} only until {{var todate}}
|
24 |
+
{{/depend}}
|
25 |
+
</p>
|
26 |
+
</tr>
|
27 |
+
<tr>
|
28 |
+
<td>
|
29 |
+
{{block type='ebizmarts_abandonedcart/email_order_items' area='frontend' template='ebizmarts_abandonedcart/email/order/items.phtml' quote=$quote}}
|
30 |
+
</td>
|
31 |
+
</tr>
|
32 |
+
<tr>
|
33 |
+
<td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
|
34 |
+
</tr>
|
35 |
+
<tr>
|
36 |
+
<td>You can unsubscribe from this email clicking <a href="{{var unsubscribeurl}}" style="color:#1E7EC8;">here</a>.</td>
|
37 |
+
</tr>
|
38 |
+
</table>
|
39 |
+
</td>
|
40 |
+
</tr>
|
41 |
+
</table>
|
42 |
+
</div>
|
43 |
+
</body>
|
app/locale/en_US/template/email/ebizmarts/abandonedcart/abandoned_cart_mail_2.html
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
|
2 |
+
<div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
|
3 |
+
<table cellspacing="0" cellpadding="0" border="0" width="100%">
|
4 |
+
<tr>
|
5 |
+
<td align="center" valign="top" style="padding:20px 0 20px 0">
|
6 |
+
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
+
<!-- [ header starts here] -->
|
8 |
+
<tr>
|
9 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
10 |
+
</tr>
|
11 |
+
<!-- [ middle starts here] -->
|
12 |
+
<tr>
|
13 |
+
<td valign="top">
|
14 |
+
<h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello, {{htmlescape var=$name}}</h1>
|
15 |
+
<p style="font-size:12px; line-height:16px; margin:0;">
|
16 |
+
You have an abandoned cart at {{var store.getFrontendName()}}.
|
17 |
+
Please remember our stock is not unlimited, it is recommended to take advantage of this great opportunity to get your desired products in the comfort of your home.
|
18 |
+
<br>You can access your cart <a href="{{var url}}" style="color:#1E7EC8;">here</a>.
|
19 |
+
{{depend couponcode}}
|
20 |
+
<br>You can use this coupon code <b>{{var couponcode}}</b>
|
21 |
+
{{/depend}}
|
22 |
+
{{depend discount}}
|
23 |
+
and obtain a discount of {{var discount}} only until {{var todate}}
|
24 |
+
{{/depend}}
|
25 |
+
<br>If you have any questions about your order please contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or call us at <span class="nobr">{{config path='general/store_information/phone'}}</span> Monday - Friday, 8am - 5pm PST.
|
26 |
+
</p>
|
27 |
+
</tr>
|
28 |
+
<tr>
|
29 |
+
<td>
|
30 |
+
{{block type='ebizmarts_abandonedcart/email_order_items' area='frontend' template='ebizmarts_abandonedcart/email/order/items.phtml' quote=$quote}}
|
31 |
+
</td>
|
32 |
+
</tr>
|
33 |
+
<tr>
|
34 |
+
<td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
|
35 |
+
</tr>
|
36 |
+
<tr>
|
37 |
+
<td>You can unsubscribe from this email clicking <a href="{{var unsubscribeurl}}" style="color:#1E7EC8;">here</a>.</td>
|
38 |
+
</tr>
|
39 |
+
</table>
|
40 |
+
</td>
|
41 |
+
</tr>
|
42 |
+
</table>
|
43 |
+
</div>
|
44 |
+
</body>
|
app/locale/en_US/template/email/{sales/abandoned_cart.html → ebizmarts/abandonedcart/abandoned_cart_mail_3.html}
RENAMED
@@ -6,7 +6,7 @@
|
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
-
<td valign="top"><a href="{{store url=""}}"><img src="{{
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
@@ -14,13 +14,13 @@
|
|
14 |
<h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello, {{htmlescape var=$name}}</h1>
|
15 |
<p style="font-size:12px; line-height:16px; margin:0;">
|
16 |
You have an abandoned cart at {{var store.getFrontendName()}}.
|
17 |
-
You can access your cart <a href="{{var url}}" style="color:#1E7EC8;">here</a>.
|
18 |
{{depend couponcode}}
|
19 |
-
<br>You can
|
20 |
{{/depend}}
|
21 |
{{depend discount}}
|
22 |
and obtain a discount of {{var discount}} only until {{var todate}}
|
23 |
{{/depend}}
|
|
|
24 |
<br>If you have any questions about your order please contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or call us at <span class="nobr">{{config path='general/store_information/phone'}}</span> Monday - Friday, 8am - 5pm PST.
|
25 |
</p>
|
26 |
</tr>
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
14 |
<h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Hello, {{htmlescape var=$name}}</h1>
|
15 |
<p style="font-size:12px; line-height:16px; margin:0;">
|
16 |
You have an abandoned cart at {{var store.getFrontendName()}}.
|
|
|
17 |
{{depend couponcode}}
|
18 |
+
<br>You were chosen to receive a coupon which can be used with this code <b>{{var couponcode}}</b>
|
19 |
{{/depend}}
|
20 |
{{depend discount}}
|
21 |
and obtain a discount of {{var discount}} only until {{var todate}}
|
22 |
{{/depend}}
|
23 |
+
<br>You can access your cart <a href="{{var url}}" style="color:#1E7EC8;">here</a>.
|
24 |
<br>If you have any questions about your order please contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or call us at <span class="nobr">{{config path='general/store_information/phone'}}</span> Monday - Friday, 8am - 5pm PST.
|
25 |
</p>
|
26 |
</tr>
|
app/locale/en_US/template/email/ebizmarts/abandonedcart/abandoned_cart_mail_generic.html
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
|
2 |
+
<div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
|
3 |
+
<table cellspacing="0" cellpadding="0" border="0" width="100%">
|
4 |
+
<tr>
|
5 |
+
<td align="center" valign="top" style="padding:20px 0 20px 0">
|
6 |
+
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
+
<!-- [ header starts here] -->
|
8 |
+
<tr>
|
9 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
10 |
+
</tr>
|
11 |
+
<!-- [ middle starts here] -->
|
12 |
+
<tr>
|
13 |
+
<td valign="top">
|
14 |
+
<h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Template title</h1>
|
15 |
+
<p style="font-size:12px; line-height:16px; margin:0;">
|
16 |
+
It is recommended to send only 3 emails related to an abandoned cart.
|
17 |
+
{{depend couponcode}}
|
18 |
+
This info will only be displayed if coupon is enabled.
|
19 |
+
{{/depend}}
|
20 |
+
{{depend discount}}
|
21 |
+
This info will only be displayed if 'discount:' is set as a label for coupon
|
22 |
+
{{/depend}}
|
23 |
+
</p>
|
24 |
+
</tr>
|
25 |
+
<tr>
|
26 |
+
<td>
|
27 |
+
{{block type='ebizmarts_abandonedcart/email_order_items' area='frontend' template='ebizmarts_abandonedcart/email/order/items.phtml' quote=$quote}}
|
28 |
+
</td>
|
29 |
+
</tr>
|
30 |
+
<tr>
|
31 |
+
<td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
|
32 |
+
</tr>
|
33 |
+
<tr>
|
34 |
+
<td>You can unsubscribe from this email clicking <a href="{{var unsubscribeurl}}" style="color:#1E7EC8;">here</a>.</td>
|
35 |
+
</tr>
|
36 |
+
</table>
|
37 |
+
</td>
|
38 |
+
</tr>
|
39 |
+
</table>
|
40 |
+
</div>
|
41 |
+
</body>
|
app/locale/en_US/template/email/ebizmarts/autoresponder/backtostock.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
-
<td valign="top"><a href="{{store url=""}}"><img src="{{
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
app/locale/en_US/template/email/ebizmarts/autoresponder/birthday.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
-
<td valign="top"><a href="{{store url=""}}"><img src="{{
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
app/locale/en_US/template/email/ebizmarts/autoresponder/neworder.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
-
<td valign="top"><a href="{{store url=""}}"><img src="{{
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
app/locale/en_US/template/email/ebizmarts/autoresponder/noactivity.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
-
<td valign="top"><a href="{{store url=""}}"><img src="{{
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
app/locale/en_US/template/email/ebizmarts/autoresponder/relatedproducts.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
-
<td valign="top"><a href="{{store url=""}}"><img src="{{
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
app/locale/en_US/template/email/ebizmarts/autoresponder/review.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
-
<td valign="top"><a href="{{store url=""}}"><img src="{{
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
app/locale/en_US/template/email/ebizmarts/autoresponder/reviewcoupon.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
-
<td valign="top"><a href="{{store url=""}}"><img src="{{
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
app/locale/en_US/template/email/ebizmarts/autoresponder/visitedproducts.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
-
<td valign="top"><a href="{{store url=""}}"><img src="{{
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
app/locale/en_US/template/email/ebizmarts/autoresponder/wishlist.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
-
<td valign="top"><a href="{{store url=""}}"><img src="{{
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
6 |
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
|
7 |
<!-- [ header starts here] -->
|
8 |
<tr>
|
9 |
+
<td valign="top"><a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
|
10 |
</tr>
|
11 |
<!-- [ middle starts here] -->
|
12 |
<tr>
|
lib/Mandrill/API.php
DELETED
@@ -1,382 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* MailChimp MANDRILL API wrapper
|
5 |
-
*
|
6 |
-
* @category Ebizmarts
|
7 |
-
* @package Ebizmarts_Mandrill
|
8 |
-
* @author Ebizmarts Team <info@ebizmarts.com>
|
9 |
-
* @license http://opensource.org/licenses/osl-3.0.php
|
10 |
-
*/
|
11 |
-
|
12 |
-
class Mandrill_API {
|
13 |
-
|
14 |
-
/**
|
15 |
-
* API version number
|
16 |
-
*
|
17 |
-
* @var string
|
18 |
-
*/
|
19 |
-
public $version = '1.0';
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Error Message storage
|
23 |
-
*
|
24 |
-
* @var string
|
25 |
-
*/
|
26 |
-
public $errorMessage;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Error Code storage
|
30 |
-
*
|
31 |
-
* @var integer
|
32 |
-
*/
|
33 |
-
public $errorCode;
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Cache the user api_key so we only have to log in once per client instantiation
|
37 |
-
*
|
38 |
-
* @var string MailChimp API key
|
39 |
-
*/
|
40 |
-
public $api_key;
|
41 |
-
|
42 |
-
/**
|
43 |
-
* STS API URL
|
44 |
-
*
|
45 |
-
* @var string
|
46 |
-
*/
|
47 |
-
public $apiUrl;
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Request output format
|
51 |
-
*
|
52 |
-
* @var string
|
53 |
-
*/
|
54 |
-
protected $_output = 'json';
|
55 |
-
|
56 |
-
protected $_attachments = array();
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Setup data
|
60 |
-
*
|
61 |
-
* @param string $apikey Your MailChimp apikey
|
62 |
-
* @param string $secure Whether or not this should use a secure connection
|
63 |
-
*/
|
64 |
-
function __construct($apikey = null) {
|
65 |
-
if($apikey){
|
66 |
-
$this->setApiKey($apikey);
|
67 |
-
}
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Api key setter
|
72 |
-
*
|
73 |
-
* @param string $key API Key
|
74 |
-
* @return Ebizmarts_MageMonkey_Model_TransactionalEmail_MANDRILL
|
75 |
-
*/
|
76 |
-
public function setApiKey($key) {
|
77 |
-
$this->api_key = $key;
|
78 |
-
|
79 |
-
$this->apiUrl = "http://mandrillapp.com/api/{$this->version}/";
|
80 |
-
|
81 |
-
return $this;
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* ===== Users 유 Calls =====
|
86 |
-
*/
|
87 |
-
|
88 |
-
/**
|
89 |
-
* Validate an API key and respond to a ping
|
90 |
-
*
|
91 |
-
*/
|
92 |
-
public function usersPing() {
|
93 |
-
return $this->_callServer("users/ping");
|
94 |
-
}
|
95 |
-
|
96 |
-
/**
|
97 |
-
* Return the information about the API-connected user
|
98 |
-
*
|
99 |
-
*/
|
100 |
-
public function usersInfo() {
|
101 |
-
return $this->_callServer("users/info");
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Return the senders that have tried to use this account, both verified and unverified
|
106 |
-
*
|
107 |
-
*/
|
108 |
-
public function usersSenders() {
|
109 |
-
return $this->_callServer("users/senders");
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Disable a sender from being able to send
|
114 |
-
*
|
115 |
-
* @param string $email
|
116 |
-
*/
|
117 |
-
public function usersDisableSender($email) {
|
118 |
-
$params = array();
|
119 |
-
$params["email"] = $email;
|
120 |
-
|
121 |
-
return $this->_callServer("users/disable-sender", $params);
|
122 |
-
}
|
123 |
-
|
124 |
-
/**
|
125 |
-
* Send an email to the given address to verify that it is an accepted sender for your Mandrill account.
|
126 |
-
*
|
127 |
-
* @param string $email
|
128 |
-
*/
|
129 |
-
public function usersVerifySender($email) {
|
130 |
-
$params = array();
|
131 |
-
$params["email"] = $email;
|
132 |
-
|
133 |
-
return $this->_callServer("users/verify-sender", $params);
|
134 |
-
}
|
135 |
-
|
136 |
-
public function verifyEmailAddress($email) {
|
137 |
-
return $this->usersVerifySender($email);
|
138 |
-
}
|
139 |
-
|
140 |
-
/**
|
141 |
-
*
|
142 |
-
* ===== Users 유 Calls =====
|
143 |
-
*/
|
144 |
-
|
145 |
-
|
146 |
-
/**
|
147 |
-
* ===== Messages ✐ Calls =====
|
148 |
-
*/
|
149 |
-
|
150 |
-
/**
|
151 |
-
* Send a new transactional message through Mandrill
|
152 |
-
*
|
153 |
-
* @param array $message The message data with the following keys:
|
154 |
-
* string html the full HTML content to be sent
|
155 |
-
* string text optional full text content to be sent
|
156 |
-
* string subject the message subject
|
157 |
-
* string from_email the sender email address. If this address has not been verified, the message will be queued and not sent until it is verified
|
158 |
-
* string from_name optional from name to be used
|
159 |
-
* array to an array of email addresses to use as recipients. Each item in the array should be a struct with two keys - email: the email address of the recipient, and name: the optional display name to use for the recipient
|
160 |
-
* struct headers optional extra headers to add to the message (currently only Reply-To and X-* headers are allowed)
|
161 |
-
* boolean track_opens whether or not to turn on open tracking for the message
|
162 |
-
* boolean track_clicks whether or not to turn on click tracking for the message
|
163 |
-
* array tags an array of string to tag the message with. Stats are accumulated using tags, though we only store the first 100 we see, so this should not be unique or change frequently. Tags should be 50 characters or less. Any tags starting with an understore are reserved for internal use and will cause errors.
|
164 |
-
*/
|
165 |
-
public function messagesSend($message) {
|
166 |
-
$to = array();
|
167 |
-
|
168 |
-
foreach($message['to_email'] as $pos => $email){
|
169 |
-
$to []= array(
|
170 |
-
'email' => $email,
|
171 |
-
'name' => $message['to_name'][$pos],
|
172 |
-
'type' => 'to'
|
173 |
-
);
|
174 |
-
}
|
175 |
-
|
176 |
-
if(isset($message['bcc_address']) && !empty($message['bcc_address'])) {
|
177 |
-
foreach($message['bcc_address'] as $bccmail) {
|
178 |
-
$to []= array(
|
179 |
-
'email' => $bccmail,
|
180 |
-
'type' => 'bcc'
|
181 |
-
);
|
182 |
-
|
183 |
-
}
|
184 |
-
}
|
185 |
-
|
186 |
-
unset($message['bcc_address']);
|
187 |
-
if(count($this->_attachments)) {
|
188 |
-
$message['attachments'] = $this->_attachments;
|
189 |
-
}
|
190 |
-
$message['to'] = $to;
|
191 |
-
unset($message['to_email'], $message['to_name']);
|
192 |
-
|
193 |
-
$params = array();
|
194 |
-
$params["message"] = $message;
|
195 |
-
|
196 |
-
return $this->_callServer("messages/send", $params);
|
197 |
-
}
|
198 |
-
|
199 |
-
public function sendEmail($message) {
|
200 |
-
return $this->messagesSend($message);
|
201 |
-
}
|
202 |
-
|
203 |
-
/**
|
204 |
-
* ===== Messages ✐ Calls =====
|
205 |
-
*/
|
206 |
-
|
207 |
-
|
208 |
-
/**
|
209 |
-
* ===== Tags ✰ Calls =====
|
210 |
-
*/
|
211 |
-
|
212 |
-
/**
|
213 |
-
* Return all of the user-defined tag information
|
214 |
-
*
|
215 |
-
*/
|
216 |
-
public function tagsList() {
|
217 |
-
return $this->_callServer("tags/list");
|
218 |
-
}
|
219 |
-
|
220 |
-
/**
|
221 |
-
* Return the recent history (hourly stats for the last 30 days) for a tag
|
222 |
-
*
|
223 |
-
* @param string $tag
|
224 |
-
*/
|
225 |
-
public function tagsTimeSeries($tag) {
|
226 |
-
$params = array();
|
227 |
-
$params["tag"] = $tag;
|
228 |
-
|
229 |
-
return $this->_callServer("tags/time-series", $params);
|
230 |
-
}
|
231 |
-
|
232 |
-
/**
|
233 |
-
* Return the recent history (hourly stats for the last 30 days) for all tags
|
234 |
-
*
|
235 |
-
*/
|
236 |
-
public function tagsAllTimeSeries() {
|
237 |
-
return $this->_callServer("tags/all-time-series");
|
238 |
-
}
|
239 |
-
|
240 |
-
/**
|
241 |
-
* ===== Tags ✰ Calls =====
|
242 |
-
*/
|
243 |
-
|
244 |
-
|
245 |
-
/**
|
246 |
-
* ===== Urls ≎ Calls =====
|
247 |
-
*/
|
248 |
-
|
249 |
-
/**
|
250 |
-
* Get the 100 most clicked URLs
|
251 |
-
*
|
252 |
-
*/
|
253 |
-
public function urlsList() {
|
254 |
-
return $this->_callServer("urls/list");
|
255 |
-
}
|
256 |
-
|
257 |
-
/**
|
258 |
-
* Return the 100 most clicked URLs that match the search query given
|
259 |
-
*
|
260 |
-
* @param string $query
|
261 |
-
*/
|
262 |
-
public function urlsSearch($query) {
|
263 |
-
$params = array();
|
264 |
-
$params["q"] = $query;
|
265 |
-
|
266 |
-
return $this->_callServer("urls/search", $params);
|
267 |
-
}
|
268 |
-
|
269 |
-
/**
|
270 |
-
* Return the recent history (hourly stats for the last 30 days) for a url
|
271 |
-
*
|
272 |
-
* @param string $url
|
273 |
-
*/
|
274 |
-
public function urlsTimeSeries($url) {
|
275 |
-
$params = array();
|
276 |
-
$params["url"] = $url;
|
277 |
-
|
278 |
-
return $this->_callServer("urls/time-series", $params);
|
279 |
-
}
|
280 |
-
|
281 |
-
/**
|
282 |
-
* ===== Urls ≎ Calls =====
|
283 |
-
*/
|
284 |
-
|
285 |
-
|
286 |
-
/**
|
287 |
-
* Actually connect to the server and call the requested methods, parsing the result
|
288 |
-
*
|
289 |
-
* @param string $method
|
290 |
-
* @param array OPTIONAL $params
|
291 |
-
* @return object|false
|
292 |
-
*/
|
293 |
-
protected function _callServer($method, $params = array()) {
|
294 |
-
|
295 |
-
$this->errorMessage = null;
|
296 |
-
$this->errorCode = null;
|
297 |
-
|
298 |
-
$params['key'] = $this->api_key;
|
299 |
-
|
300 |
-
$url = $this->apiUrl . $method . '.' . $this->_output;
|
301 |
-
|
302 |
-
Mage::helper('mandrill')->log($url, 'Ebizmarts_Mandrill.log');
|
303 |
-
Mage::helper('mandrill')->log($params, 'Ebizmarts_Mandrill.log');
|
304 |
-
|
305 |
-
$curlSession = curl_init();
|
306 |
-
|
307 |
-
curl_setopt($curlSession, CURLOPT_USERAGENT, Mage::helper('mandrill')->getUserAgent());
|
308 |
-
curl_setopt($curlSession, CURLOPT_URL, $url);
|
309 |
-
curl_setopt($curlSession, CURLOPT_HEADER, 0);
|
310 |
-
curl_setopt($curlSession, CURLOPT_POST, TRUE);
|
311 |
-
curl_setopt($curlSession, CURLOPT_POSTFIELDS, http_build_query($params));
|
312 |
-
curl_setopt($curlSession, CURLOPT_RETURNTRANSFER, TRUE);
|
313 |
-
//curl_setopt($curlSession, CURLOPT_SSL_VERIFYPEER, FALSE);
|
314 |
-
//curl_setopt($curlSession, CURLOPT_SSL_VERIFYHOST, 1);
|
315 |
-
|
316 |
-
$result = curl_exec($curlSession);
|
317 |
-
if(!$result){
|
318 |
-
|
319 |
-
$errstr = curl_error($curlSession);
|
320 |
-
$errno = curl_errno($curlSession);
|
321 |
-
|
322 |
-
$this->errorMessage = "Could not connect (ERR $errno: $errstr)";
|
323 |
-
$this->errorCode = "-99";
|
324 |
-
return false;
|
325 |
-
}
|
326 |
-
|
327 |
-
// Check that a connection was made
|
328 |
-
if (curl_error($curlSession)) {
|
329 |
-
$this->errorMessage = curl_error($curlSession);
|
330 |
-
$this->errorCode = "-99";
|
331 |
-
return false;
|
332 |
-
}
|
333 |
-
|
334 |
-
$httpCode = curl_getinfo($curlSession, CURLINFO_HTTP_CODE);
|
335 |
-
|
336 |
-
curl_close($curlSession);
|
337 |
-
|
338 |
-
$resultObject = json_decode($result);
|
339 |
-
|
340 |
-
Mage::helper('mandrill')->log($resultObject, 'Ebizmarts_Mandrill.log');
|
341 |
-
|
342 |
-
//You can consider any non-200 HTTP response code an error
|
343 |
-
//the returned data will contain more detailed information
|
344 |
-
if($httpCode != 200){
|
345 |
-
$this->errorMessage = $resultObject->message;
|
346 |
-
$this->errorCode = "-99";
|
347 |
-
return false;
|
348 |
-
}
|
349 |
-
|
350 |
-
return $resultObject;
|
351 |
-
|
352 |
-
}
|
353 |
-
|
354 |
-
public function tagsInfo($tag) {
|
355 |
-
$params = array();
|
356 |
-
$params["tag"] = $tag;
|
357 |
-
|
358 |
-
return $this->_callServer("tags/info", $params);
|
359 |
-
}
|
360 |
-
public function createAttachment($body,
|
361 |
-
$mimeType = Zend_Mime::TYPE_OCTETSTREAM,
|
362 |
-
$disposition = Zend_Mime::DISPOSITION_ATTACHMENT,
|
363 |
-
$encoding = Zend_Mime::ENCODING_BASE64,
|
364 |
-
$filename = null)
|
365 |
-
{
|
366 |
-
$att = array();
|
367 |
-
$att['type'] = $mimeType;
|
368 |
-
$att['name'] = $filename;
|
369 |
-
$att['content'] = base64_encode($body);
|
370 |
-
$this->_attachments[] = $att;
|
371 |
-
return $att;
|
372 |
-
}
|
373 |
-
public function addAttachment(Zend_Mime_Part $attachment)
|
374 |
-
{
|
375 |
-
$att = array();
|
376 |
-
$att['type'] = $attachment->type;
|
377 |
-
$att['name'] = $attachment->filename;
|
378 |
-
$this->_attachments[] = $att;
|
379 |
-
|
380 |
-
return $this;
|
381 |
-
}
|
382 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Mandrill/Mandrill.php
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once 'Mandrill/Templates.php';
|
4 |
+
require_once 'Mandrill/Exports.php';
|
5 |
+
require_once 'Mandrill/Users.php';
|
6 |
+
require_once 'Mandrill/Rejects.php';
|
7 |
+
require_once 'Mandrill/Inbound.php';
|
8 |
+
require_once 'Mandrill/Tags.php';
|
9 |
+
require_once 'Mandrill/Messages.php';
|
10 |
+
require_once 'Mandrill/Whitelists.php';
|
11 |
+
require_once 'Mandrill/Ips.php';
|
12 |
+
require_once 'Mandrill/Internal.php';
|
13 |
+
require_once 'Mandrill/Subaccounts.php';
|
14 |
+
require_once 'Mandrill/Urls.php';
|
15 |
+
require_once 'Mandrill/Webhooks.php';
|
16 |
+
require_once 'Mandrill/Senders.php';
|
17 |
+
require_once 'Mandrill/Metadata.php';
|
18 |
+
require_once 'Mandrill/Exceptions.php';
|
19 |
+
|
20 |
+
class Mandrill_Mandrill {
|
21 |
+
|
22 |
+
public $apikey;
|
23 |
+
public $ch;
|
24 |
+
public $root = 'https://mandrillapp.com/api/1.0';
|
25 |
+
public $debug = false;
|
26 |
+
|
27 |
+
public static $error_map = array(
|
28 |
+
"ValidationError" => "Mandrill_ValidationError",
|
29 |
+
"Invalid_Key" => "Mandrill_Invalid_Key",
|
30 |
+
"PaymentRequired" => "Mandrill_PaymentRequired",
|
31 |
+
"Unknown_Subaccount" => "Mandrill_Unknown_Subaccount",
|
32 |
+
"Unknown_Template" => "Mandrill_Unknown_Template",
|
33 |
+
"ServiceUnavailable" => "Mandrill_ServiceUnavailable",
|
34 |
+
"Unknown_Message" => "Mandrill_Unknown_Message",
|
35 |
+
"Invalid_Tag_Name" => "Mandrill_Invalid_Tag_Name",
|
36 |
+
"Invalid_Reject" => "Mandrill_Invalid_Reject",
|
37 |
+
"Unknown_Sender" => "Mandrill_Unknown_Sender",
|
38 |
+
"Unknown_Url" => "Mandrill_Unknown_Url",
|
39 |
+
"Unknown_TrackingDomain" => "Mandrill_Unknown_TrackingDomain",
|
40 |
+
"Invalid_Template" => "Mandrill_Invalid_Template",
|
41 |
+
"Unknown_Webhook" => "Mandrill_Unknown_Webhook",
|
42 |
+
"Unknown_InboundDomain" => "Mandrill_Unknown_InboundDomain",
|
43 |
+
"Unknown_InboundRoute" => "Mandrill_Unknown_InboundRoute",
|
44 |
+
"Unknown_Export" => "Mandrill_Unknown_Export",
|
45 |
+
"IP_ProvisionLimit" => "Mandrill_IP_ProvisionLimit",
|
46 |
+
"Unknown_Pool" => "Mandrill_Unknown_Pool",
|
47 |
+
"NoSendingHistory" => "Mandrill_NoSendingHistory",
|
48 |
+
"PoorReputation" => "Mandrill_PoorReputation",
|
49 |
+
"Unknown_IP" => "Mandrill_Unknown_IP",
|
50 |
+
"Invalid_EmptyDefaultPool" => "Mandrill_Invalid_EmptyDefaultPool",
|
51 |
+
"Invalid_DeleteDefaultPool" => "Mandrill_Invalid_DeleteDefaultPool",
|
52 |
+
"Invalid_DeleteNonEmptyPool" => "Mandrill_Invalid_DeleteNonEmptyPool",
|
53 |
+
"Invalid_CustomDNS" => "Mandrill_Invalid_CustomDNS",
|
54 |
+
"Invalid_CustomDNSPending" => "Mandrill_Invalid_CustomDNSPending",
|
55 |
+
"Metadata_FieldLimit" => "Mandrill_Metadata_FieldLimit",
|
56 |
+
"Unknown_MetadataField" => "Mandrill_Unknown_MetadataField"
|
57 |
+
);
|
58 |
+
|
59 |
+
public function __construct($apikey=null) {
|
60 |
+
if(!$apikey) $apikey = getenv('MANDRILL_APIKEY');
|
61 |
+
if(!$apikey) $apikey = $this->readConfigs();
|
62 |
+
if(!$apikey) throw new Mandrill_Error('You must provide a Mandrill API key');
|
63 |
+
$this->apikey = $apikey;
|
64 |
+
|
65 |
+
$this->ch = curl_init();
|
66 |
+
curl_setopt($this->ch, CURLOPT_USERAGENT, 'Mandrill-PHP/1.0.53');
|
67 |
+
curl_setopt($this->ch, CURLOPT_POST, true);
|
68 |
+
curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
|
69 |
+
curl_setopt($this->ch, CURLOPT_HEADER, false);
|
70 |
+
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
|
71 |
+
curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, 30);
|
72 |
+
curl_setopt($this->ch, CURLOPT_TIMEOUT, 600);
|
73 |
+
|
74 |
+
$this->root = rtrim($this->root, '/') . '/';
|
75 |
+
|
76 |
+
$this->templates = new Mandrill_Templates($this);
|
77 |
+
$this->exports = new Mandrill_Exports($this);
|
78 |
+
$this->users = new Mandrill_Users($this);
|
79 |
+
$this->rejects = new Mandrill_Rejects($this);
|
80 |
+
$this->inbound = new Mandrill_Inbound($this);
|
81 |
+
$this->tags = new Mandrill_Tags($this);
|
82 |
+
$this->messages = new Mandrill_Messages($this);
|
83 |
+
$this->whitelists = new Mandrill_Whitelists($this);
|
84 |
+
$this->ips = new Mandrill_Ips($this);
|
85 |
+
$this->internal = new Mandrill_Internal($this);
|
86 |
+
$this->subaccounts = new Mandrill_Subaccounts($this);
|
87 |
+
$this->urls = new Mandrill_Urls($this);
|
88 |
+
$this->webhooks = new Mandrill_Webhooks($this);
|
89 |
+
$this->senders = new Mandrill_Senders($this);
|
90 |
+
$this->metadata = new Mandrill_Metadata($this);
|
91 |
+
}
|
92 |
+
|
93 |
+
public function __destruct() {
|
94 |
+
curl_close($this->ch);
|
95 |
+
}
|
96 |
+
|
97 |
+
public function call($url, $params) {
|
98 |
+
$params['key'] = $this->apikey;
|
99 |
+
$params = json_encode($params);
|
100 |
+
$ch = $this->ch;
|
101 |
+
|
102 |
+
curl_setopt($ch, CURLOPT_URL, $this->root . $url . '.json');
|
103 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
|
104 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
|
105 |
+
curl_setopt($ch, CURLOPT_VERBOSE, $this->debug);
|
106 |
+
|
107 |
+
$start = microtime(true);
|
108 |
+
$this->log('Call to ' . $this->root . $url . '.json: ' . $params);
|
109 |
+
if($this->debug) {
|
110 |
+
$curl_buffer = fopen('php://memory', 'w+');
|
111 |
+
curl_setopt($ch, CURLOPT_STDERR, $curl_buffer);
|
112 |
+
}
|
113 |
+
|
114 |
+
$response_body = curl_exec($ch);
|
115 |
+
$info = curl_getinfo($ch);
|
116 |
+
$time = microtime(true) - $start;
|
117 |
+
if($this->debug) {
|
118 |
+
rewind($curl_buffer);
|
119 |
+
$this->log(stream_get_contents($curl_buffer));
|
120 |
+
fclose($curl_buffer);
|
121 |
+
}
|
122 |
+
$this->log('Completed in ' . number_format($time * 1000, 2) . 'ms');
|
123 |
+
$this->log('Got response: ' . $response_body);
|
124 |
+
|
125 |
+
if(curl_error($ch)) {
|
126 |
+
throw new Mandrill_HttpError("API call to $url failed: " . curl_error($ch));
|
127 |
+
}
|
128 |
+
$result = json_decode($response_body, true);
|
129 |
+
if($result === null) throw new Mandrill_Error('We were unable to decode the JSON response from the Mandrill API: ' . $response_body);
|
130 |
+
|
131 |
+
if(floor($info['http_code'] / 100) >= 4) {
|
132 |
+
throw $this->castError($result);
|
133 |
+
}
|
134 |
+
|
135 |
+
return $result;
|
136 |
+
}
|
137 |
+
|
138 |
+
public function readConfigs() {
|
139 |
+
$paths = array('~/.mandrill.key', '/etc/mandrill.key');
|
140 |
+
foreach($paths as $path) {
|
141 |
+
if(file_exists($path)) {
|
142 |
+
$apikey = trim(file_get_contents($path));
|
143 |
+
if($apikey) return $apikey;
|
144 |
+
}
|
145 |
+
}
|
146 |
+
return false;
|
147 |
+
}
|
148 |
+
|
149 |
+
public function castError($result) {
|
150 |
+
if($result['status'] !== 'error' || !$result['name']) throw new Mandrill_Error('We received an unexpected error: ' . json_encode($result));
|
151 |
+
|
152 |
+
$class = (isset(self::$error_map[$result['name']])) ? self::$error_map[$result['name']] : 'Mandrill_Error';
|
153 |
+
return new $class($result['message'], $result['code']);
|
154 |
+
}
|
155 |
+
|
156 |
+
public function log($msg) {
|
157 |
+
if($this->debug) error_log($msg);
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
|
lib/Mandrill/Mandrill/Exceptions.php
ADDED
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Error extends Exception {}
|
4 |
+
class Mandrill_HttpError extends Mandrill_Error {}
|
5 |
+
|
6 |
+
/**
|
7 |
+
* The parameters passed to the API call are invalid or not provided when required
|
8 |
+
*/
|
9 |
+
class Mandrill_ValidationError extends Mandrill_Error {}
|
10 |
+
|
11 |
+
/**
|
12 |
+
* The provided API key is not a valid Mandrill API key
|
13 |
+
*/
|
14 |
+
class Mandrill_Invalid_Key extends Mandrill_Error {}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* The requested feature requires payment.
|
18 |
+
*/
|
19 |
+
class Mandrill_PaymentRequired extends Mandrill_Error {}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* The provided subaccount id does not exist.
|
23 |
+
*/
|
24 |
+
class Mandrill_Unknown_Subaccount extends Mandrill_Error {}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* The requested template does not exist
|
28 |
+
*/
|
29 |
+
class Mandrill_Unknown_Template extends Mandrill_Error {}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* The subsystem providing this API call is down for maintenance
|
33 |
+
*/
|
34 |
+
class Mandrill_ServiceUnavailable extends Mandrill_Error {}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* The provided message id does not exist.
|
38 |
+
*/
|
39 |
+
class Mandrill_Unknown_Message extends Mandrill_Error {}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* The requested tag does not exist or contains invalid characters
|
43 |
+
*/
|
44 |
+
class Mandrill_Invalid_Tag_Name extends Mandrill_Error {}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* The requested email is not in the rejection list
|
48 |
+
*/
|
49 |
+
class Mandrill_Invalid_Reject extends Mandrill_Error {}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* The requested sender does not exist
|
53 |
+
*/
|
54 |
+
class Mandrill_Unknown_Sender extends Mandrill_Error {}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* The requested URL has not been seen in a tracked link
|
58 |
+
*/
|
59 |
+
class Mandrill_Unknown_Url extends Mandrill_Error {}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* The provided tracking domain does not exist.
|
63 |
+
*/
|
64 |
+
class Mandrill_Unknown_TrackingDomain extends Mandrill_Error {}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* The given template name already exists or contains invalid characters
|
68 |
+
*/
|
69 |
+
class Mandrill_Invalid_Template extends Mandrill_Error {}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* The requested webhook does not exist
|
73 |
+
*/
|
74 |
+
class Mandrill_Unknown_Webhook extends Mandrill_Error {}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* The requested inbound domain does not exist
|
78 |
+
*/
|
79 |
+
class Mandrill_Unknown_InboundDomain extends Mandrill_Error {}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* The provided inbound route does not exist.
|
83 |
+
*/
|
84 |
+
class Mandrill_Unknown_InboundRoute extends Mandrill_Error {}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* The requested export job does not exist
|
88 |
+
*/
|
89 |
+
class Mandrill_Unknown_Export extends Mandrill_Error {}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* A dedicated IP cannot be provisioned while another request is pending.
|
93 |
+
*/
|
94 |
+
class Mandrill_IP_ProvisionLimit extends Mandrill_Error {}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* The provided dedicated IP pool does not exist.
|
98 |
+
*/
|
99 |
+
class Mandrill_Unknown_Pool extends Mandrill_Error {}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* The user hasn't started sending yet.
|
103 |
+
*/
|
104 |
+
class Mandrill_NoSendingHistory extends Mandrill_Error {}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* The user's reputation is too low to continue.
|
108 |
+
*/
|
109 |
+
class Mandrill_PoorReputation extends Mandrill_Error {}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* The provided dedicated IP does not exist.
|
113 |
+
*/
|
114 |
+
class Mandrill_Unknown_IP extends Mandrill_Error {}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* You cannot remove the last IP from your default IP pool.
|
118 |
+
*/
|
119 |
+
class Mandrill_Invalid_EmptyDefaultPool extends Mandrill_Error {}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* The default pool cannot be deleted.
|
123 |
+
*/
|
124 |
+
class Mandrill_Invalid_DeleteDefaultPool extends Mandrill_Error {}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Non-empty pools cannot be deleted.
|
128 |
+
*/
|
129 |
+
class Mandrill_Invalid_DeleteNonEmptyPool extends Mandrill_Error {}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* The domain name is not configured for use as the dedicated IP's custom reverse DNS.
|
133 |
+
*/
|
134 |
+
class Mandrill_Invalid_CustomDNS extends Mandrill_Error {}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* A custom DNS change for this dedicated IP is currently pending.
|
138 |
+
*/
|
139 |
+
class Mandrill_Invalid_CustomDNSPending extends Mandrill_Error {}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Custom metadata field limit reached.
|
143 |
+
*/
|
144 |
+
class Mandrill_Metadata_FieldLimit extends Mandrill_Error {}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* The provided metadata field name does not exist.
|
148 |
+
*/
|
149 |
+
class Mandrill_Unknown_MetadataField extends Mandrill_Error {}
|
150 |
+
|
151 |
+
|
lib/Mandrill/Mandrill/Exports.php
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Exports {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Returns information about an export job. If the export job's state is 'complete',
|
10 |
+
the returned data will include a URL you can use to fetch the results. Every export
|
11 |
+
job produces a zip archive, but the format of the archive is distinct for each job
|
12 |
+
type. The api calls that initiate exports include more details about the output format
|
13 |
+
for that job type.
|
14 |
+
* @param string $id an export job identifier
|
15 |
+
* @return struct the information about the export
|
16 |
+
* - id string the unique identifier for this Export. Use this identifier when checking the export job's status
|
17 |
+
* - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
18 |
+
* - type string the type of the export job - activity, reject, or whitelist
|
19 |
+
* - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format
|
20 |
+
* - state string the export job's state - waiting, working, complete, error, or expired.
|
21 |
+
* - result_url string the url for the export job's results, if the job is completed.
|
22 |
+
*/
|
23 |
+
public function info($id) {
|
24 |
+
$_params = array("id" => $id);
|
25 |
+
return $this->master->call('exports/info', $_params);
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Returns a list of your exports.
|
30 |
+
* @return array the account's exports
|
31 |
+
* - return[] struct the individual export info
|
32 |
+
* - id string the unique identifier for this Export. Use this identifier when checking the export job's status
|
33 |
+
* - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
34 |
+
* - type string the type of the export job - activity, reject, or whitelist
|
35 |
+
* - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format
|
36 |
+
* - state string the export job's state - waiting, working, complete, error, or expired.
|
37 |
+
* - result_url string the url for the export job's results, if the job is completed.
|
38 |
+
*/
|
39 |
+
public function getList() {
|
40 |
+
$_params = array();
|
41 |
+
return $this->master->call('exports/list', $_params);
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Begins an export of your rejection blacklist. The blacklist will be exported to a zip archive
|
46 |
+
containing a single file named rejects.csv that includes the following fields: email,
|
47 |
+
reason, detail, created_at, expires_at, last_event_at, expires_at.
|
48 |
+
* @param string $notify_email an optional email address to notify when the export job has finished.
|
49 |
+
* @return struct information about the rejects export job that was started
|
50 |
+
* - id string the unique identifier for this Export. Use this identifier when checking the export job's status
|
51 |
+
* - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
52 |
+
* - type string the type of the export job
|
53 |
+
* - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
|
54 |
+
* - state string the export job's state
|
55 |
+
* - result_url string the url for the export job's results, if the job is complete
|
56 |
+
*/
|
57 |
+
public function rejects($notify_email=null) {
|
58 |
+
$_params = array("notify_email" => $notify_email);
|
59 |
+
return $this->master->call('exports/rejects', $_params);
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Begins an export of your rejection whitelist. The whitelist will be exported to a zip archive
|
64 |
+
containing a single file named whitelist.csv that includes the following fields:
|
65 |
+
email, detail, created_at.
|
66 |
+
* @param string $notify_email an optional email address to notify when the export job has finished.
|
67 |
+
* @return struct information about the whitelist export job that was started
|
68 |
+
* - id string the unique identifier for this Export. Use this identifier when checking the export job's status
|
69 |
+
* - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
70 |
+
* - type string the type of the export job
|
71 |
+
* - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
|
72 |
+
* - state string the export job's state
|
73 |
+
* - result_url string the url for the export job's results, if the job is complete
|
74 |
+
*/
|
75 |
+
public function whitelist($notify_email=null) {
|
76 |
+
$_params = array("notify_email" => $notify_email);
|
77 |
+
return $this->master->call('exports/whitelist', $_params);
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Begins an export of your activity history. The activity will be exported to a zip archive
|
82 |
+
containing a single file named activity.csv in the same format as you would be able to export
|
83 |
+
from your account's activity view. It includes the following fields: Date, Email Address,
|
84 |
+
Sender, Subject, Status, Tags, Opens, Clicks, Bounce Detail. If you have configured any custom
|
85 |
+
metadata fields, they will be included in the exported data.
|
86 |
+
* @param string $notify_email an optional email address to notify when the export job has finished
|
87 |
+
* @param string $date_from start date as a UTC string in YYYY-MM-DD HH:MM:SS format
|
88 |
+
* @param string $date_to end date as a UTC string in YYYY-MM-DD HH:MM:SS format
|
89 |
+
* @param array $tags an array of tag names to narrow the export to; will match messages that contain ANY of the tags
|
90 |
+
* - tags[] string a tag name
|
91 |
+
* @param array $senders an array of senders to narrow the export to
|
92 |
+
* - senders[] string a sender address
|
93 |
+
* @param array $states an array of states to narrow the export to; messages with ANY of the states will be included
|
94 |
+
* - states[] string a message state
|
95 |
+
* @param array $api_keys an array of api keys to narrow the export to; messsagse sent with ANY of the keys will be included
|
96 |
+
* - api_keys[] string an API key associated with your account
|
97 |
+
* @return struct information about the activity export job that was started
|
98 |
+
* - id string the unique identifier for this Export. Use this identifier when checking the export job's status
|
99 |
+
* - created_at string the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
100 |
+
* - type string the type of the export job
|
101 |
+
* - finished_at string the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
|
102 |
+
* - state string the export job's state
|
103 |
+
* - result_url string the url for the export job's results, if the job is complete
|
104 |
+
*/
|
105 |
+
public function activity($notify_email=null, $date_from=null, $date_to=null, $tags=null, $senders=null, $states=null, $api_keys=null) {
|
106 |
+
$_params = array("notify_email" => $notify_email, "date_from" => $date_from, "date_to" => $date_to, "tags" => $tags, "senders" => $senders, "states" => $states, "api_keys" => $api_keys);
|
107 |
+
return $this->master->call('exports/activity', $_params);
|
108 |
+
}
|
109 |
+
|
110 |
+
}
|
111 |
+
|
112 |
+
|
lib/Mandrill/Mandrill/Inbound.php
ADDED
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Inbound {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* List the domains that have been configured for inbound delivery
|
10 |
+
* @return array the inbound domains associated with the account
|
11 |
+
* - return[] struct the individual domain info
|
12 |
+
* - domain string the domain name that is accepting mail
|
13 |
+
* - created_at string the date and time that the inbound domain was added as a UTC string in YYYY-MM-DD HH:MM:SS format
|
14 |
+
* - valid_mx boolean true if this inbound domain has successfully set up an MX record to deliver mail to the Mandrill servers
|
15 |
+
*/
|
16 |
+
public function domains() {
|
17 |
+
$_params = array();
|
18 |
+
return $this->master->call('inbound/domains', $_params);
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Add an inbound domain to your account
|
23 |
+
* @param string $domain a domain name
|
24 |
+
* @return struct information about the domain
|
25 |
+
* - domain string the domain name that is accepting mail
|
26 |
+
* - created_at string the date and time that the inbound domain was added as a UTC string in YYYY-MM-DD HH:MM:SS format
|
27 |
+
* - valid_mx boolean true if this inbound domain has successfully set up an MX record to deliver mail to the Mandrill servers
|
28 |
+
*/
|
29 |
+
public function addDomain($domain) {
|
30 |
+
$_params = array("domain" => $domain);
|
31 |
+
return $this->master->call('inbound/add-domain', $_params);
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Check the MX settings for an inbound domain. The domain must have already been added with the add-domain call
|
36 |
+
* @param string $domain an existing inbound domain
|
37 |
+
* @return struct information about the inbound domain
|
38 |
+
* - domain string the domain name that is accepting mail
|
39 |
+
* - created_at string the date and time that the inbound domain was added as a UTC string in YYYY-MM-DD HH:MM:SS format
|
40 |
+
* - valid_mx boolean true if this inbound domain has successfully set up an MX record to deliver mail to the Mandrill servers
|
41 |
+
*/
|
42 |
+
public function checkDomain($domain) {
|
43 |
+
$_params = array("domain" => $domain);
|
44 |
+
return $this->master->call('inbound/check-domain', $_params);
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Delete an inbound domain from the account. All mail will stop routing for this domain immediately.
|
49 |
+
* @param string $domain an existing inbound domain
|
50 |
+
* @return struct information about the deleted domain
|
51 |
+
* - domain string the domain name that is accepting mail
|
52 |
+
* - created_at string the date and time that the inbound domain was added as a UTC string in YYYY-MM-DD HH:MM:SS format
|
53 |
+
* - valid_mx boolean true if this inbound domain has successfully set up an MX record to deliver mail to the Mandrill servers
|
54 |
+
*/
|
55 |
+
public function deleteDomain($domain) {
|
56 |
+
$_params = array("domain" => $domain);
|
57 |
+
return $this->master->call('inbound/delete-domain', $_params);
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* List the mailbox routes defined for an inbound domain
|
62 |
+
* @param string $domain the domain to check
|
63 |
+
* @return array the routes associated with the domain
|
64 |
+
* - return[] struct the individual mailbox route
|
65 |
+
* - id string the unique identifier of the route
|
66 |
+
* - pattern string the search pattern that the mailbox name should match
|
67 |
+
* - url string the webhook URL where inbound messages will be published
|
68 |
+
*/
|
69 |
+
public function routes($domain) {
|
70 |
+
$_params = array("domain" => $domain);
|
71 |
+
return $this->master->call('inbound/routes', $_params);
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Add a new mailbox route to an inbound domain
|
76 |
+
* @param string $domain an existing inbound domain
|
77 |
+
* @param string $pattern the search pattern that the mailbox name should match
|
78 |
+
* @param string $url the webhook URL where the inbound messages will be published
|
79 |
+
* @return struct the added mailbox route information
|
80 |
+
* - id string the unique identifier of the route
|
81 |
+
* - pattern string the search pattern that the mailbox name should match
|
82 |
+
* - url string the webhook URL where inbound messages will be published
|
83 |
+
*/
|
84 |
+
public function addRoute($domain, $pattern, $url) {
|
85 |
+
$_params = array("domain" => $domain, "pattern" => $pattern, "url" => $url);
|
86 |
+
return $this->master->call('inbound/add-route', $_params);
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Update the pattern or webhook of an existing inbound mailbox route. If null is provided for any fields, the values will remain unchanged.
|
91 |
+
* @param string $id the unique identifier of an existing mailbox route
|
92 |
+
* @param string $pattern the search pattern that the mailbox name should match
|
93 |
+
* @param string $url the webhook URL where the inbound messages will be published
|
94 |
+
* @return struct the updated mailbox route information
|
95 |
+
* - id string the unique identifier of the route
|
96 |
+
* - pattern string the search pattern that the mailbox name should match
|
97 |
+
* - url string the webhook URL where inbound messages will be published
|
98 |
+
*/
|
99 |
+
public function updateRoute($id, $pattern=null, $url=null) {
|
100 |
+
$_params = array("id" => $id, "pattern" => $pattern, "url" => $url);
|
101 |
+
return $this->master->call('inbound/update-route', $_params);
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Delete an existing inbound mailbox route
|
106 |
+
* @param string $id the unique identifier of an existing route
|
107 |
+
* @return struct the deleted mailbox route information
|
108 |
+
* - id string the unique identifier of the route
|
109 |
+
* - pattern string the search pattern that the mailbox name should match
|
110 |
+
* - url string the webhook URL where inbound messages will be published
|
111 |
+
*/
|
112 |
+
public function deleteRoute($id) {
|
113 |
+
$_params = array("id" => $id);
|
114 |
+
return $this->master->call('inbound/delete-route', $_params);
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Take a raw MIME document destined for a domain with inbound domains set up, and send it to the inbound hook exactly as if it had been sent over SMTP
|
119 |
+
* @param string $raw_message the full MIME document of an email message
|
120 |
+
* @param array|null $to optionally define the recipients to receive the message - otherwise we'll use the To, Cc, and Bcc headers provided in the document
|
121 |
+
* - to[] string the email address of the recipient
|
122 |
+
* @param string $mail_from the address specified in the MAIL FROM stage of the SMTP conversation. Required for the SPF check.
|
123 |
+
* @param string $helo the identification provided by the client mta in the MTA state of the SMTP conversation. Required for the SPF check.
|
124 |
+
* @param string $client_address the remote MTA's ip address. Optional; required for the SPF check.
|
125 |
+
* @return array an array of the information for each recipient in the message (usually one) that matched an inbound route
|
126 |
+
* - return[] struct the individual recipient information
|
127 |
+
* - email string the email address of the matching recipient
|
128 |
+
* - pattern string the mailbox route pattern that the recipient matched
|
129 |
+
* - url string the webhook URL that the message was posted to
|
130 |
+
*/
|
131 |
+
public function sendRaw($raw_message, $to=null, $mail_from=null, $helo=null, $client_address=null) {
|
132 |
+
$_params = array("raw_message" => $raw_message, "to" => $to, "mail_from" => $mail_from, "helo" => $helo, "client_address" => $client_address);
|
133 |
+
return $this->master->call('inbound/send-raw', $_params);
|
134 |
+
}
|
135 |
+
|
136 |
+
}
|
137 |
+
|
138 |
+
|
lib/Mandrill/Mandrill/Internal.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Internal {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
}
|
9 |
+
|
10 |
+
|
lib/Mandrill/Mandrill/Ips.php
ADDED
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Ips {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Lists your dedicated IPs.
|
10 |
+
* @return array an array of structs for each dedicated IP
|
11 |
+
* - return[] struct information about a single dedicated IP
|
12 |
+
* - ip string the ip address
|
13 |
+
* - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
14 |
+
* - pool string the name of the pool that this dedicated IP belongs to
|
15 |
+
* - domain string the domain name (reverse dns) of this dedicated IP
|
16 |
+
* - custom_dns struct information about the ip's custom dns, if it has been configured
|
17 |
+
* - enabled boolean a boolean indicating whether custom dns has been configured for this ip
|
18 |
+
* - valid boolean whether the ip's custom dns is currently valid
|
19 |
+
* - error string if the ip's custom dns is invalid, this will include details about the error
|
20 |
+
* - warmup struct information about the ip's warmup status
|
21 |
+
* - warming_up boolean whether the ip is currently in warmup mode
|
22 |
+
* - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
23 |
+
* - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
24 |
+
*/
|
25 |
+
public function getList() {
|
26 |
+
$_params = array();
|
27 |
+
return $this->master->call('ips/list', $_params);
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Retrieves information about a single dedicated ip.
|
32 |
+
* @param string $ip a dedicated IP address
|
33 |
+
* @return struct Information about the dedicated ip
|
34 |
+
* - ip string the ip address
|
35 |
+
* - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
36 |
+
* - pool string the name of the pool that this dedicated IP belongs to
|
37 |
+
* - domain string the domain name (reverse dns) of this dedicated IP
|
38 |
+
* - custom_dns struct information about the ip's custom dns, if it has been configured
|
39 |
+
* - enabled boolean a boolean indicating whether custom dns has been configured for this ip
|
40 |
+
* - valid boolean whether the ip's custom dns is currently valid
|
41 |
+
* - error string if the ip's custom dns is invalid, this will include details about the error
|
42 |
+
* - warmup struct information about the ip's warmup status
|
43 |
+
* - warming_up boolean whether the ip is currently in warmup mode
|
44 |
+
* - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
45 |
+
* - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
46 |
+
*/
|
47 |
+
public function info($ip) {
|
48 |
+
$_params = array("ip" => $ip);
|
49 |
+
return $this->master->call('ips/info', $_params);
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Requests an additional dedicated IP for your account. Accounts may
|
54 |
+
have one outstanding request at any time, and provisioning requests
|
55 |
+
are processed within 24 hours.
|
56 |
+
* @param boolean $warmup whether to enable warmup mode for the ip
|
57 |
+
* @param string $pool the id of the pool to add the dedicated ip to, or null to use your account's default pool
|
58 |
+
* @return struct a description of the provisioning request that was created
|
59 |
+
* - requested_at string the date and time that the request was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
|
60 |
+
*/
|
61 |
+
public function provision($warmup=false, $pool=null) {
|
62 |
+
$_params = array("warmup" => $warmup, "pool" => $pool);
|
63 |
+
return $this->master->call('ips/provision', $_params);
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Begins the warmup process for a dedicated IP. During the warmup process,
|
68 |
+
Mandrill will gradually increase the percentage of your mail that is sent over
|
69 |
+
the warming-up IP, over a period of roughly 30 days. The rest of your mail
|
70 |
+
will be sent over shared IPs or other dedicated IPs in the same pool.
|
71 |
+
* @param string $ip a dedicated ip address
|
72 |
+
* @return struct Information about the dedicated IP
|
73 |
+
* - ip string the ip address
|
74 |
+
* - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
75 |
+
* - pool string the name of the pool that this dedicated IP belongs to
|
76 |
+
* - domain string the domain name (reverse dns) of this dedicated IP
|
77 |
+
* - custom_dns struct information about the ip's custom dns, if it has been configured
|
78 |
+
* - enabled boolean a boolean indicating whether custom dns has been configured for this ip
|
79 |
+
* - valid boolean whether the ip's custom dns is currently valid
|
80 |
+
* - error string if the ip's custom dns is invalid, this will include details about the error
|
81 |
+
* - warmup struct information about the ip's warmup status
|
82 |
+
* - warming_up boolean whether the ip is currently in warmup mode
|
83 |
+
* - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
84 |
+
* - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
85 |
+
*/
|
86 |
+
public function startWarmup($ip) {
|
87 |
+
$_params = array("ip" => $ip);
|
88 |
+
return $this->master->call('ips/start-warmup', $_params);
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Cancels the warmup process for a dedicated IP.
|
93 |
+
* @param string $ip a dedicated ip address
|
94 |
+
* @return struct Information about the dedicated IP
|
95 |
+
* - ip string the ip address
|
96 |
+
* - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
97 |
+
* - pool string the name of the pool that this dedicated IP belongs to
|
98 |
+
* - domain string the domain name (reverse dns) of this dedicated IP
|
99 |
+
* - custom_dns struct information about the ip's custom dns, if it has been configured
|
100 |
+
* - enabled boolean a boolean indicating whether custom dns has been configured for this ip
|
101 |
+
* - valid boolean whether the ip's custom dns is currently valid
|
102 |
+
* - error string if the ip's custom dns is invalid, this will include details about the error
|
103 |
+
* - warmup struct information about the ip's warmup status
|
104 |
+
* - warming_up boolean whether the ip is currently in warmup mode
|
105 |
+
* - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
106 |
+
* - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
107 |
+
*/
|
108 |
+
public function cancelWarmup($ip) {
|
109 |
+
$_params = array("ip" => $ip);
|
110 |
+
return $this->master->call('ips/cancel-warmup', $_params);
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Moves a dedicated IP to a different pool.
|
115 |
+
* @param string $ip a dedicated ip address
|
116 |
+
* @param string $pool the name of the new pool to add the dedicated ip to
|
117 |
+
* @param boolean $create_pool whether to create the pool if it does not exist; if false and the pool does not exist, an Unknown_Pool will be thrown.
|
118 |
+
* @return struct Information about the updated state of the dedicated IP
|
119 |
+
* - ip string the ip address
|
120 |
+
* - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
121 |
+
* - pool string the name of the pool that this dedicated IP belongs to
|
122 |
+
* - domain string the domain name (reverse dns) of this dedicated IP
|
123 |
+
* - custom_dns struct information about the ip's custom dns, if it has been configured
|
124 |
+
* - enabled boolean a boolean indicating whether custom dns has been configured for this ip
|
125 |
+
* - valid boolean whether the ip's custom dns is currently valid
|
126 |
+
* - error string if the ip's custom dns is invalid, this will include details about the error
|
127 |
+
* - warmup struct information about the ip's warmup status
|
128 |
+
* - warming_up boolean whether the ip is currently in warmup mode
|
129 |
+
* - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
130 |
+
* - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
131 |
+
*/
|
132 |
+
public function setPool($ip, $pool, $create_pool=false) {
|
133 |
+
$_params = array("ip" => $ip, "pool" => $pool, "create_pool" => $create_pool);
|
134 |
+
return $this->master->call('ips/set-pool', $_params);
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Deletes a dedicated IP. This is permanent and cannot be undone.
|
139 |
+
* @param string $ip the dedicated ip to remove from your account
|
140 |
+
* @return struct a description of the ip that was removed from your account.
|
141 |
+
* - ip string the ip address
|
142 |
+
* - deleted string a boolean indicating whether the ip was successfully deleted
|
143 |
+
*/
|
144 |
+
public function delete($ip) {
|
145 |
+
$_params = array("ip" => $ip);
|
146 |
+
return $this->master->call('ips/delete', $_params);
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Lists your dedicated IP pools.
|
151 |
+
* @return array the dedicated IP pools for your account, up to a maximum of 1,000
|
152 |
+
* - return[] struct information about each dedicated IP pool
|
153 |
+
* - name string this pool's name
|
154 |
+
* - created_at string the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
|
155 |
+
* - ips array the dedicated IPs in this pool
|
156 |
+
* - ips[] struct information about each dedicated IP
|
157 |
+
* - ip string the ip address
|
158 |
+
* - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
159 |
+
* - pool string the name of the pool that this dedicated IP belongs to
|
160 |
+
* - domain string the domain name (reverse dns) of this dedicated IP
|
161 |
+
* - custom_dns struct information about the ip's custom dns, if it has been configured
|
162 |
+
* - enabled boolean a boolean indicating whether custom dns has been configured for this ip
|
163 |
+
* - valid boolean whether the ip's custom dns is currently valid
|
164 |
+
* - error string if the ip's custom dns is invalid, this will include details about the error
|
165 |
+
* - warmup struct information about the ip's warmup status
|
166 |
+
* - warming_up boolean whether the ip is currently in warmup mode
|
167 |
+
* - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
168 |
+
* - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
169 |
+
*/
|
170 |
+
public function listPools() {
|
171 |
+
$_params = array();
|
172 |
+
return $this->master->call('ips/list-pools', $_params);
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Describes a single dedicated IP pool.
|
177 |
+
* @param string $pool a pool name
|
178 |
+
* @return struct Information about the dedicated ip pool
|
179 |
+
* - name string this pool's name
|
180 |
+
* - created_at string the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
|
181 |
+
* - ips array the dedicated IPs in this pool
|
182 |
+
* - ips[] struct information about each dedicated IP
|
183 |
+
* - ip string the ip address
|
184 |
+
* - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
185 |
+
* - pool string the name of the pool that this dedicated IP belongs to
|
186 |
+
* - domain string the domain name (reverse dns) of this dedicated IP
|
187 |
+
* - custom_dns struct information about the ip's custom dns, if it has been configured
|
188 |
+
* - enabled boolean a boolean indicating whether custom dns has been configured for this ip
|
189 |
+
* - valid boolean whether the ip's custom dns is currently valid
|
190 |
+
* - error string if the ip's custom dns is invalid, this will include details about the error
|
191 |
+
* - warmup struct information about the ip's warmup status
|
192 |
+
* - warming_up boolean whether the ip is currently in warmup mode
|
193 |
+
* - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
194 |
+
* - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
195 |
+
*/
|
196 |
+
public function poolInfo($pool) {
|
197 |
+
$_params = array("pool" => $pool);
|
198 |
+
return $this->master->call('ips/pool-info', $_params);
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Creates a pool and returns it. If a pool already exists with this
|
203 |
+
name, no action will be performed.
|
204 |
+
* @param string $pool the name of a pool to create
|
205 |
+
* @return struct Information about the dedicated ip pool
|
206 |
+
* - name string this pool's name
|
207 |
+
* - created_at string the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
|
208 |
+
* - ips array the dedicated IPs in this pool
|
209 |
+
* - ips[] struct information about each dedicated IP
|
210 |
+
* - ip string the ip address
|
211 |
+
* - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
212 |
+
* - pool string the name of the pool that this dedicated IP belongs to
|
213 |
+
* - domain string the domain name (reverse dns) of this dedicated IP
|
214 |
+
* - custom_dns struct information about the ip's custom dns, if it has been configured
|
215 |
+
* - enabled boolean a boolean indicating whether custom dns has been configured for this ip
|
216 |
+
* - valid boolean whether the ip's custom dns is currently valid
|
217 |
+
* - error string if the ip's custom dns is invalid, this will include details about the error
|
218 |
+
* - warmup struct information about the ip's warmup status
|
219 |
+
* - warming_up boolean whether the ip is currently in warmup mode
|
220 |
+
* - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
221 |
+
* - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
222 |
+
*/
|
223 |
+
public function createPool($pool) {
|
224 |
+
$_params = array("pool" => $pool);
|
225 |
+
return $this->master->call('ips/create-pool', $_params);
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Deletes a pool. A pool must be empty before you can delete it, and you cannot delete your default pool.
|
230 |
+
* @param string $pool the name of the pool to delete
|
231 |
+
* @return struct information about the status of the pool that was deleted
|
232 |
+
* - pool string the name of the pool
|
233 |
+
* - deleted boolean whether the pool was deleted
|
234 |
+
*/
|
235 |
+
public function deletePool($pool) {
|
236 |
+
$_params = array("pool" => $pool);
|
237 |
+
return $this->master->call('ips/delete-pool', $_params);
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Tests whether a domain name is valid for use as the custom reverse
|
242 |
+
DNS for a dedicated IP.
|
243 |
+
* @param string $ip a dedicated ip address
|
244 |
+
* @param string $domain the domain name to test
|
245 |
+
* @return struct validation results for the domain
|
246 |
+
* - valid string whether the domain name has a correctly-configured A record pointing to the ip address
|
247 |
+
* - error string if valid is false, this will contain details about why the domain's A record is incorrect
|
248 |
+
*/
|
249 |
+
public function checkCustomDns($ip, $domain) {
|
250 |
+
$_params = array("ip" => $ip, "domain" => $domain);
|
251 |
+
return $this->master->call('ips/check-custom-dns', $_params);
|
252 |
+
}
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Configures the custom DNS name for a dedicated IP.
|
256 |
+
* @param string $ip a dedicated ip address
|
257 |
+
* @param string $domain a domain name to set as the dedicated IP's custom dns name.
|
258 |
+
* @return struct information about the dedicated IP's new configuration
|
259 |
+
* - ip string the ip address
|
260 |
+
* - created_at string the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
261 |
+
* - pool string the name of the pool that this dedicated IP belongs to
|
262 |
+
* - domain string the domain name (reverse dns) of this dedicated IP
|
263 |
+
* - custom_dns struct information about the ip's custom dns, if it has been configured
|
264 |
+
* - enabled boolean a boolean indicating whether custom dns has been configured for this ip
|
265 |
+
* - valid boolean whether the ip's custom dns is currently valid
|
266 |
+
* - error string if the ip's custom dns is invalid, this will include details about the error
|
267 |
+
* - warmup struct information about the ip's warmup status
|
268 |
+
* - warming_up boolean whether the ip is currently in warmup mode
|
269 |
+
* - start_at string the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
270 |
+
* - end_at string the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
|
271 |
+
*/
|
272 |
+
public function setCustomDns($ip, $domain) {
|
273 |
+
$_params = array("ip" => $ip, "domain" => $domain);
|
274 |
+
return $this->master->call('ips/set-custom-dns', $_params);
|
275 |
+
}
|
276 |
+
|
277 |
+
}
|
278 |
+
|
279 |
+
|
lib/Mandrill/Mandrill/Messages.php
ADDED
@@ -0,0 +1,408 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Messages {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Send a new transactional message through Mandrill
|
10 |
+
* @param struct $message the information on the message to send
|
11 |
+
* - html string the full HTML content to be sent
|
12 |
+
* - text string optional full text content to be sent
|
13 |
+
* - subject string the message subject
|
14 |
+
* - from_email string the sender email address.
|
15 |
+
* - from_name string optional from name to be used
|
16 |
+
* - to array an array of recipient information.
|
17 |
+
* - to[] struct a single recipient's information.
|
18 |
+
* - email string the email address of the recipient
|
19 |
+
* - name string the optional display name to use for the recipient
|
20 |
+
* - type string the header type to use for the recipient, defaults to "to" if not provided
|
21 |
+
* - headers struct optional extra headers to add to the message (most headers are allowed)
|
22 |
+
* - important boolean whether or not this message is important, and should be delivered ahead of non-important messages
|
23 |
+
* - track_opens boolean whether or not to turn on open tracking for the message
|
24 |
+
* - track_clicks boolean whether or not to turn on click tracking for the message
|
25 |
+
* - auto_text boolean whether or not to automatically generate a text part for messages that are not given text
|
26 |
+
* - auto_html boolean whether or not to automatically generate an HTML part for messages that are not given HTML
|
27 |
+
* - inline_css boolean whether or not to automatically inline all CSS styles provided in the message HTML - only for HTML documents less than 256KB in size
|
28 |
+
* - url_strip_qs boolean whether or not to strip the query string from URLs when aggregating tracked URL data
|
29 |
+
* - preserve_recipients boolean whether or not to expose all recipients in to "To" header for each email
|
30 |
+
* - view_content_link boolean set to false to remove content logging for sensitive emails
|
31 |
+
* - bcc_address string an optional address to receive an exact copy of each recipient's email
|
32 |
+
* - tracking_domain string a custom domain to use for tracking opens and clicks instead of mandrillapp.com
|
33 |
+
* - signing_domain string a custom domain to use for SPF/DKIM signing instead of mandrill (for "via" or "on behalf of" in email clients)
|
34 |
+
* - return_path_domain string a custom domain to use for the messages's return-path
|
35 |
+
* - merge boolean whether to evaluate merge tags in the message. Will automatically be set to true if either merge_vars or global_merge_vars are provided.
|
36 |
+
* - global_merge_vars array global merge variables to use for all recipients. You can override these per recipient.
|
37 |
+
* - global_merge_vars[] struct a single global merge variable
|
38 |
+
* - name string the global merge variable's name. Merge variable names are case-insensitive and may not start with _
|
39 |
+
* - content string the global merge variable's content
|
40 |
+
* - merge_vars array per-recipient merge variables, which override global merge variables with the same name.
|
41 |
+
* - merge_vars[] struct per-recipient merge variables
|
42 |
+
* - rcpt string the email address of the recipient that the merge variables should apply to
|
43 |
+
* - vars array the recipient's merge variables
|
44 |
+
* - vars[] struct a single merge variable
|
45 |
+
* - name string the merge variable's name. Merge variable names are case-insensitive and may not start with _
|
46 |
+
* - content string the merge variable's content
|
47 |
+
* - tags array an array of string to tag the message with. Stats are accumulated using tags, though we only store the first 100 we see, so this should not be unique or change frequently. Tags should be 50 characters or less. Any tags starting with an underscore are reserved for internal use and will cause errors.
|
48 |
+
* - tags[] string a single tag - must not start with an underscore
|
49 |
+
* - subaccount string the unique id of a subaccount for this message - must already exist or will fail with an error
|
50 |
+
* - google_analytics_domains array an array of strings indicating for which any matching URLs will automatically have Google Analytics parameters appended to their query string automatically.
|
51 |
+
* - google_analytics_campaign array|string optional string indicating the value to set for the utm_campaign tracking parameter. If this isn't provided the email's from address will be used instead.
|
52 |
+
* - metadata array metadata an associative array of user metadata. Mandrill will store this metadata and make it available for retrieval. In addition, you can select up to 10 metadata fields to index and make searchable using the Mandrill search api.
|
53 |
+
* - recipient_metadata array Per-recipient metadata that will override the global values specified in the metadata parameter.
|
54 |
+
* - recipient_metadata[] struct metadata for a single recipient
|
55 |
+
* - rcpt string the email address of the recipient that the metadata is associated with
|
56 |
+
* - values array an associated array containing the recipient's unique metadata. If a key exists in both the per-recipient metadata and the global metadata, the per-recipient metadata will be used.
|
57 |
+
* - attachments array an array of supported attachments to add to the message
|
58 |
+
* - attachments[] struct a single supported attachment
|
59 |
+
* - type string the MIME type of the attachment
|
60 |
+
* - name string the file name of the attachment
|
61 |
+
* - content string the content of the attachment as a base64-encoded string
|
62 |
+
* - images array an array of embedded images to add to the message
|
63 |
+
* - images[] struct a single embedded image
|
64 |
+
* - type string the MIME type of the image - must start with "image/"
|
65 |
+
* - name string the Content ID of the image - use <img src="cid:THIS_VALUE"> to reference the image in your HTML content
|
66 |
+
* - content string the content of the image as a base64-encoded string
|
67 |
+
* @param boolean $async enable a background sending mode that is optimized for bulk sending. In async mode, messages/send will immediately return a status of "queued" for every recipient. To handle rejections when sending in async mode, set up a webhook for the 'reject' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async.
|
68 |
+
* @param string $ip_pool the name of the dedicated ip pool that should be used to send the message. If you do not have any dedicated IPs, this parameter has no effect. If you specify a pool that does not exist, your default pool will be used instead.
|
69 |
+
* @param string $send_at when this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format. If you specify a time in the past, the message will be sent immediately. An additional fee applies for scheduled email, and this feature is only available to accounts with a positive balance.
|
70 |
+
* @return array of structs for each recipient containing the key "email" with the email address, and details of the message status for that recipient
|
71 |
+
* - return[] struct the sending results for a single recipient
|
72 |
+
* - email string the email address of the recipient
|
73 |
+
* - status string the sending status of the recipient - either "sent", "queued", "scheduled", "rejected", or "invalid"
|
74 |
+
* - reject_reason string the reason for the rejection if the recipient status is "rejected" - one of "hard-bounce", "soft-bounce", "spam", "unsub", "custom", "invalid-sender", "invalid", "test-mode-limit", or "rule"
|
75 |
+
* - _id string the message's unique id
|
76 |
+
*/
|
77 |
+
public function send($message, $async=false, $ip_pool=null, $send_at=null) {
|
78 |
+
$_params = array("message" => $message, "async" => $async, "ip_pool" => $ip_pool, "send_at" => $send_at);
|
79 |
+
return $this->master->call('messages/send', $_params);
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Send a new transactional message through Mandrill using a template
|
84 |
+
* @param string $template_name the immutable name or slug of a template that exists in the user's account. For backwards-compatibility, the template name may also be used but the immutable slug is preferred.
|
85 |
+
* @param array $template_content an array of template content to send. Each item in the array should be a struct with two keys - name: the name of the content block to set the content for, and content: the actual content to put into the block
|
86 |
+
* - template_content[] struct the injection of a single piece of content into a single editable region
|
87 |
+
* - name string the name of the mc:edit editable region to inject into
|
88 |
+
* - content string the content to inject
|
89 |
+
* @param struct $message the other information on the message to send - same as /messages/send, but without the html content
|
90 |
+
* - html string optional full HTML content to be sent if not in template
|
91 |
+
* - text string optional full text content to be sent
|
92 |
+
* - subject string the message subject
|
93 |
+
* - from_email string the sender email address.
|
94 |
+
* - from_name string optional from name to be used
|
95 |
+
* - to array an array of recipient information.
|
96 |
+
* - to[] struct a single recipient's information.
|
97 |
+
* - email string the email address of the recipient
|
98 |
+
* - name string the optional display name to use for the recipient
|
99 |
+
* - type string the header type to use for the recipient, defaults to "to" if not provided
|
100 |
+
* - headers struct optional extra headers to add to the message (most headers are allowed)
|
101 |
+
* - important boolean whether or not this message is important, and should be delivered ahead of non-important messages
|
102 |
+
* - track_opens boolean whether or not to turn on open tracking for the message
|
103 |
+
* - track_clicks boolean whether or not to turn on click tracking for the message
|
104 |
+
* - auto_text boolean whether or not to automatically generate a text part for messages that are not given text
|
105 |
+
* - auto_html boolean whether or not to automatically generate an HTML part for messages that are not given HTML
|
106 |
+
* - inline_css boolean whether or not to automatically inline all CSS styles provided in the message HTML - only for HTML documents less than 256KB in size
|
107 |
+
* - url_strip_qs boolean whether or not to strip the query string from URLs when aggregating tracked URL data
|
108 |
+
* - preserve_recipients boolean whether or not to expose all recipients in to "To" header for each email
|
109 |
+
* - view_content_link boolean set to false to remove content logging for sensitive emails
|
110 |
+
* - bcc_address string an optional address to receive an exact copy of each recipient's email
|
111 |
+
* - tracking_domain string a custom domain to use for tracking opens and clicks instead of mandrillapp.com
|
112 |
+
* - signing_domain string a custom domain to use for SPF/DKIM signing instead of mandrill (for "via" or "on behalf of" in email clients)
|
113 |
+
* - return_path_domain string a custom domain to use for the messages's return-path
|
114 |
+
* - merge boolean whether to evaluate merge tags in the message. Will automatically be set to true if either merge_vars or global_merge_vars are provided.
|
115 |
+
* - global_merge_vars array global merge variables to use for all recipients. You can override these per recipient.
|
116 |
+
* - global_merge_vars[] struct a single global merge variable
|
117 |
+
* - name string the global merge variable's name. Merge variable names are case-insensitive and may not start with _
|
118 |
+
* - content string the global merge variable's content
|
119 |
+
* - merge_vars array per-recipient merge variables, which override global merge variables with the same name.
|
120 |
+
* - merge_vars[] struct per-recipient merge variables
|
121 |
+
* - rcpt string the email address of the recipient that the merge variables should apply to
|
122 |
+
* - vars array the recipient's merge variables
|
123 |
+
* - vars[] struct a single merge variable
|
124 |
+
* - name string the merge variable's name. Merge variable names are case-insensitive and may not start with _
|
125 |
+
* - content string the merge variable's content
|
126 |
+
* - tags array an array of string to tag the message with. Stats are accumulated using tags, though we only store the first 100 we see, so this should not be unique or change frequently. Tags should be 50 characters or less. Any tags starting with an underscore are reserved for internal use and will cause errors.
|
127 |
+
* - tags[] string a single tag - must not start with an underscore
|
128 |
+
* - subaccount string the unique id of a subaccount for this message - must already exist or will fail with an error
|
129 |
+
* - google_analytics_domains array an array of strings indicating for which any matching URLs will automatically have Google Analytics parameters appended to their query string automatically.
|
130 |
+
* - google_analytics_campaign array|string optional string indicating the value to set for the utm_campaign tracking parameter. If this isn't provided the email's from address will be used instead.
|
131 |
+
* - metadata array metadata an associative array of user metadata. Mandrill will store this metadata and make it available for retrieval. In addition, you can select up to 10 metadata fields to index and make searchable using the Mandrill search api.
|
132 |
+
* - recipient_metadata array Per-recipient metadata that will override the global values specified in the metadata parameter.
|
133 |
+
* - recipient_metadata[] struct metadata for a single recipient
|
134 |
+
* - rcpt string the email address of the recipient that the metadata is associated with
|
135 |
+
* - values array an associated array containing the recipient's unique metadata. If a key exists in both the per-recipient metadata and the global metadata, the per-recipient metadata will be used.
|
136 |
+
* - attachments array an array of supported attachments to add to the message
|
137 |
+
* - attachments[] struct a single supported attachment
|
138 |
+
* - type string the MIME type of the attachment
|
139 |
+
* - name string the file name of the attachment
|
140 |
+
* - content string the content of the attachment as a base64-encoded string
|
141 |
+
* - images array an array of embedded images to add to the message
|
142 |
+
* - images[] struct a single embedded image
|
143 |
+
* - type string the MIME type of the image - must start with "image/"
|
144 |
+
* - name string the Content ID of the image - use <img src="cid:THIS_VALUE"> to reference the image in your HTML content
|
145 |
+
* - content string the content of the image as a base64-encoded string
|
146 |
+
* @param boolean $async enable a background sending mode that is optimized for bulk sending. In async mode, messages/send will immediately return a status of "queued" for every recipient. To handle rejections when sending in async mode, set up a webhook for the 'reject' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async.
|
147 |
+
* @param string $ip_pool the name of the dedicated ip pool that should be used to send the message. If you do not have any dedicated IPs, this parameter has no effect. If you specify a pool that does not exist, your default pool will be used instead.
|
148 |
+
* @param string $send_at when this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format. If you specify a time in the past, the message will be sent immediately. An additional fee applies for scheduled email, and this feature is only available to accounts with a positive balance.
|
149 |
+
* @return array of structs for each recipient containing the key "email" with the email address, and details of the message status for that recipient
|
150 |
+
* - return[] struct the sending results for a single recipient
|
151 |
+
* - email string the email address of the recipient
|
152 |
+
* - status string the sending status of the recipient - either "sent", "queued", "rejected", or "invalid"
|
153 |
+
* - reject_reason string the reason for the rejection if the recipient status is "rejected" - one of "hard-bounce", "soft-bounce", "spam", "unsub", "custom", "invalid-sender", "invalid", "test-mode-limit", or "rule"
|
154 |
+
* - _id string the message's unique id
|
155 |
+
*/
|
156 |
+
public function sendTemplate($template_name, $template_content, $message, $async=false, $ip_pool=null, $send_at=null) {
|
157 |
+
$_params = array("template_name" => $template_name, "template_content" => $template_content, "message" => $message, "async" => $async, "ip_pool" => $ip_pool, "send_at" => $send_at);
|
158 |
+
return $this->master->call('messages/send-template', $_params);
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Search recently sent messages and optionally narrow by date range, tags, senders, and API keys. If no date range is specified, results within the last 7 days are returned. This method may be called up to 20 times per minute. If you need the data more often, you can use <a href="/api/docs/messages.html#method=info">/messages/info.json</a> to get the information for a single message, or <a href="http://help.mandrill.com/entries/21738186-Introduction-to-Webhooks">webhooks</a> to push activity to your own application for querying.
|
163 |
+
* @param string $query <a href="http://help.mandrill.com/entries/22211902">search terms</a> to find matching messages
|
164 |
+
* @param string $date_from start date
|
165 |
+
* @param string $date_to end date
|
166 |
+
* @param array $tags an array of tag names to narrow the search to, will return messages that contain ANY of the tags
|
167 |
+
* @param array $senders an array of sender addresses to narrow the search to, will return messages sent by ANY of the senders
|
168 |
+
* @param array $api_keys an array of API keys to narrow the search to, will return messages sent by ANY of the keys
|
169 |
+
* @param integer $limit the maximum number of results to return, defaults to 100, 1000 is the maximum
|
170 |
+
* @return array of structs for each matching message
|
171 |
+
* - return[] struct the information for a single matching message
|
172 |
+
* - ts integer the Unix timestamp from when this message was sent
|
173 |
+
* - _id string the message's unique id
|
174 |
+
* - sender string the email address of the sender
|
175 |
+
* - template string the unique name of the template used, if any
|
176 |
+
* - subject string the message's subject line
|
177 |
+
* - email string the recipient email address
|
178 |
+
* - tags array list of tags on this message
|
179 |
+
* - tags[] string individual tag on this message
|
180 |
+
* - opens integer how many times has this message been opened
|
181 |
+
* - opens_detail array list of individual opens for the message
|
182 |
+
* - opens_detail[] struct information on an individual open
|
183 |
+
* - ts integer the unix timestamp from when the message was opened
|
184 |
+
* - ip string the IP address that generated the open
|
185 |
+
* - location string the approximate region and country that the opening IP is located
|
186 |
+
* - ua string the email client or browser data of the open
|
187 |
+
* - clicks integer how many times has a link been clicked in this message
|
188 |
+
* - clicks_detail array list of individual clicks for the message
|
189 |
+
* - clicks_detail[] struct information on an individual click
|
190 |
+
* - ts integer the unix timestamp from when the message was clicked
|
191 |
+
* - url string the URL that was clicked on
|
192 |
+
* - ip string the IP address that generated the click
|
193 |
+
* - location string the approximate region and country that the clicking IP is located
|
194 |
+
* - ua string the email client or browser data of the click
|
195 |
+
* - state string sending status of this message: sent, bounced, rejected
|
196 |
+
* - metadata struct any custom metadata provided when the message was sent
|
197 |
+
* - smtp_events array a log of up to 3 smtp events for the message
|
198 |
+
* - smtp_events[] struct information about a specific smtp event
|
199 |
+
* - ts integer the Unix timestamp when the event occured
|
200 |
+
* - type string the message's state as a result of this event
|
201 |
+
* - diag string the SMTP response from the recipient's server
|
202 |
+
*/
|
203 |
+
public function search($query='*', $date_from=null, $date_to=null, $tags=null, $senders=null, $api_keys=null, $limit=100) {
|
204 |
+
$_params = array("query" => $query, "date_from" => $date_from, "date_to" => $date_to, "tags" => $tags, "senders" => $senders, "api_keys" => $api_keys, "limit" => $limit);
|
205 |
+
return $this->master->call('messages/search', $_params);
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Search the content of recently sent messages and return the aggregated hourly stats for matching messages
|
210 |
+
* @param string $query the search terms to find matching messages for
|
211 |
+
* @param string $date_from start date
|
212 |
+
* @param string $date_to end date
|
213 |
+
* @param array $tags an array of tag names to narrow the search to, will return messages that contain ANY of the tags
|
214 |
+
* @param array $senders an array of sender addresses to narrow the search to, will return messages sent by ANY of the senders
|
215 |
+
* @return array the array of history information
|
216 |
+
* - return[] struct the stats for a single hour
|
217 |
+
* - time string the hour as a UTC date string in YYYY-MM-DD HH:MM:SS format
|
218 |
+
* - sent integer the number of emails that were sent during the hour
|
219 |
+
* - hard_bounces integer the number of emails that hard bounced during the hour
|
220 |
+
* - soft_bounces integer the number of emails that soft bounced during the hour
|
221 |
+
* - rejects integer the number of emails that were rejected during the hour
|
222 |
+
* - complaints integer the number of spam complaints received during the hour
|
223 |
+
* - unsubs integer the number of unsubscribes received during the hour
|
224 |
+
* - opens integer the number of emails opened during the hour
|
225 |
+
* - unique_opens integer the number of unique opens generated by messages sent during the hour
|
226 |
+
* - clicks integer the number of tracked URLs clicked during the hour
|
227 |
+
* - unique_clicks integer the number of unique clicks generated by messages sent during the hour
|
228 |
+
*/
|
229 |
+
public function searchTimeSeries($query='*', $date_from=null, $date_to=null, $tags=null, $senders=null) {
|
230 |
+
$_params = array("query" => $query, "date_from" => $date_from, "date_to" => $date_to, "tags" => $tags, "senders" => $senders);
|
231 |
+
return $this->master->call('messages/search-time-series', $_params);
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Get the information for a single recently sent message
|
236 |
+
* @param string $id the unique id of the message to get - passed as the "_id" field in webhooks, send calls, or search calls
|
237 |
+
* @return struct the information for the message
|
238 |
+
* - ts integer the Unix timestamp from when this message was sent
|
239 |
+
* - _id string the message's unique id
|
240 |
+
* - sender string the email address of the sender
|
241 |
+
* - template string the unique name of the template used, if any
|
242 |
+
* - subject string the message's subject line
|
243 |
+
* - email string the recipient email address
|
244 |
+
* - tags array list of tags on this message
|
245 |
+
* - tags[] string individual tag on this message
|
246 |
+
* - opens integer how many times has this message been opened
|
247 |
+
* - opens_detail array list of individual opens for the message
|
248 |
+
* - opens_detail[] struct information on an individual open
|
249 |
+
* - ts integer the unix timestamp from when the message was opened
|
250 |
+
* - ip string the IP address that generated the open
|
251 |
+
* - location string the approximate region and country that the opening IP is located
|
252 |
+
* - ua string the email client or browser data of the open
|
253 |
+
* - clicks integer how many times has a link been clicked in this message
|
254 |
+
* - clicks_detail array list of individual clicks for the message
|
255 |
+
* - clicks_detail[] struct information on an individual click
|
256 |
+
* - ts integer the unix timestamp from when the message was clicked
|
257 |
+
* - url string the URL that was clicked on
|
258 |
+
* - ip string the IP address that generated the click
|
259 |
+
* - location string the approximate region and country that the clicking IP is located
|
260 |
+
* - ua string the email client or browser data of the click
|
261 |
+
* - state string sending status of this message: sent, bounced, rejected
|
262 |
+
* - metadata struct any custom metadata provided when the message was sent
|
263 |
+
* - smtp_events array a log of up to 3 smtp events for the message
|
264 |
+
* - smtp_events[] struct information about a specific smtp event
|
265 |
+
* - ts integer the Unix timestamp when the event occured
|
266 |
+
* - type string the message's state as a result of this event
|
267 |
+
* - diag string the SMTP response from the recipient's server
|
268 |
+
*/
|
269 |
+
public function info($id) {
|
270 |
+
$_params = array("id" => $id);
|
271 |
+
return $this->master->call('messages/info', $_params);
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Get the full content of a recently sent message
|
276 |
+
* @param string $id the unique id of the message to get - passed as the "_id" field in webhooks, send calls, or search calls
|
277 |
+
* @return struct the content of the message
|
278 |
+
* - ts integer the Unix timestamp from when this message was sent
|
279 |
+
* - _id string the message's unique id
|
280 |
+
* - from_email string the email address of the sender
|
281 |
+
* - from_name string the alias of the sender (if any)
|
282 |
+
* - subject string the message's subject line
|
283 |
+
* - to struct the message recipient's information
|
284 |
+
* - email string the email address of the recipient
|
285 |
+
* - name string the alias of the recipient (if any)
|
286 |
+
* - tags array list of tags on this message
|
287 |
+
* - tags[] string individual tag on this message
|
288 |
+
* - headers struct the key-value pairs of the custom MIME headers for the message's main document
|
289 |
+
* - text string the text part of the message, if any
|
290 |
+
* - html string the HTML part of the message, if any
|
291 |
+
* - attachments array an array of any attachments that can be found in the message
|
292 |
+
* - attachments[] struct information about an individual attachment
|
293 |
+
* - name string the file name of the attachment
|
294 |
+
* - type string the MIME type of the attachment
|
295 |
+
* - content string the content of the attachment as a base64 encoded string
|
296 |
+
*/
|
297 |
+
public function content($id) {
|
298 |
+
$_params = array("id" => $id);
|
299 |
+
return $this->master->call('messages/content', $_params);
|
300 |
+
}
|
301 |
+
|
302 |
+
/**
|
303 |
+
* Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces
|
304 |
+
* @param string $raw_message the full MIME document of an email message
|
305 |
+
* @return struct the parsed message
|
306 |
+
* - subject string the subject of the message
|
307 |
+
* - from_email string the email address of the sender
|
308 |
+
* - from_name string the alias of the sender (if any)
|
309 |
+
* - to array an array of any recipients in the message
|
310 |
+
* - to[] struct the information on a single recipient
|
311 |
+
* - email string the email address of the recipient
|
312 |
+
* - name string the alias of the recipient (if any)
|
313 |
+
* - headers struct the key-value pairs of the MIME headers for the message's main document
|
314 |
+
* - text string the text part of the message, if any
|
315 |
+
* - html string the HTML part of the message, if any
|
316 |
+
* - attachments array an array of any attachments that can be found in the message
|
317 |
+
* - attachments[] struct information about an individual attachment
|
318 |
+
* - name string the file name of the attachment
|
319 |
+
* - type string the MIME type of the attachment
|
320 |
+
* - binary boolean if this is set to true, the attachment is not pure-text, and the content will be base64 encoded
|
321 |
+
* - content string the content of the attachment as a text string or a base64 encoded string based on the attachment type
|
322 |
+
* - images array an array of any embedded images that can be found in the message
|
323 |
+
* - images[] struct information about an individual image
|
324 |
+
* - name string the Content-ID of the embedded image
|
325 |
+
* - type string the MIME type of the image
|
326 |
+
* - content string the content of the image as a base64 encoded string
|
327 |
+
*/
|
328 |
+
public function parse($raw_message) {
|
329 |
+
$_params = array("raw_message" => $raw_message);
|
330 |
+
return $this->master->call('messages/parse', $_params);
|
331 |
+
}
|
332 |
+
|
333 |
+
/**
|
334 |
+
* Take a raw MIME document for a message, and send it exactly as if it were sent through Mandrill's SMTP servers
|
335 |
+
* @param string $raw_message the full MIME document of an email message
|
336 |
+
* @param string|null $from_email optionally define the sender address - otherwise we'll use the address found in the provided headers
|
337 |
+
* @param string|null $from_name optionally define the sender alias
|
338 |
+
* @param array|null $to optionally define the recipients to receive the message - otherwise we'll use the To, Cc, and Bcc headers provided in the document
|
339 |
+
* - to[] string the email address of the recipient
|
340 |
+
* @param boolean $async enable a background sending mode that is optimized for bulk sending. In async mode, messages/sendRaw will immediately return a status of "queued" for every recipient. To handle rejections when sending in async mode, set up a webhook for the 'reject' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async.
|
341 |
+
* @param string $ip_pool the name of the dedicated ip pool that should be used to send the message. If you do not have any dedicated IPs, this parameter has no effect. If you specify a pool that does not exist, your default pool will be used instead.
|
342 |
+
* @param string $send_at when this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format. If you specify a time in the past, the message will be sent immediately.
|
343 |
+
* @param string $return_path_domain a custom domain to use for the messages's return-path
|
344 |
+
* @return array of structs for each recipient containing the key "email" with the email address, and details of the message status for that recipient
|
345 |
+
* - return[] struct the sending results for a single recipient
|
346 |
+
* - email string the email address of the recipient
|
347 |
+
* - status string the sending status of the recipient - either "sent", "queued", "scheduled", "rejected", or "invalid"
|
348 |
+
* - reject_reason string the reason for the rejection if the recipient status is "rejected" - one of "hard-bounce", "soft-bounce", "spam", "unsub", "custom", "invalid-sender", "invalid", "test-mode-limit", or "rule"
|
349 |
+
* - _id string the message's unique id
|
350 |
+
*/
|
351 |
+
public function sendRaw($raw_message, $from_email=null, $from_name=null, $to=null, $async=false, $ip_pool=null, $send_at=null, $return_path_domain=null) {
|
352 |
+
$_params = array("raw_message" => $raw_message, "from_email" => $from_email, "from_name" => $from_name, "to" => $to, "async" => $async, "ip_pool" => $ip_pool, "send_at" => $send_at, "return_path_domain" => $return_path_domain);
|
353 |
+
return $this->master->call('messages/send-raw', $_params);
|
354 |
+
}
|
355 |
+
|
356 |
+
/**
|
357 |
+
* Queries your scheduled emails by sender or recipient, or both.
|
358 |
+
* @param string $to an optional recipient address to restrict results to
|
359 |
+
* @return array a list of up to 1000 scheduled emails
|
360 |
+
* - return[] struct a scheduled email
|
361 |
+
* - _id string the scheduled message id
|
362 |
+
* - created_at string the UTC timestamp when the message was created, in YYYY-MM-DD HH:MM:SS format
|
363 |
+
* - send_at string the UTC timestamp when the message will be sent, in YYYY-MM-DD HH:MM:SS format
|
364 |
+
* - from_email string the email's sender address
|
365 |
+
* - to string the email's recipient
|
366 |
+
* - subject string the email's subject
|
367 |
+
*/
|
368 |
+
public function listScheduled($to=null) {
|
369 |
+
$_params = array("to" => $to);
|
370 |
+
return $this->master->call('messages/list-scheduled', $_params);
|
371 |
+
}
|
372 |
+
|
373 |
+
/**
|
374 |
+
* Cancels a scheduled email.
|
375 |
+
* @param string $id a scheduled email id, as returned by any of the messages/send calls or messages/list-scheduled
|
376 |
+
* @return struct information about the scheduled email that was cancelled.
|
377 |
+
* - _id string the scheduled message id
|
378 |
+
* - created_at string the UTC timestamp when the message was created, in YYYY-MM-DD HH:MM:SS format
|
379 |
+
* - send_at string the UTC timestamp when the message will be sent, in YYYY-MM-DD HH:MM:SS format
|
380 |
+
* - from_email string the email's sender address
|
381 |
+
* - to string the email's recipient
|
382 |
+
* - subject string the email's subject
|
383 |
+
*/
|
384 |
+
public function cancelScheduled($id) {
|
385 |
+
$_params = array("id" => $id);
|
386 |
+
return $this->master->call('messages/cancel-scheduled', $_params);
|
387 |
+
}
|
388 |
+
|
389 |
+
/**
|
390 |
+
* Reschedules a scheduled email.
|
391 |
+
* @param string $id a scheduled email id, as returned by any of the messages/send calls or messages/list-scheduled
|
392 |
+
* @param string $send_at the new UTC timestamp when the message should sent. Mandrill can't time travel, so if you specify a time in past the message will be sent immediately
|
393 |
+
* @return struct information about the scheduled email that was rescheduled.
|
394 |
+
* - _id string the scheduled message id
|
395 |
+
* - created_at string the UTC timestamp when the message was created, in YYYY-MM-DD HH:MM:SS format
|
396 |
+
* - send_at string the UTC timestamp when the message will be sent, in YYYY-MM-DD HH:MM:SS format
|
397 |
+
* - from_email string the email's sender address
|
398 |
+
* - to string the email's recipient
|
399 |
+
* - subject string the email's subject
|
400 |
+
*/
|
401 |
+
public function reschedule($id, $send_at) {
|
402 |
+
$_params = array("id" => $id, "send_at" => $send_at);
|
403 |
+
return $this->master->call('messages/reschedule', $_params);
|
404 |
+
}
|
405 |
+
|
406 |
+
}
|
407 |
+
|
408 |
+
|
lib/Mandrill/Mandrill/Metadata.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Metadata {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Get the list of custom metadata fields indexed for the account.
|
10 |
+
* @return array the custom metadata fields for the account
|
11 |
+
* - return[] struct the individual custom metadata field info
|
12 |
+
* - name string the unique identifier of the metadata field to update
|
13 |
+
* - state string the current state of the metadata field, one of "active", "delete", or "index"
|
14 |
+
* - view_template string Mustache template to control how the metadata is rendered in your activity log
|
15 |
+
*/
|
16 |
+
public function getList() {
|
17 |
+
$_params = array();
|
18 |
+
return $this->master->call('metadata/list', $_params);
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Add a new custom metadata field to be indexed for the account.
|
23 |
+
* @param string $name a unique identifier for the metadata field
|
24 |
+
* @param string $view_template optional Mustache template to control how the metadata is rendered in your activity log
|
25 |
+
* @return struct the information saved about the new metadata field
|
26 |
+
* - name string the unique identifier of the metadata field to update
|
27 |
+
* - state string the current state of the metadata field, one of "active", "delete", or "index"
|
28 |
+
* - view_template string Mustache template to control how the metadata is rendered in your activity log
|
29 |
+
*/
|
30 |
+
public function add($name, $view_template=null) {
|
31 |
+
$_params = array("name" => $name, "view_template" => $view_template);
|
32 |
+
return $this->master->call('metadata/add', $_params);
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Update an existing custom metadata field.
|
37 |
+
* @param string $name the unique identifier of the metadata field to update
|
38 |
+
* @param string $view_template optional Mustache template to control how the metadata is rendered in your activity log
|
39 |
+
* @return struct the information for the updated metadata field
|
40 |
+
* - name string the unique identifier of the metadata field to update
|
41 |
+
* - state string the current state of the metadata field, one of "active", "delete", or "index"
|
42 |
+
* - view_template string Mustache template to control how the metadata is rendered in your activity log
|
43 |
+
*/
|
44 |
+
public function update($name, $view_template) {
|
45 |
+
$_params = array("name" => $name, "view_template" => $view_template);
|
46 |
+
return $this->master->call('metadata/update', $_params);
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Delete an existing custom metadata field. Deletion isn't instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete.
|
51 |
+
* @param string $name the unique identifier of the metadata field to update
|
52 |
+
* @return struct the information for the deleted metadata field
|
53 |
+
* - name string the unique identifier of the metadata field to update
|
54 |
+
* - state string the current state of the metadata field, one of "active", "delete", or "index"
|
55 |
+
* - view_template string Mustache template to control how the metadata is rendered in your activity log
|
56 |
+
*/
|
57 |
+
public function delete($name) {
|
58 |
+
$_params = array("name" => $name);
|
59 |
+
return $this->master->call('metadata/delete', $_params);
|
60 |
+
}
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
|
lib/Mandrill/Mandrill/Rejects.php
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Rejects {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Adds an email to your email rejection blacklist. Addresses that you
|
10 |
+
add manually will never expire and there is no reputation penalty
|
11 |
+
for removing them from your blacklist. Attempting to blacklist an
|
12 |
+
address that has been whitelisted will have no effect.
|
13 |
+
* @param string $email an email address to block
|
14 |
+
* @param string $comment an optional comment describing the rejection
|
15 |
+
* @param string $subaccount an optional unique identifier for the subaccount to limit the blacklist entry
|
16 |
+
* @return struct a status object containing the address and the result of the operation
|
17 |
+
* - email string the email address you provided
|
18 |
+
* - added boolean whether the operation succeeded
|
19 |
+
*/
|
20 |
+
public function add($email, $comment=null, $subaccount=null) {
|
21 |
+
$_params = array("email" => $email, "comment" => $comment, "subaccount" => $subaccount);
|
22 |
+
return $this->master->call('rejects/add', $_params);
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Retrieves your email rejection blacklist. You can provide an email
|
27 |
+
address to limit the results. Returns up to 1000 results. By default,
|
28 |
+
entries that have expired are excluded from the results; set
|
29 |
+
include_expired to true to include them.
|
30 |
+
* @param string $email an optional email address to search by
|
31 |
+
* @param boolean $include_expired whether to include rejections that have already expired.
|
32 |
+
* @param string $subaccount an optional unique identifier for the subaccount to limit the blacklist
|
33 |
+
* @return array Up to 1000 rejection entries
|
34 |
+
* - return[] struct the information for each rejection blacklist entry
|
35 |
+
* - email string the email that is blocked
|
36 |
+
* - reason string the type of event (hard-bounce, soft-bounce, spam, unsub, custom) that caused this rejection
|
37 |
+
* - detail string extended details about the event, such as the SMTP diagnostic for bounces or the comment for manually-created rejections
|
38 |
+
* - created_at string when the email was added to the blacklist
|
39 |
+
* - last_event_at string the timestamp of the most recent event that either created or renewed this rejection
|
40 |
+
* - expires_at string when the blacklist entry will expire (this may be in the past)
|
41 |
+
* - expired boolean whether the blacklist entry has expired
|
42 |
+
* - sender struct the sender that this blacklist entry applies to, or null if none.
|
43 |
+
* - address string the sender's email address
|
44 |
+
* - created_at string the date and time that the sender was first seen by Mandrill as a UTC date string in YYYY-MM-DD HH:MM:SS format
|
45 |
+
* - sent integer the total number of messages sent by this sender
|
46 |
+
* - hard_bounces integer the total number of hard bounces by messages by this sender
|
47 |
+
* - soft_bounces integer the total number of soft bounces by messages by this sender
|
48 |
+
* - rejects integer the total number of rejected messages by this sender
|
49 |
+
* - complaints integer the total number of spam complaints received for messages by this sender
|
50 |
+
* - unsubs integer the total number of unsubscribe requests received for messages by this sender
|
51 |
+
* - opens integer the total number of times messages by this sender have been opened
|
52 |
+
* - clicks integer the total number of times tracked URLs in messages by this sender have been clicked
|
53 |
+
* - unique_opens integer the number of unique opens for emails sent for this sender
|
54 |
+
* - unique_clicks integer the number of unique clicks for emails sent for this sender
|
55 |
+
* - subaccount string the subaccount that this blacklist entry applies to, or null if none.
|
56 |
+
*/
|
57 |
+
public function getList($email=null, $include_expired=false, $subaccount=null) {
|
58 |
+
$_params = array("email" => $email, "include_expired" => $include_expired, "subaccount" => $subaccount);
|
59 |
+
return $this->master->call('rejects/list', $_params);
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Deletes an email rejection. There is no limit to how many rejections
|
64 |
+
you can remove from your blacklist, but keep in mind that each deletion
|
65 |
+
has an affect on your reputation.
|
66 |
+
* @param string $email an email address
|
67 |
+
* @param string $subaccount an optional unique identifier for the subaccount to limit the blacklist deletion
|
68 |
+
* @return struct a status object containing the address and whether the deletion succeeded.
|
69 |
+
* - email string the email address that was removed from the blacklist
|
70 |
+
* - deleted boolean whether the address was deleted successfully.
|
71 |
+
* - subaccount string the subaccount blacklist that the address was removed from, if any
|
72 |
+
*/
|
73 |
+
public function delete($email, $subaccount=null) {
|
74 |
+
$_params = array("email" => $email, "subaccount" => $subaccount);
|
75 |
+
return $this->master->call('rejects/delete', $_params);
|
76 |
+
}
|
77 |
+
|
78 |
+
}
|
79 |
+
|
80 |
+
|
lib/Mandrill/Mandrill/Senders.php
ADDED
@@ -0,0 +1,218 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Senders {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Return the senders that have tried to use this account.
|
10 |
+
* @return array an array of sender data, one for each sending addresses used by the account
|
11 |
+
* - return[] struct the information on each sending address in the account
|
12 |
+
* - address string the sender's email address
|
13 |
+
* - created_at string the date and time that the sender was first seen by Mandrill as a UTC date string in YYYY-MM-DD HH:MM:SS format
|
14 |
+
* - sent integer the total number of messages sent by this sender
|
15 |
+
* - hard_bounces integer the total number of hard bounces by messages by this sender
|
16 |
+
* - soft_bounces integer the total number of soft bounces by messages by this sender
|
17 |
+
* - rejects integer the total number of rejected messages by this sender
|
18 |
+
* - complaints integer the total number of spam complaints received for messages by this sender
|
19 |
+
* - unsubs integer the total number of unsubscribe requests received for messages by this sender
|
20 |
+
* - opens integer the total number of times messages by this sender have been opened
|
21 |
+
* - clicks integer the total number of times tracked URLs in messages by this sender have been clicked
|
22 |
+
* - unique_opens integer the number of unique opens for emails sent for this sender
|
23 |
+
* - unique_clicks integer the number of unique clicks for emails sent for this sender
|
24 |
+
*/
|
25 |
+
public function getList() {
|
26 |
+
$_params = array();
|
27 |
+
return $this->master->call('senders/list', $_params);
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Returns the sender domains that have been added to this account.
|
32 |
+
* @return array an array of sender domain data, one for each sending domain used by the account
|
33 |
+
* - return[] struct the information on each sending domain for the account
|
34 |
+
* - domain string the sender domain name
|
35 |
+
* - created_at string the date and time that the sending domain was first seen as a UTC string in YYYY-MM-DD HH:MM:SS format
|
36 |
+
* - last_tested_at string when the domain's DNS settings were last tested as a UTC string in YYYY-MM-DD HH:MM:SS format
|
37 |
+
* - spf struct details about the domain's SPF record
|
38 |
+
* - valid boolean whether the domain's SPF record is valid for use with Mandrill
|
39 |
+
* - valid_after string when the domain's SPF record will be considered valid for use with Mandrill as a UTC string in YYYY-MM-DD HH:MM:SS format. If set, this indicates that the record is valid now, but was previously invalid, and Mandrill will wait until the record's TTL elapses to start using it.
|
40 |
+
* - error string an error describing the spf record, or null if the record is correct
|
41 |
+
* - dkim struct details about the domain's DKIM record
|
42 |
+
* - valid boolean whether the domain's DKIM record is valid for use with Mandrill
|
43 |
+
* - valid_after string when the domain's DKIM record will be considered valid for use with Mandrill as a UTC string in YYYY-MM-DD HH:MM:SS format. If set, this indicates that the record is valid now, but was previously invalid, and Mandrill will wait until the record's TTL elapses to start using it.
|
44 |
+
* - error string an error describing the DKIM record, or null if the record is correct
|
45 |
+
* - verified_at string if the domain has been verified, this indicates when that verification occurred as a UTC string in YYYY-MM-DD HH:MM:SS format
|
46 |
+
* - valid_signing boolean whether this domain can be used to authenticate mail, either for itself or as a custom signing domain. If this is false but spf and dkim are both valid, you will need to verify the domain before using it to authenticate mail
|
47 |
+
*/
|
48 |
+
public function domains() {
|
49 |
+
$_params = array();
|
50 |
+
return $this->master->call('senders/domains', $_params);
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Adds a sender domain to your account. Sender domains are added automatically as you
|
55 |
+
send, but you can use this call to add them ahead of time.
|
56 |
+
* @param string $domain a domain name
|
57 |
+
* @return struct information about the domain
|
58 |
+
* - domain string the sender domain name
|
59 |
+
* - created_at string the date and time that the sending domain was first seen as a UTC string in YYYY-MM-DD HH:MM:SS format
|
60 |
+
* - last_tested_at string when the domain's DNS settings were last tested as a UTC string in YYYY-MM-DD HH:MM:SS format
|
61 |
+
* - spf struct details about the domain's SPF record
|
62 |
+
* - valid boolean whether the domain's SPF record is valid for use with Mandrill
|
63 |
+
* - valid_after string when the domain's SPF record will be considered valid for use with Mandrill as a UTC string in YYYY-MM-DD HH:MM:SS format. If set, this indicates that the record is valid now, but was previously invalid, and Mandrill will wait until the record's TTL elapses to start using it.
|
64 |
+
* - error string an error describing the spf record, or null if the record is correct
|
65 |
+
* - dkim struct details about the domain's DKIM record
|
66 |
+
* - valid boolean whether the domain's DKIM record is valid for use with Mandrill
|
67 |
+
* - valid_after string when the domain's DKIM record will be considered valid for use with Mandrill as a UTC string in YYYY-MM-DD HH:MM:SS format. If set, this indicates that the record is valid now, but was previously invalid, and Mandrill will wait until the record's TTL elapses to start using it.
|
68 |
+
* - error string an error describing the DKIM record, or null if the record is correct
|
69 |
+
* - verified_at string if the domain has been verified, this indicates when that verification occurred as a UTC string in YYYY-MM-DD HH:MM:SS format
|
70 |
+
* - valid_signing boolean whether this domain can be used to authenticate mail, either for itself or as a custom signing domain. If this is false but spf and dkim are both valid, you will need to verify the domain before using it to authenticate mail
|
71 |
+
*/
|
72 |
+
public function addDomain($domain) {
|
73 |
+
$_params = array("domain" => $domain);
|
74 |
+
return $this->master->call('senders/add-domain', $_params);
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Checks the SPF and DKIM settings for a domain. If you haven't already added this domain to your
|
79 |
+
account, it will be added automatically.
|
80 |
+
* @param string $domain a domain name
|
81 |
+
* @return struct information about the sender domain
|
82 |
+
* - domain string the sender domain name
|
83 |
+
* - created_at string the date and time that the sending domain was first seen as a UTC string in YYYY-MM-DD HH:MM:SS format
|
84 |
+
* - last_tested_at string when the domain's DNS settings were last tested as a UTC string in YYYY-MM-DD HH:MM:SS format
|
85 |
+
* - spf struct details about the domain's SPF record
|
86 |
+
* - valid boolean whether the domain's SPF record is valid for use with Mandrill
|
87 |
+
* - valid_after string when the domain's SPF record will be considered valid for use with Mandrill as a UTC string in YYYY-MM-DD HH:MM:SS format. If set, this indicates that the record is valid now, but was previously invalid, and Mandrill will wait until the record's TTL elapses to start using it.
|
88 |
+
* - error string an error describing the spf record, or null if the record is correct
|
89 |
+
* - dkim struct details about the domain's DKIM record
|
90 |
+
* - valid boolean whether the domain's DKIM record is valid for use with Mandrill
|
91 |
+
* - valid_after string when the domain's DKIM record will be considered valid for use with Mandrill as a UTC string in YYYY-MM-DD HH:MM:SS format. If set, this indicates that the record is valid now, but was previously invalid, and Mandrill will wait until the record's TTL elapses to start using it.
|
92 |
+
* - error string an error describing the DKIM record, or null if the record is correct
|
93 |
+
* - verified_at string if the domain has been verified, this indicates when that verification occurred as a UTC string in YYYY-MM-DD HH:MM:SS format
|
94 |
+
* - valid_signing boolean whether this domain can be used to authenticate mail, either for itself or as a custom signing domain. If this is false but spf and dkim are both valid, you will need to verify the domain before using it to authenticate mail
|
95 |
+
*/
|
96 |
+
public function checkDomain($domain) {
|
97 |
+
$_params = array("domain" => $domain);
|
98 |
+
return $this->master->call('senders/check-domain', $_params);
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Sends a verification email in order to verify ownership of a domain.
|
103 |
+
Domain verification is an optional step to confirm ownership of a domain. Once a
|
104 |
+
domain has been verified in a Mandrill account, other accounts may not have their
|
105 |
+
messages signed by that domain unless they also verify the domain. This prevents
|
106 |
+
other Mandrill accounts from sending mail signed by your domain.
|
107 |
+
* @param string $domain a domain name at which you can receive email
|
108 |
+
* @param string $mailbox a mailbox at the domain where the verification email should be sent
|
109 |
+
* @return struct information about the verification that was sent
|
110 |
+
* - status string "sent" indicates that the verification has been sent, "already_verified" indicates that the domain has already been verified with your account
|
111 |
+
* - domain string the domain name you provided
|
112 |
+
* - email string the email address the verification email was sent to
|
113 |
+
*/
|
114 |
+
public function verifyDomain($domain, $mailbox) {
|
115 |
+
$_params = array("domain" => $domain, "mailbox" => $mailbox);
|
116 |
+
return $this->master->call('senders/verify-domain', $_params);
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Return more detailed information about a single sender, including aggregates of recent stats
|
121 |
+
* @param string $address the email address of the sender
|
122 |
+
* @return struct the detailed information on the sender
|
123 |
+
* - address string the sender's email address
|
124 |
+
* - created_at string the date and time that the sender was first seen by Mandrill as a UTC date string in YYYY-MM-DD HH:MM:SS format
|
125 |
+
* - sent integer the total number of messages sent by this sender
|
126 |
+
* - hard_bounces integer the total number of hard bounces by messages by this sender
|
127 |
+
* - soft_bounces integer the total number of soft bounces by messages by this sender
|
128 |
+
* - rejects integer the total number of rejected messages by this sender
|
129 |
+
* - complaints integer the total number of spam complaints received for messages by this sender
|
130 |
+
* - unsubs integer the total number of unsubscribe requests received for messages by this sender
|
131 |
+
* - opens integer the total number of times messages by this sender have been opened
|
132 |
+
* - clicks integer the total number of times tracked URLs in messages by this sender have been clicked
|
133 |
+
* - stats struct an aggregate summary of the sender's sending stats
|
134 |
+
* - today struct stats for this sender so far today
|
135 |
+
* - sent integer the number of emails sent for this sender so far today
|
136 |
+
* - hard_bounces integer the number of emails hard bounced for this sender so far today
|
137 |
+
* - soft_bounces integer the number of emails soft bounced for this sender so far today
|
138 |
+
* - rejects integer the number of emails rejected for sending this sender so far today
|
139 |
+
* - complaints integer the number of spam complaints for this sender so far today
|
140 |
+
* - unsubs integer the number of unsubscribes for this sender so far today
|
141 |
+
* - opens integer the number of times emails have been opened for this sender so far today
|
142 |
+
* - unique_opens integer the number of unique opens for emails sent for this sender so far today
|
143 |
+
* - clicks integer the number of URLs that have been clicked for this sender so far today
|
144 |
+
* - unique_clicks integer the number of unique clicks for emails sent for this sender so far today
|
145 |
+
* - last_7_days struct stats for this sender in the last 7 days
|
146 |
+
* - sent integer the number of emails sent for this sender in the last 7 days
|
147 |
+
* - hard_bounces integer the number of emails hard bounced for this sender in the last 7 days
|
148 |
+
* - soft_bounces integer the number of emails soft bounced for this sender in the last 7 days
|
149 |
+
* - rejects integer the number of emails rejected for sending this sender in the last 7 days
|
150 |
+
* - complaints integer the number of spam complaints for this sender in the last 7 days
|
151 |
+
* - unsubs integer the number of unsubscribes for this sender in the last 7 days
|
152 |
+
* - opens integer the number of times emails have been opened for this sender in the last 7 days
|
153 |
+
* - unique_opens integer the number of unique opens for emails sent for this sender in the last 7 days
|
154 |
+
* - clicks integer the number of URLs that have been clicked for this sender in the last 7 days
|
155 |
+
* - unique_clicks integer the number of unique clicks for emails sent for this sender in the last 7 days
|
156 |
+
* - last_30_days struct stats for this sender in the last 30 days
|
157 |
+
* - sent integer the number of emails sent for this sender in the last 30 days
|
158 |
+
* - hard_bounces integer the number of emails hard bounced for this sender in the last 30 days
|
159 |
+
* - soft_bounces integer the number of emails soft bounced for this sender in the last 30 days
|
160 |
+
* - rejects integer the number of emails rejected for sending this sender in the last 30 days
|
161 |
+
* - complaints integer the number of spam complaints for this sender in the last 30 days
|
162 |
+
* - unsubs integer the number of unsubscribes for this sender in the last 30 days
|
163 |
+
* - opens integer the number of times emails have been opened for this sender in the last 30 days
|
164 |
+
* - unique_opens integer the number of unique opens for emails sent for this sender in the last 30 days
|
165 |
+
* - clicks integer the number of URLs that have been clicked for this sender in the last 30 days
|
166 |
+
* - unique_clicks integer the number of unique clicks for emails sent for this sender in the last 30 days
|
167 |
+
* - last_60_days struct stats for this sender in the last 60 days
|
168 |
+
* - sent integer the number of emails sent for this sender in the last 60 days
|
169 |
+
* - hard_bounces integer the number of emails hard bounced for this sender in the last 60 days
|
170 |
+
* - soft_bounces integer the number of emails soft bounced for this sender in the last 60 days
|
171 |
+
* - rejects integer the number of emails rejected for sending this sender in the last 60 days
|
172 |
+
* - complaints integer the number of spam complaints for this sender in the last 60 days
|
173 |
+
* - unsubs integer the number of unsubscribes for this sender in the last 60 days
|
174 |
+
* - opens integer the number of times emails have been opened for this sender in the last 60 days
|
175 |
+
* - unique_opens integer the number of unique opens for emails sent for this sender in the last 60 days
|
176 |
+
* - clicks integer the number of URLs that have been clicked for this sender in the last 60 days
|
177 |
+
* - unique_clicks integer the number of unique clicks for emails sent for this sender in the last 60 days
|
178 |
+
* - last_90_days struct stats for this sender in the last 90 days
|
179 |
+
* - sent integer the number of emails sent for this sender in the last 90 days
|
180 |
+
* - hard_bounces integer the number of emails hard bounced for this sender in the last 90 days
|
181 |
+
* - soft_bounces integer the number of emails soft bounced for this sender in the last 90 days
|
182 |
+
* - rejects integer the number of emails rejected for sending this sender in the last 90 days
|
183 |
+
* - complaints integer the number of spam complaints for this sender in the last 90 days
|
184 |
+
* - unsubs integer the number of unsubscribes for this sender in the last 90 days
|
185 |
+
* - opens integer the number of times emails have been opened for this sender in the last 90 days
|
186 |
+
* - unique_opens integer the number of unique opens for emails sent for this sender in the last 90 days
|
187 |
+
* - clicks integer the number of URLs that have been clicked for this sender in the last 90 days
|
188 |
+
* - unique_clicks integer the number of unique clicks for emails sent for this sender in the last 90 days
|
189 |
+
*/
|
190 |
+
public function info($address) {
|
191 |
+
$_params = array("address" => $address);
|
192 |
+
return $this->master->call('senders/info', $_params);
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* Return the recent history (hourly stats for the last 30 days) for a sender
|
197 |
+
* @param string $address the email address of the sender
|
198 |
+
* @return array the array of history information
|
199 |
+
* - return[] struct the stats for a single hour
|
200 |
+
* - time string the hour as a UTC date string in YYYY-MM-DD HH:MM:SS format
|
201 |
+
* - sent integer the number of emails that were sent during the hour
|
202 |
+
* - hard_bounces integer the number of emails that hard bounced during the hour
|
203 |
+
* - soft_bounces integer the number of emails that soft bounced during the hour
|
204 |
+
* - rejects integer the number of emails that were rejected during the hour
|
205 |
+
* - complaints integer the number of spam complaints received during the hour
|
206 |
+
* - opens integer the number of emails opened during the hour
|
207 |
+
* - unique_opens integer the number of unique opens generated by messages sent during the hour
|
208 |
+
* - clicks integer the number of tracked URLs clicked during the hour
|
209 |
+
* - unique_clicks integer the number of unique clicks generated by messages sent during the hour
|
210 |
+
*/
|
211 |
+
public function timeSeries($address) {
|
212 |
+
$_params = array("address" => $address);
|
213 |
+
return $this->master->call('senders/time-series', $_params);
|
214 |
+
}
|
215 |
+
|
216 |
+
}
|
217 |
+
|
218 |
+
|
lib/Mandrill/Mandrill/Subaccounts.php
ADDED
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Subaccounts {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Get the list of subaccounts defined for the account, optionally filtered by a prefix
|
10 |
+
* @param string $q an optional prefix to filter the subaccounts' ids and names
|
11 |
+
* @return array the subaccounts for the account, up to a maximum of 1,000
|
12 |
+
* - return[] struct the individual subaccount info
|
13 |
+
* - id string a unique indentifier for the subaccount
|
14 |
+
* - name string an optional display name for the subaccount
|
15 |
+
* - custom_quota integer an optional manual hourly quota for the subaccount. If not specified, the hourly quota will be managed based on reputation
|
16 |
+
* - status string the current sending status of the subaccount, one of "active" or "paused"
|
17 |
+
* - reputation integer the subaccount's current reputation on a scale from 0 to 100
|
18 |
+
* - created_at string the date and time that the subaccount was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
19 |
+
* - first_sent_at string the date and time that the subaccount first sent as a UTC string in YYYY-MM-DD HH:MM:SS format
|
20 |
+
* - sent_weekly integer the number of emails the subaccount has sent so far this week (weeks start on midnight Monday, UTC)
|
21 |
+
* - sent_monthly integer the number of emails the subaccount has sent so far this month (months start on midnight of the 1st, UTC)
|
22 |
+
* - sent_total integer the number of emails the subaccount has sent since it was created
|
23 |
+
*/
|
24 |
+
public function getList($q=null) {
|
25 |
+
$_params = array("q" => $q);
|
26 |
+
return $this->master->call('subaccounts/list', $_params);
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Add a new subaccount
|
31 |
+
* @param string $id a unique identifier for the subaccount to be used in sending calls
|
32 |
+
* @param string $name an optional display name to further identify the subaccount
|
33 |
+
* @param string $notes optional extra text to associate with the subaccount
|
34 |
+
* @param integer $custom_quota an optional manual hourly quota for the subaccount. If not specified, Mandrill will manage this based on reputation
|
35 |
+
* @return struct the information saved about the new subaccount
|
36 |
+
* - id string a unique indentifier for the subaccount
|
37 |
+
* - name string an optional display name for the subaccount
|
38 |
+
* - custom_quota integer an optional manual hourly quota for the subaccount. If not specified, the hourly quota will be managed based on reputation
|
39 |
+
* - status string the current sending status of the subaccount, one of "active" or "paused"
|
40 |
+
* - reputation integer the subaccount's current reputation on a scale from 0 to 100
|
41 |
+
* - created_at string the date and time that the subaccount was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
42 |
+
* - first_sent_at string the date and time that the subaccount first sent as a UTC string in YYYY-MM-DD HH:MM:SS format
|
43 |
+
* - sent_weekly integer the number of emails the subaccount has sent so far this week (weeks start on midnight Monday, UTC)
|
44 |
+
* - sent_monthly integer the number of emails the subaccount has sent so far this month (months start on midnight of the 1st, UTC)
|
45 |
+
* - sent_total integer the number of emails the subaccount has sent since it was created
|
46 |
+
*/
|
47 |
+
public function add($id, $name=null, $notes=null, $custom_quota=null) {
|
48 |
+
$_params = array("id" => $id, "name" => $name, "notes" => $notes, "custom_quota" => $custom_quota);
|
49 |
+
return $this->master->call('subaccounts/add', $_params);
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Given the ID of an existing subaccount, return the data about it
|
54 |
+
* @param string $id the unique identifier of the subaccount to query
|
55 |
+
* @return struct the information about the subaccount
|
56 |
+
* - id string a unique indentifier for the subaccount
|
57 |
+
* - name string an optional display name for the subaccount
|
58 |
+
* - notes string optional extra text to associate with the subaccount
|
59 |
+
* - custom_quota integer an optional manual hourly quota for the subaccount. If not specified, the hourly quota will be managed based on reputation
|
60 |
+
* - status string the current sending status of the subaccount, one of "active" or "paused"
|
61 |
+
* - reputation integer the subaccount's current reputation on a scale from 0 to 100
|
62 |
+
* - created_at string the date and time that the subaccount was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
63 |
+
* - first_sent_at string the date and time that the subaccount first sent as a UTC string in YYYY-MM-DD HH:MM:SS format
|
64 |
+
* - sent_weekly integer the number of emails the subaccount has sent so far this week (weeks start on midnight Monday, UTC)
|
65 |
+
* - sent_monthly integer the number of emails the subaccount has sent so far this month (months start on midnight of the 1st, UTC)
|
66 |
+
* - sent_total integer the number of emails the subaccount has sent since it was created
|
67 |
+
* - sent_hourly integer the number of emails the subaccount has sent in the last hour
|
68 |
+
* - hourly_quota integer the current hourly quota for the subaccount, either manual or reputation-based
|
69 |
+
* - last_30_days struct stats for this subaccount in the last 30 days
|
70 |
+
* - sent integer the number of emails sent for this subaccount in the last 30 days
|
71 |
+
* - hard_bounces integer the number of emails hard bounced for this subaccount in the last 30 days
|
72 |
+
* - soft_bounces integer the number of emails soft bounced for this subaccount in the last 30 days
|
73 |
+
* - rejects integer the number of emails rejected for sending this subaccount in the last 30 days
|
74 |
+
* - complaints integer the number of spam complaints for this subaccount in the last 30 days
|
75 |
+
* - unsubs integer the number of unsbuscribes for this subaccount in the last 30 days
|
76 |
+
* - opens integer the number of times emails have been opened for this subaccount in the last 30 days
|
77 |
+
* - unique_opens integer the number of unique opens for emails sent for this subaccount in the last 30 days
|
78 |
+
* - clicks integer the number of URLs that have been clicked for this subaccount in the last 30 days
|
79 |
+
* - unique_clicks integer the number of unique clicks for emails sent for this subaccount in the last 30 days
|
80 |
+
*/
|
81 |
+
public function info($id) {
|
82 |
+
$_params = array("id" => $id);
|
83 |
+
return $this->master->call('subaccounts/info', $_params);
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Update an existing subaccount
|
88 |
+
* @param string $id the unique identifier of the subaccount to update
|
89 |
+
* @param string $name an optional display name to further identify the subaccount
|
90 |
+
* @param string $notes optional extra text to associate with the subaccount
|
91 |
+
* @param integer $custom_quota an optional manual hourly quota for the subaccount. If not specified, Mandrill will manage this based on reputation
|
92 |
+
* @return struct the information for the updated subaccount
|
93 |
+
* - id string a unique indentifier for the subaccount
|
94 |
+
* - name string an optional display name for the subaccount
|
95 |
+
* - custom_quota integer an optional manual hourly quota for the subaccount. If not specified, the hourly quota will be managed based on reputation
|
96 |
+
* - status string the current sending status of the subaccount, one of "active" or "paused"
|
97 |
+
* - reputation integer the subaccount's current reputation on a scale from 0 to 100
|
98 |
+
* - created_at string the date and time that the subaccount was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
99 |
+
* - first_sent_at string the date and time that the subaccount first sent as a UTC string in YYYY-MM-DD HH:MM:SS format
|
100 |
+
* - sent_weekly integer the number of emails the subaccount has sent so far this week (weeks start on midnight Monday, UTC)
|
101 |
+
* - sent_monthly integer the number of emails the subaccount has sent so far this month (months start on midnight of the 1st, UTC)
|
102 |
+
* - sent_total integer the number of emails the subaccount has sent since it was created
|
103 |
+
*/
|
104 |
+
public function update($id, $name=null, $notes=null, $custom_quota=null) {
|
105 |
+
$_params = array("id" => $id, "name" => $name, "notes" => $notes, "custom_quota" => $custom_quota);
|
106 |
+
return $this->master->call('subaccounts/update', $_params);
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Delete an existing subaccount. Any email related to the subaccount will be saved, but stats will be removed and any future sending calls to this subaccount will fail.
|
111 |
+
* @param string $id the unique identifier of the subaccount to delete
|
112 |
+
* @return struct the information for the deleted subaccount
|
113 |
+
* - id string a unique indentifier for the subaccount
|
114 |
+
* - name string an optional display name for the subaccount
|
115 |
+
* - custom_quota integer an optional manual hourly quota for the subaccount. If not specified, the hourly quota will be managed based on reputation
|
116 |
+
* - status string the current sending status of the subaccount, one of "active" or "paused"
|
117 |
+
* - reputation integer the subaccount's current reputation on a scale from 0 to 100
|
118 |
+
* - created_at string the date and time that the subaccount was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
119 |
+
* - first_sent_at string the date and time that the subaccount first sent as a UTC string in YYYY-MM-DD HH:MM:SS format
|
120 |
+
* - sent_weekly integer the number of emails the subaccount has sent so far this week (weeks start on midnight Monday, UTC)
|
121 |
+
* - sent_monthly integer the number of emails the subaccount has sent so far this month (months start on midnight of the 1st, UTC)
|
122 |
+
* - sent_total integer the number of emails the subaccount has sent since it was created
|
123 |
+
*/
|
124 |
+
public function delete($id) {
|
125 |
+
$_params = array("id" => $id);
|
126 |
+
return $this->master->call('subaccounts/delete', $_params);
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Pause a subaccount's sending. Any future emails delivered to this subaccount will be queued for a maximum of 3 days until the subaccount is resumed.
|
131 |
+
* @param string $id the unique identifier of the subaccount to pause
|
132 |
+
* @return struct the information for the paused subaccount
|
133 |
+
* - id string a unique indentifier for the subaccount
|
134 |
+
* - name string an optional display name for the subaccount
|
135 |
+
* - custom_quota integer an optional manual hourly quota for the subaccount. If not specified, the hourly quota will be managed based on reputation
|
136 |
+
* - status string the current sending status of the subaccount, one of "active" or "paused"
|
137 |
+
* - reputation integer the subaccount's current reputation on a scale from 0 to 100
|
138 |
+
* - created_at string the date and time that the subaccount was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
139 |
+
* - first_sent_at string the date and time that the subaccount first sent as a UTC string in YYYY-MM-DD HH:MM:SS format
|
140 |
+
* - sent_weekly integer the number of emails the subaccount has sent so far this week (weeks start on midnight Monday, UTC)
|
141 |
+
* - sent_monthly integer the number of emails the subaccount has sent so far this month (months start on midnight of the 1st, UTC)
|
142 |
+
* - sent_total integer the number of emails the subaccount has sent since it was created
|
143 |
+
*/
|
144 |
+
public function pause($id) {
|
145 |
+
$_params = array("id" => $id);
|
146 |
+
return $this->master->call('subaccounts/pause', $_params);
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Resume a paused subaccount's sending
|
151 |
+
* @param string $id the unique identifier of the subaccount to resume
|
152 |
+
* @return struct the information for the resumed subaccount
|
153 |
+
* - id string a unique indentifier for the subaccount
|
154 |
+
* - name string an optional display name for the subaccount
|
155 |
+
* - custom_quota integer an optional manual hourly quota for the subaccount. If not specified, the hourly quota will be managed based on reputation
|
156 |
+
* - status string the current sending status of the subaccount, one of "active" or "paused"
|
157 |
+
* - reputation integer the subaccount's current reputation on a scale from 0 to 100
|
158 |
+
* - created_at string the date and time that the subaccount was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
159 |
+
* - first_sent_at string the date and time that the subaccount first sent as a UTC string in YYYY-MM-DD HH:MM:SS format
|
160 |
+
* - sent_weekly integer the number of emails the subaccount has sent so far this week (weeks start on midnight Monday, UTC)
|
161 |
+
* - sent_monthly integer the number of emails the subaccount has sent so far this month (months start on midnight of the 1st, UTC)
|
162 |
+
* - sent_total integer the number of emails the subaccount has sent since it was created
|
163 |
+
*/
|
164 |
+
public function resume($id) {
|
165 |
+
$_params = array("id" => $id);
|
166 |
+
return $this->master->call('subaccounts/resume', $_params);
|
167 |
+
}
|
168 |
+
|
169 |
+
}
|
170 |
+
|
171 |
+
|
lib/Mandrill/Mandrill/Tags.php
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Tags {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Return all of the user-defined tag information
|
10 |
+
* @return array a list of user-defined tags
|
11 |
+
* - return[] struct a user-defined tag
|
12 |
+
* - tag string the actual tag as a string
|
13 |
+
* - reputation integer the tag's current reputation on a scale from 0 to 100.
|
14 |
+
* - sent integer the total number of messages sent with this tag
|
15 |
+
* - hard_bounces integer the total number of hard bounces by messages with this tag
|
16 |
+
* - soft_bounces integer the total number of soft bounces by messages with this tag
|
17 |
+
* - rejects integer the total number of rejected messages with this tag
|
18 |
+
* - complaints integer the total number of spam complaints received for messages with this tag
|
19 |
+
* - unsubs integer the total number of unsubscribe requests received for messages with this tag
|
20 |
+
* - opens integer the total number of times messages with this tag have been opened
|
21 |
+
* - clicks integer the total number of times tracked URLs in messages with this tag have been clicked
|
22 |
+
* - unique_opens integer the number of unique opens for emails sent with this tag
|
23 |
+
* - unique_clicks integer the number of unique clicks for emails sent with this tag
|
24 |
+
*/
|
25 |
+
public function getList() {
|
26 |
+
$_params = array();
|
27 |
+
return $this->master->call('tags/list', $_params);
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Deletes a tag permanently. Deleting a tag removes the tag from any messages
|
32 |
+
that have been sent, and also deletes the tag's stats. There is no way to
|
33 |
+
undo this operation, so use it carefully.
|
34 |
+
* @param string $tag a tag name
|
35 |
+
* @return struct the tag that was deleted
|
36 |
+
* - tag string the actual tag as a string
|
37 |
+
* - reputation integer the tag's current reputation on a scale from 0 to 100.
|
38 |
+
* - sent integer the total number of messages sent with this tag
|
39 |
+
* - hard_bounces integer the total number of hard bounces by messages with this tag
|
40 |
+
* - soft_bounces integer the total number of soft bounces by messages with this tag
|
41 |
+
* - rejects integer the total number of rejected messages with this tag
|
42 |
+
* - complaints integer the total number of spam complaints received for messages with this tag
|
43 |
+
* - unsubs integer the total number of unsubscribe requests received for messages with this tag
|
44 |
+
* - opens integer the total number of times messages with this tag have been opened
|
45 |
+
* - clicks integer the total number of times tracked URLs in messages with this tag have been clicked
|
46 |
+
* - unique_opens integer the number of unique opens for emails sent with this tag
|
47 |
+
* - unique_clicks integer the number of unique clicks for emails sent with this tag
|
48 |
+
*/
|
49 |
+
public function delete($tag) {
|
50 |
+
$_params = array("tag" => $tag);
|
51 |
+
return $this->master->call('tags/delete', $_params);
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Return more detailed information about a single tag, including aggregates of recent stats
|
56 |
+
* @param string $tag an existing tag name
|
57 |
+
* @return struct the detailed information on the tag
|
58 |
+
* - tag string the actual tag as a string
|
59 |
+
* - sent integer the total number of messages sent with this tag
|
60 |
+
* - hard_bounces integer the total number of hard bounces by messages with this tag
|
61 |
+
* - soft_bounces integer the total number of soft bounces by messages with this tag
|
62 |
+
* - rejects integer the total number of rejected messages with this tag
|
63 |
+
* - complaints integer the total number of spam complaints received for messages with this tag
|
64 |
+
* - unsubs integer the total number of unsubscribe requests received for messages with this tag
|
65 |
+
* - opens integer the total number of times messages with this tag have been opened
|
66 |
+
* - clicks integer the total number of times tracked URLs in messages with this tag have been clicked
|
67 |
+
* - stats struct an aggregate summary of the tag's sending stats
|
68 |
+
* - today struct stats with this tag so far today
|
69 |
+
* - sent integer the number of emails sent with this tag so far today
|
70 |
+
* - hard_bounces integer the number of emails hard bounced with this tag so far today
|
71 |
+
* - soft_bounces integer the number of emails soft bounced with this tag so far today
|
72 |
+
* - rejects integer the number of emails rejected for sending this tag so far today
|
73 |
+
* - complaints integer the number of spam complaints with this tag so far today
|
74 |
+
* - unsubs integer the number of unsubscribes with this tag so far today
|
75 |
+
* - opens integer the number of times emails have been opened with this tag so far today
|
76 |
+
* - unique_opens integer the number of unique opens for emails sent with this tag so far today
|
77 |
+
* - clicks integer the number of URLs that have been clicked with this tag so far today
|
78 |
+
* - unique_clicks integer the number of unique clicks for emails sent with this tag so far today
|
79 |
+
* - last_7_days struct stats with this tag in the last 7 days
|
80 |
+
* - sent integer the number of emails sent with this tag in the last 7 days
|
81 |
+
* - hard_bounces integer the number of emails hard bounced with this tag in the last 7 days
|
82 |
+
* - soft_bounces integer the number of emails soft bounced with this tag in the last 7 days
|
83 |
+
* - rejects integer the number of emails rejected for sending this tag in the last 7 days
|
84 |
+
* - complaints integer the number of spam complaints with this tag in the last 7 days
|
85 |
+
* - unsubs integer the number of unsubscribes with this tag in the last 7 days
|
86 |
+
* - opens integer the number of times emails have been opened with this tag in the last 7 days
|
87 |
+
* - unique_opens integer the number of unique opens for emails sent with this tag in the last 7 days
|
88 |
+
* - clicks integer the number of URLs that have been clicked with this tag in the last 7 days
|
89 |
+
* - unique_clicks integer the number of unique clicks for emails sent with this tag in the last 7 days
|
90 |
+
* - last_30_days struct stats with this tag in the last 30 days
|
91 |
+
* - sent integer the number of emails sent with this tag in the last 30 days
|
92 |
+
* - hard_bounces integer the number of emails hard bounced with this tag in the last 30 days
|
93 |
+
* - soft_bounces integer the number of emails soft bounced with this tag in the last 30 days
|
94 |
+
* - rejects integer the number of emails rejected for sending this tag in the last 30 days
|
95 |
+
* - complaints integer the number of spam complaints with this tag in the last 30 days
|
96 |
+
* - unsubs integer the number of unsubscribes with this tag in the last 30 days
|
97 |
+
* - opens integer the number of times emails have been opened with this tag in the last 30 days
|
98 |
+
* - unique_opens integer the number of unique opens for emails sent with this tag in the last 30 days
|
99 |
+
* - clicks integer the number of URLs that have been clicked with this tag in the last 30 days
|
100 |
+
* - unique_clicks integer the number of unique clicks for emails sent with this tag in the last 30 days
|
101 |
+
* - last_60_days struct stats with this tag in the last 60 days
|
102 |
+
* - sent integer the number of emails sent with this tag in the last 60 days
|
103 |
+
* - hard_bounces integer the number of emails hard bounced with this tag in the last 60 days
|
104 |
+
* - soft_bounces integer the number of emails soft bounced with this tag in the last 60 days
|
105 |
+
* - rejects integer the number of emails rejected for sending this tag in the last 60 days
|
106 |
+
* - complaints integer the number of spam complaints with this tag in the last 60 days
|
107 |
+
* - unsubs integer the number of unsubscribes with this tag in the last 60 days
|
108 |
+
* - opens integer the number of times emails have been opened with this tag in the last 60 days
|
109 |
+
* - unique_opens integer the number of unique opens for emails sent with this tag in the last 60 days
|
110 |
+
* - clicks integer the number of URLs that have been clicked with this tag in the last 60 days
|
111 |
+
* - unique_clicks integer the number of unique clicks for emails sent with this tag in the last 60 days
|
112 |
+
* - last_90_days struct stats with this tag in the last 90 days
|
113 |
+
* - sent integer the number of emails sent with this tag in the last 90 days
|
114 |
+
* - hard_bounces integer the number of emails hard bounced with this tag in the last 90 days
|
115 |
+
* - soft_bounces integer the number of emails soft bounced with this tag in the last 90 days
|
116 |
+
* - rejects integer the number of emails rejected for sending this tag in the last 90 days
|
117 |
+
* - complaints integer the number of spam complaints with this tag in the last 90 days
|
118 |
+
* - unsubs integer the number of unsubscribes with this tag in the last 90 days
|
119 |
+
* - opens integer the number of times emails have been opened with this tag in the last 90 days
|
120 |
+
* - unique_opens integer the number of unique opens for emails sent with this tag in the last 90 days
|
121 |
+
* - clicks integer the number of URLs that have been clicked with this tag in the last 90 days
|
122 |
+
* - unique_clicks integer the number of unique clicks for emails sent with this tag in the last 90 days
|
123 |
+
*/
|
124 |
+
public function info($tag) {
|
125 |
+
$_params = array("tag" => $tag);
|
126 |
+
return $this->master->call('tags/info', $_params);
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Return the recent history (hourly stats for the last 30 days) for a tag
|
131 |
+
* @param string $tag an existing tag name
|
132 |
+
* @return array the array of history information
|
133 |
+
* - return[] struct the stats for a single hour
|
134 |
+
* - time string the hour as a UTC date string in YYYY-MM-DD HH:MM:SS format
|
135 |
+
* - sent integer the number of emails that were sent during the hour
|
136 |
+
* - hard_bounces integer the number of emails that hard bounced during the hour
|
137 |
+
* - soft_bounces integer the number of emails that soft bounced during the hour
|
138 |
+
* - rejects integer the number of emails that were rejected during the hour
|
139 |
+
* - complaints integer the number of spam complaints received during the hour
|
140 |
+
* - unsubs integer the number of unsubscribes received during the hour
|
141 |
+
* - opens integer the number of emails opened during the hour
|
142 |
+
* - unique_opens integer the number of unique opens generated by messages sent during the hour
|
143 |
+
* - clicks integer the number of tracked URLs clicked during the hour
|
144 |
+
* - unique_clicks integer the number of unique clicks generated by messages sent during the hour
|
145 |
+
*/
|
146 |
+
public function timeSeries($tag) {
|
147 |
+
$_params = array("tag" => $tag);
|
148 |
+
return $this->master->call('tags/time-series', $_params);
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Return the recent history (hourly stats for the last 30 days) for all tags
|
153 |
+
* @return array the array of history information
|
154 |
+
* - return[] struct the stats for a single hour
|
155 |
+
* - time string the hour as a UTC date string in YYYY-MM-DD HH:MM:SS format
|
156 |
+
* - sent integer the number of emails that were sent during the hour
|
157 |
+
* - hard_bounces integer the number of emails that hard bounced during the hour
|
158 |
+
* - soft_bounces integer the number of emails that soft bounced during the hour
|
159 |
+
* - rejects integer the number of emails that were rejected during the hour
|
160 |
+
* - complaints integer the number of spam complaints received during the hour
|
161 |
+
* - unsubs integer the number of unsubscribes received during the hour
|
162 |
+
* - opens integer the number of emails opened during the hour
|
163 |
+
* - unique_opens integer the number of unique opens generated by messages sent during the hour
|
164 |
+
* - clicks integer the number of tracked URLs clicked during the hour
|
165 |
+
* - unique_clicks integer the number of unique clicks generated by messages sent during the hour
|
166 |
+
*/
|
167 |
+
public function allTimeSeries() {
|
168 |
+
$_params = array();
|
169 |
+
return $this->master->call('tags/all-time-series', $_params);
|
170 |
+
}
|
171 |
+
|
172 |
+
}
|
173 |
+
|
174 |
+
|
lib/Mandrill/Mandrill/Templates.php
ADDED
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Templates {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Add a new template
|
10 |
+
* @param string $name the name for the new template - must be unique
|
11 |
+
* @param string $from_email a default sending address for emails sent using this template
|
12 |
+
* @param string $from_name a default from name to be used
|
13 |
+
* @param string $subject a default subject line to be used
|
14 |
+
* @param string $code the HTML code for the template with mc:edit attributes for the editable elements
|
15 |
+
* @param string $text a default text part to be used when sending with this template
|
16 |
+
* @param boolean $publish set to false to add a draft template without publishing
|
17 |
+
* @param array $labels an optional array of up to 10 labels to use for filtering templates
|
18 |
+
* - labels[] string a single label
|
19 |
+
* @return struct the information saved about the new template
|
20 |
+
* - slug string the immutable unique code name of the template
|
21 |
+
* - name string the name of the template
|
22 |
+
* - labels array the list of labels applied to the template
|
23 |
+
* - labels[] string a single label
|
24 |
+
* - code string the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version
|
25 |
+
* - subject string the subject line of the template, if provided - draft version
|
26 |
+
* - from_email string the default sender address for the template, if provided - draft version
|
27 |
+
* - from_name string the default sender from name for the template, if provided - draft version
|
28 |
+
* - text string the default text part of messages sent with the template, if provided - draft version
|
29 |
+
* - publish_name string the same as the template name - kept as a separate field for backwards compatibility
|
30 |
+
* - publish_code string the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published
|
31 |
+
* - publish_subject string the subject line of the template, if provided
|
32 |
+
* - publish_from_email string the default sender address for the template, if provided
|
33 |
+
* - publish_from_name string the default sender from name for the template, if provided
|
34 |
+
* - publish_text string the default text part of messages sent with the template, if provided
|
35 |
+
* - published_at string the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published
|
36 |
+
* - created_at string the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
37 |
+
* - updated_at string the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format
|
38 |
+
*/
|
39 |
+
public function add($name, $from_email=null, $from_name=null, $subject=null, $code=null, $text=null, $publish=true, $labels=array()) {
|
40 |
+
$_params = array("name" => $name, "from_email" => $from_email, "from_name" => $from_name, "subject" => $subject, "code" => $code, "text" => $text, "publish" => $publish, "labels" => $labels);
|
41 |
+
return $this->master->call('templates/add', $_params);
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Get the information for an existing template
|
46 |
+
* @param string $name the immutable name of an existing template
|
47 |
+
* @return struct the requested template information
|
48 |
+
* - slug string the immutable unique code name of the template
|
49 |
+
* - name string the name of the template
|
50 |
+
* - labels array the list of labels applied to the template
|
51 |
+
* - labels[] string a single label
|
52 |
+
* - code string the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version
|
53 |
+
* - subject string the subject line of the template, if provided - draft version
|
54 |
+
* - from_email string the default sender address for the template, if provided - draft version
|
55 |
+
* - from_name string the default sender from name for the template, if provided - draft version
|
56 |
+
* - text string the default text part of messages sent with the template, if provided - draft version
|
57 |
+
* - publish_name string the same as the template name - kept as a separate field for backwards compatibility
|
58 |
+
* - publish_code string the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published
|
59 |
+
* - publish_subject string the subject line of the template, if provided
|
60 |
+
* - publish_from_email string the default sender address for the template, if provided
|
61 |
+
* - publish_from_name string the default sender from name for the template, if provided
|
62 |
+
* - publish_text string the default text part of messages sent with the template, if provided
|
63 |
+
* - published_at string the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published
|
64 |
+
* - created_at string the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
65 |
+
* - updated_at string the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format
|
66 |
+
*/
|
67 |
+
public function info($name) {
|
68 |
+
$_params = array("name" => $name);
|
69 |
+
return $this->master->call('templates/info', $_params);
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Update the code for an existing template. If null is provided for any fields, the values will remain unchanged.
|
74 |
+
* @param string $name the immutable name of an existing template
|
75 |
+
* @param string $from_email the new default sending address
|
76 |
+
* @param string $from_name the new default from name
|
77 |
+
* @param string $subject the new default subject line
|
78 |
+
* @param string $code the new code for the template
|
79 |
+
* @param string $text the new default text part to be used
|
80 |
+
* @param boolean $publish set to false to update the draft version of the template without publishing
|
81 |
+
* @param array $labels an optional array of up to 10 labels to use for filtering templates
|
82 |
+
* - labels[] string a single label
|
83 |
+
* @return struct the template that was updated
|
84 |
+
* - slug string the immutable unique code name of the template
|
85 |
+
* - name string the name of the template
|
86 |
+
* - labels array the list of labels applied to the template
|
87 |
+
* - labels[] string a single label
|
88 |
+
* - code string the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version
|
89 |
+
* - subject string the subject line of the template, if provided - draft version
|
90 |
+
* - from_email string the default sender address for the template, if provided - draft version
|
91 |
+
* - from_name string the default sender from name for the template, if provided - draft version
|
92 |
+
* - text string the default text part of messages sent with the template, if provided - draft version
|
93 |
+
* - publish_name string the same as the template name - kept as a separate field for backwards compatibility
|
94 |
+
* - publish_code string the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published
|
95 |
+
* - publish_subject string the subject line of the template, if provided
|
96 |
+
* - publish_from_email string the default sender address for the template, if provided
|
97 |
+
* - publish_from_name string the default sender from name for the template, if provided
|
98 |
+
* - publish_text string the default text part of messages sent with the template, if provided
|
99 |
+
* - published_at string the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published
|
100 |
+
* - created_at string the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
101 |
+
* - updated_at string the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format
|
102 |
+
*/
|
103 |
+
public function update($name, $from_email=null, $from_name=null, $subject=null, $code=null, $text=null, $publish=true, $labels=null) {
|
104 |
+
$_params = array("name" => $name, "from_email" => $from_email, "from_name" => $from_name, "subject" => $subject, "code" => $code, "text" => $text, "publish" => $publish, "labels" => $labels);
|
105 |
+
return $this->master->call('templates/update', $_params);
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Publish the content for the template. Any new messages sent using this template will start using the content that was previously in draft.
|
110 |
+
* @param string $name the immutable name of an existing template
|
111 |
+
* @return struct the template that was published
|
112 |
+
* - slug string the immutable unique code name of the template
|
113 |
+
* - name string the name of the template
|
114 |
+
* - labels array the list of labels applied to the template
|
115 |
+
* - labels[] string a single label
|
116 |
+
* - code string the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version
|
117 |
+
* - subject string the subject line of the template, if provided - draft version
|
118 |
+
* - from_email string the default sender address for the template, if provided - draft version
|
119 |
+
* - from_name string the default sender from name for the template, if provided - draft version
|
120 |
+
* - text string the default text part of messages sent with the template, if provided - draft version
|
121 |
+
* - publish_name string the same as the template name - kept as a separate field for backwards compatibility
|
122 |
+
* - publish_code string the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published
|
123 |
+
* - publish_subject string the subject line of the template, if provided
|
124 |
+
* - publish_from_email string the default sender address for the template, if provided
|
125 |
+
* - publish_from_name string the default sender from name for the template, if provided
|
126 |
+
* - publish_text string the default text part of messages sent with the template, if provided
|
127 |
+
* - published_at string the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published
|
128 |
+
* - created_at string the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
129 |
+
* - updated_at string the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format
|
130 |
+
*/
|
131 |
+
public function publish($name) {
|
132 |
+
$_params = array("name" => $name);
|
133 |
+
return $this->master->call('templates/publish', $_params);
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Delete a template
|
138 |
+
* @param string $name the immutable name of an existing template
|
139 |
+
* @return struct the template that was deleted
|
140 |
+
* - slug string the immutable unique code name of the template
|
141 |
+
* - name string the name of the template
|
142 |
+
* - labels array the list of labels applied to the template
|
143 |
+
* - labels[] string a single label
|
144 |
+
* - code string the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version
|
145 |
+
* - subject string the subject line of the template, if provided - draft version
|
146 |
+
* - from_email string the default sender address for the template, if provided - draft version
|
147 |
+
* - from_name string the default sender from name for the template, if provided - draft version
|
148 |
+
* - text string the default text part of messages sent with the template, if provided - draft version
|
149 |
+
* - publish_name string the same as the template name - kept as a separate field for backwards compatibility
|
150 |
+
* - publish_code string the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published
|
151 |
+
* - publish_subject string the subject line of the template, if provided
|
152 |
+
* - publish_from_email string the default sender address for the template, if provided
|
153 |
+
* - publish_from_name string the default sender from name for the template, if provided
|
154 |
+
* - publish_text string the default text part of messages sent with the template, if provided
|
155 |
+
* - published_at string the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published
|
156 |
+
* - created_at string the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
157 |
+
* - updated_at string the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format
|
158 |
+
*/
|
159 |
+
public function delete($name) {
|
160 |
+
$_params = array("name" => $name);
|
161 |
+
return $this->master->call('templates/delete', $_params);
|
162 |
+
}
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Return a list of all the templates available to this user
|
166 |
+
* @param string $label an optional label to filter the templates
|
167 |
+
* @return array an array of structs with information about each template
|
168 |
+
* - return[] struct the information on each template in the account
|
169 |
+
* - slug string the immutable unique code name of the template
|
170 |
+
* - name string the name of the template
|
171 |
+
* - labels array the list of labels applied to the template
|
172 |
+
* - labels[] string a single label
|
173 |
+
* - code string the full HTML code of the template, with mc:edit attributes marking the editable elements - draft version
|
174 |
+
* - subject string the subject line of the template, if provided - draft version
|
175 |
+
* - from_email string the default sender address for the template, if provided - draft version
|
176 |
+
* - from_name string the default sender from name for the template, if provided - draft version
|
177 |
+
* - text string the default text part of messages sent with the template, if provided - draft version
|
178 |
+
* - publish_name string the same as the template name - kept as a separate field for backwards compatibility
|
179 |
+
* - publish_code string the full HTML code of the template, with mc:edit attributes marking the editable elements that are available as published, if it has been published
|
180 |
+
* - publish_subject string the subject line of the template, if provided
|
181 |
+
* - publish_from_email string the default sender address for the template, if provided
|
182 |
+
* - publish_from_name string the default sender from name for the template, if provided
|
183 |
+
* - publish_text string the default text part of messages sent with the template, if provided
|
184 |
+
* - published_at string the date and time the template was last published as a UTC string in YYYY-MM-DD HH:MM:SS format, or null if it has not been published
|
185 |
+
* - created_at string the date and time the template was first created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
186 |
+
* - updated_at string the date and time the template was last modified as a UTC string in YYYY-MM-DD HH:MM:SS format
|
187 |
+
*/
|
188 |
+
public function getList($label=null) {
|
189 |
+
$_params = array("label" => $label);
|
190 |
+
return $this->master->call('templates/list', $_params);
|
191 |
+
}
|
192 |
+
|
193 |
+
/**
|
194 |
+
* Return the recent history (hourly stats for the last 30 days) for a template
|
195 |
+
* @param string $name the name of an existing template
|
196 |
+
* @return array the array of history information
|
197 |
+
* - return[] struct the stats for a single hour
|
198 |
+
* - time string the hour as a UTC date string in YYYY-MM-DD HH:MM:SS format
|
199 |
+
* - sent integer the number of emails that were sent during the hour
|
200 |
+
* - hard_bounces integer the number of emails that hard bounced during the hour
|
201 |
+
* - soft_bounces integer the number of emails that soft bounced during the hour
|
202 |
+
* - rejects integer the number of emails that were rejected during the hour
|
203 |
+
* - complaints integer the number of spam complaints received during the hour
|
204 |
+
* - opens integer the number of emails opened during the hour
|
205 |
+
* - unique_opens integer the number of unique opens generated by messages sent during the hour
|
206 |
+
* - clicks integer the number of tracked URLs clicked during the hour
|
207 |
+
* - unique_clicks integer the number of unique clicks generated by messages sent during the hour
|
208 |
+
*/
|
209 |
+
public function timeSeries($name) {
|
210 |
+
$_params = array("name" => $name);
|
211 |
+
return $this->master->call('templates/time-series', $_params);
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Inject content and optionally merge fields into a template, returning the HTML that results
|
216 |
+
* @param string $template_name the immutable name of a template that exists in the user's account
|
217 |
+
* @param array $template_content an array of template content to render. Each item in the array should be a struct with two keys - name: the name of the content block to set the content for, and content: the actual content to put into the block
|
218 |
+
* - template_content[] struct the injection of a single piece of content into a single editable region
|
219 |
+
* - name string the name of the mc:edit editable region to inject into
|
220 |
+
* - content string the content to inject
|
221 |
+
* @param array $merge_vars optional merge variables to use for injecting merge field content. If this is not provided, no merge fields will be replaced.
|
222 |
+
* - merge_vars[] struct a single merge variable
|
223 |
+
* - name string the merge variable's name. Merge variable names are case-insensitive and may not start with _
|
224 |
+
* - content string the merge variable's content
|
225 |
+
* @return struct the result of rendering the given template with the content and merge field values injected
|
226 |
+
* - html string the rendered HTML as a string
|
227 |
+
*/
|
228 |
+
public function render($template_name, $template_content, $merge_vars=null) {
|
229 |
+
$_params = array("template_name" => $template_name, "template_content" => $template_content, "merge_vars" => $merge_vars);
|
230 |
+
return $this->master->call('templates/render', $_params);
|
231 |
+
}
|
232 |
+
|
233 |
+
}
|
234 |
+
|
235 |
+
|
lib/Mandrill/Mandrill/Urls.php
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Urls {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Get the 100 most clicked URLs
|
10 |
+
* @return array the 100 most clicked URLs and their stats
|
11 |
+
* - return[] struct the individual URL stats
|
12 |
+
* - url string the URL to be tracked
|
13 |
+
* - sent integer the number of emails that contained the URL
|
14 |
+
* - clicks integer the number of times the URL has been clicked from a tracked email
|
15 |
+
* - unique_clicks integer the number of unique emails that have generated clicks for this URL
|
16 |
+
*/
|
17 |
+
public function getList() {
|
18 |
+
$_params = array();
|
19 |
+
return $this->master->call('urls/list', $_params);
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Return the 100 most clicked URLs that match the search query given
|
24 |
+
* @param string $q a search query
|
25 |
+
* @return array the 100 most clicked URLs matching the search query
|
26 |
+
* - return[] struct the URL matching the query
|
27 |
+
* - url string the URL to be tracked
|
28 |
+
* - sent integer the number of emails that contained the URL
|
29 |
+
* - clicks integer the number of times the URL has been clicked from a tracked email
|
30 |
+
* - unique_clicks integer the number of unique emails that have generated clicks for this URL
|
31 |
+
*/
|
32 |
+
public function search($q) {
|
33 |
+
$_params = array("q" => $q);
|
34 |
+
return $this->master->call('urls/search', $_params);
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Return the recent history (hourly stats for the last 30 days) for a url
|
39 |
+
* @param string $url an existing URL
|
40 |
+
* @return array the array of history information
|
41 |
+
* - return[] struct the information for a single hour
|
42 |
+
* - time string the hour as a UTC date string in YYYY-MM-DD HH:MM:SS format
|
43 |
+
* - sent integer the number of emails that were sent with the URL during the hour
|
44 |
+
* - clicks integer the number of times the URL was clicked during the hour
|
45 |
+
* - unique_clicks integer the number of unique clicks generated for emails sent with this URL during the hour
|
46 |
+
*/
|
47 |
+
public function timeSeries($url) {
|
48 |
+
$_params = array("url" => $url);
|
49 |
+
return $this->master->call('urls/time-series', $_params);
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Get the list of tracking domains set up for this account
|
54 |
+
* @return array the tracking domains and their status
|
55 |
+
* - return[] struct the individual tracking domain
|
56 |
+
* - domain string the tracking domain name
|
57 |
+
* - created_at string the date and time that the tracking domain was added as a UTC string in YYYY-MM-DD HH:MM:SS format
|
58 |
+
* - last_tested_at string when the domain's DNS settings were last tested as a UTC string in YYYY-MM-DD HH:MM:SS format
|
59 |
+
* - cname struct details about the domain's CNAME record
|
60 |
+
* - valid boolean whether the domain's CNAME record is valid for use with Mandrill
|
61 |
+
* - valid_after string when the domain's CNAME record will be considered valid for use with Mandrill as a UTC string in YYYY-MM-DD HH:MM:SS format. If set, this indicates that the record is valid now, but was previously invalid, and Mandrill will wait until the record's TTL elapses to start using it.
|
62 |
+
* - error string an error describing the CNAME record, or null if the record is correct
|
63 |
+
* - valid_tracking boolean whether this domain can be used as a tracking domain for email.
|
64 |
+
*/
|
65 |
+
public function trackingDomains() {
|
66 |
+
$_params = array();
|
67 |
+
return $this->master->call('urls/tracking-domains', $_params);
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Add a tracking domain to your account
|
72 |
+
* @param string $domain a domain name
|
73 |
+
* @return struct information about the domain
|
74 |
+
* - domain string the tracking domain name
|
75 |
+
* - created_at string the date and time that the tracking domain was added as a UTC string in YYYY-MM-DD HH:MM:SS format
|
76 |
+
* - last_tested_at string when the domain's DNS settings were last tested as a UTC string in YYYY-MM-DD HH:MM:SS format
|
77 |
+
* - cname struct details about the domain's CNAME record
|
78 |
+
* - valid boolean whether the domain's CNAME record is valid for use with Mandrill
|
79 |
+
* - valid_after string when the domain's CNAME record will be considered valid for use with Mandrill as a UTC string in YYYY-MM-DD HH:MM:SS format. If set, this indicates that the record is valid now, but was previously invalid, and Mandrill will wait until the record's TTL elapses to start using it.
|
80 |
+
* - error string an error describing the CNAME record, or null if the record is correct
|
81 |
+
* - valid_tracking boolean whether this domain can be used as a tracking domain for email.
|
82 |
+
*/
|
83 |
+
public function addTrackingDomain($domain) {
|
84 |
+
$_params = array("domain" => $domain);
|
85 |
+
return $this->master->call('urls/add-tracking-domain', $_params);
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Checks the CNAME settings for a tracking domain. The domain must have been added already with the add-tracking-domain call
|
90 |
+
* @param string $domain an existing tracking domain name
|
91 |
+
* @return struct information about the tracking domain
|
92 |
+
* - domain string the tracking domain name
|
93 |
+
* - created_at string the date and time that the tracking domain was added as a UTC string in YYYY-MM-DD HH:MM:SS format
|
94 |
+
* - last_tested_at string when the domain's DNS settings were last tested as a UTC string in YYYY-MM-DD HH:MM:SS format
|
95 |
+
* - cname struct details about the domain's CNAME record
|
96 |
+
* - valid boolean whether the domain's CNAME record is valid for use with Mandrill
|
97 |
+
* - valid_after string when the domain's CNAME record will be considered valid for use with Mandrill as a UTC string in YYYY-MM-DD HH:MM:SS format. If set, this indicates that the record is valid now, but was previously invalid, and Mandrill will wait until the record's TTL elapses to start using it.
|
98 |
+
* - error string an error describing the CNAME record, or null if the record is correct
|
99 |
+
* - valid_tracking boolean whether this domain can be used as a tracking domain for email.
|
100 |
+
*/
|
101 |
+
public function checkTrackingDomain($domain) {
|
102 |
+
$_params = array("domain" => $domain);
|
103 |
+
return $this->master->call('urls/check-tracking-domain', $_params);
|
104 |
+
}
|
105 |
+
|
106 |
+
}
|
107 |
+
|
108 |
+
|
lib/Mandrill/Mandrill/Users.php
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Users {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Return the information about the API-connected user
|
10 |
+
* @return struct the user information including username, key, reputation, quota, and historical sending stats
|
11 |
+
* - username string the username of the user (used for SMTP authentication)
|
12 |
+
* - created_at string the date and time that the user's Mandrill account was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
13 |
+
* - public_id string a unique, permanent identifier for this user
|
14 |
+
* - reputation integer the reputation of the user on a scale from 0 to 100, with 75 generally being a "good" reputation
|
15 |
+
* - hourly_quota integer the maximum number of emails Mandrill will deliver for this user each hour. Any emails beyond that will be accepted and queued for later delivery. Users with higher reputations will have higher hourly quotas
|
16 |
+
* - backlog integer the number of emails that are queued for delivery due to exceeding your monthly or hourly quotas
|
17 |
+
* - stats struct an aggregate summary of the account's sending stats
|
18 |
+
* - today struct stats for this user so far today
|
19 |
+
* - sent integer the number of emails sent for this user so far today
|
20 |
+
* - hard_bounces integer the number of emails hard bounced for this user so far today
|
21 |
+
* - soft_bounces integer the number of emails soft bounced for this user so far today
|
22 |
+
* - rejects integer the number of emails rejected for sending this user so far today
|
23 |
+
* - complaints integer the number of spam complaints for this user so far today
|
24 |
+
* - unsubs integer the number of unsubscribes for this user so far today
|
25 |
+
* - opens integer the number of times emails have been opened for this user so far today
|
26 |
+
* - unique_opens integer the number of unique opens for emails sent for this user so far today
|
27 |
+
* - clicks integer the number of URLs that have been clicked for this user so far today
|
28 |
+
* - unique_clicks integer the number of unique clicks for emails sent for this user so far today
|
29 |
+
* - last_7_days struct stats for this user in the last 7 days
|
30 |
+
* - sent integer the number of emails sent for this user in the last 7 days
|
31 |
+
* - hard_bounces integer the number of emails hard bounced for this user in the last 7 days
|
32 |
+
* - soft_bounces integer the number of emails soft bounced for this user in the last 7 days
|
33 |
+
* - rejects integer the number of emails rejected for sending this user in the last 7 days
|
34 |
+
* - complaints integer the number of spam complaints for this user in the last 7 days
|
35 |
+
* - unsubs integer the number of unsubscribes for this user in the last 7 days
|
36 |
+
* - opens integer the number of times emails have been opened for this user in the last 7 days
|
37 |
+
* - unique_opens integer the number of unique opens for emails sent for this user in the last 7 days
|
38 |
+
* - clicks integer the number of URLs that have been clicked for this user in the last 7 days
|
39 |
+
* - unique_clicks integer the number of unique clicks for emails sent for this user in the last 7 days
|
40 |
+
* - last_30_days struct stats for this user in the last 30 days
|
41 |
+
* - sent integer the number of emails sent for this user in the last 30 days
|
42 |
+
* - hard_bounces integer the number of emails hard bounced for this user in the last 30 days
|
43 |
+
* - soft_bounces integer the number of emails soft bounced for this user in the last 30 days
|
44 |
+
* - rejects integer the number of emails rejected for sending this user in the last 30 days
|
45 |
+
* - complaints integer the number of spam complaints for this user in the last 30 days
|
46 |
+
* - unsubs integer the number of unsubscribes for this user in the last 30 days
|
47 |
+
* - opens integer the number of times emails have been opened for this user in the last 30 days
|
48 |
+
* - unique_opens integer the number of unique opens for emails sent for this user in the last 30 days
|
49 |
+
* - clicks integer the number of URLs that have been clicked for this user in the last 30 days
|
50 |
+
* - unique_clicks integer the number of unique clicks for emails sent for this user in the last 30 days
|
51 |
+
* - last_60_days struct stats for this user in the last 60 days
|
52 |
+
* - sent integer the number of emails sent for this user in the last 60 days
|
53 |
+
* - hard_bounces integer the number of emails hard bounced for this user in the last 60 days
|
54 |
+
* - soft_bounces integer the number of emails soft bounced for this user in the last 60 days
|
55 |
+
* - rejects integer the number of emails rejected for sending this user in the last 60 days
|
56 |
+
* - complaints integer the number of spam complaints for this user in the last 60 days
|
57 |
+
* - unsubs integer the number of unsubscribes for this user in the last 60 days
|
58 |
+
* - opens integer the number of times emails have been opened for this user in the last 60 days
|
59 |
+
* - unique_opens integer the number of unique opens for emails sent for this user in the last 60 days
|
60 |
+
* - clicks integer the number of URLs that have been clicked for this user in the last 60 days
|
61 |
+
* - unique_clicks integer the number of unique clicks for emails sent for this user in the last 60 days
|
62 |
+
* - last_90_days struct stats for this user in the last 90 days
|
63 |
+
* - sent integer the number of emails sent for this user in the last 90 days
|
64 |
+
* - hard_bounces integer the number of emails hard bounced for this user in the last 90 days
|
65 |
+
* - soft_bounces integer the number of emails soft bounced for this user in the last 90 days
|
66 |
+
* - rejects integer the number of emails rejected for sending this user in the last 90 days
|
67 |
+
* - complaints integer the number of spam complaints for this user in the last 90 days
|
68 |
+
* - unsubs integer the number of unsubscribes for this user in the last 90 days
|
69 |
+
* - opens integer the number of times emails have been opened for this user in the last 90 days
|
70 |
+
* - unique_opens integer the number of unique opens for emails sent for this user in the last 90 days
|
71 |
+
* - clicks integer the number of URLs that have been clicked for this user in the last 90 days
|
72 |
+
* - unique_clicks integer the number of unique clicks for emails sent for this user in the last 90 days
|
73 |
+
* - all_time struct stats for the lifetime of the user's account
|
74 |
+
* - sent integer the number of emails sent in the lifetime of the user's account
|
75 |
+
* - hard_bounces integer the number of emails hard bounced in the lifetime of the user's account
|
76 |
+
* - soft_bounces integer the number of emails soft bounced in the lifetime of the user's account
|
77 |
+
* - rejects integer the number of emails rejected for sending this user so far today
|
78 |
+
* - complaints integer the number of spam complaints in the lifetime of the user's account
|
79 |
+
* - unsubs integer the number of unsubscribes in the lifetime of the user's account
|
80 |
+
* - opens integer the number of times emails have been opened in the lifetime of the user's account
|
81 |
+
* - unique_opens integer the number of unique opens for emails sent in the lifetime of the user's account
|
82 |
+
* - clicks integer the number of URLs that have been clicked in the lifetime of the user's account
|
83 |
+
* - unique_clicks integer the number of unique clicks for emails sent in the lifetime of the user's account
|
84 |
+
*/
|
85 |
+
public function info() {
|
86 |
+
$_params = array();
|
87 |
+
return $this->master->call('users/info', $_params);
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Validate an API key and respond to a ping
|
92 |
+
* @return string the string "PONG!"
|
93 |
+
*/
|
94 |
+
public function ping() {
|
95 |
+
$_params = array();
|
96 |
+
return $this->master->call('users/ping', $_params);
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Validate an API key and respond to a ping (anal JSON parser version)
|
101 |
+
* @return struct a struct with one key "PING" with a static value "PONG!"
|
102 |
+
*/
|
103 |
+
public function ping2() {
|
104 |
+
$_params = array();
|
105 |
+
return $this->master->call('users/ping2', $_params);
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Return the senders that have tried to use this account, both verified and unverified
|
110 |
+
* @return array an array of sender data, one for each sending addresses used by the account
|
111 |
+
* - return[] struct the information on each sending address in the account
|
112 |
+
* - address string the sender's email address
|
113 |
+
* - created_at string the date and time that the sender was first seen by Mandrill as a UTC date string in YYYY-MM-DD HH:MM:SS format
|
114 |
+
* - sent integer the total number of messages sent by this sender
|
115 |
+
* - hard_bounces integer the total number of hard bounces by messages by this sender
|
116 |
+
* - soft_bounces integer the total number of soft bounces by messages by this sender
|
117 |
+
* - rejects integer the total number of rejected messages by this sender
|
118 |
+
* - complaints integer the total number of spam complaints received for messages by this sender
|
119 |
+
* - unsubs integer the total number of unsubscribe requests received for messages by this sender
|
120 |
+
* - opens integer the total number of times messages by this sender have been opened
|
121 |
+
* - clicks integer the total number of times tracked URLs in messages by this sender have been clicked
|
122 |
+
* - unique_opens integer the number of unique opens for emails sent for this sender
|
123 |
+
* - unique_clicks integer the number of unique clicks for emails sent for this sender
|
124 |
+
*/
|
125 |
+
public function senders() {
|
126 |
+
$_params = array();
|
127 |
+
return $this->master->call('users/senders', $_params);
|
128 |
+
}
|
129 |
+
|
130 |
+
}
|
131 |
+
|
132 |
+
|
lib/Mandrill/Mandrill/Webhooks.php
ADDED
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Webhooks {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Get the list of all webhooks defined on the account
|
10 |
+
* @return array the webhooks associated with the account
|
11 |
+
* - return[] struct the individual webhook info
|
12 |
+
* - id integer a unique integer indentifier for the webhook
|
13 |
+
* - url string The URL that the event data will be posted to
|
14 |
+
* - description string a description of the webhook
|
15 |
+
* - auth_key string the key used to requests for this webhook
|
16 |
+
* - events array The message events that will be posted to the hook
|
17 |
+
* - events[] string the individual message event (send, hard_bounce, soft_bounce, open, click, spam, unsub, or reject)
|
18 |
+
* - created_at string the date and time that the webhook was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
19 |
+
* - last_sent_at string the date and time that the webhook last successfully received events as a UTC string in YYYY-MM-DD HH:MM:SS format
|
20 |
+
* - batches_sent integer the number of event batches that have ever been sent to this webhook
|
21 |
+
* - events_sent integer the total number of events that have ever been sent to this webhook
|
22 |
+
* - last_error string if we've ever gotten an error trying to post to this webhook, the last error that we've seen
|
23 |
+
*/
|
24 |
+
public function getList() {
|
25 |
+
$_params = array();
|
26 |
+
return $this->master->call('webhooks/list', $_params);
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Add a new webhook
|
31 |
+
* @param string $url the URL to POST batches of events
|
32 |
+
* @param string $description an optional description of the webhook
|
33 |
+
* @param array $events an optional list of events that will be posted to the webhook
|
34 |
+
* - events[] string the individual event to listen for
|
35 |
+
* @return struct the information saved about the new webhook
|
36 |
+
* - id integer a unique integer indentifier for the webhook
|
37 |
+
* - url string The URL that the event data will be posted to
|
38 |
+
* - description string a description of the webhook
|
39 |
+
* - auth_key string the key used to requests for this webhook
|
40 |
+
* - events array The message events that will be posted to the hook
|
41 |
+
* - events[] string the individual message event (send, hard_bounce, soft_bounce, open, click, spam, unsub, or reject)
|
42 |
+
* - created_at string the date and time that the webhook was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
43 |
+
* - last_sent_at string the date and time that the webhook last successfully received events as a UTC string in YYYY-MM-DD HH:MM:SS format
|
44 |
+
* - batches_sent integer the number of event batches that have ever been sent to this webhook
|
45 |
+
* - events_sent integer the total number of events that have ever been sent to this webhook
|
46 |
+
* - last_error string if we've ever gotten an error trying to post to this webhook, the last error that we've seen
|
47 |
+
*/
|
48 |
+
public function add($url, $description=null, $events=array()) {
|
49 |
+
$_params = array("url" => $url, "description" => $description, "events" => $events);
|
50 |
+
return $this->master->call('webhooks/add', $_params);
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Given the ID of an existing webhook, return the data about it
|
55 |
+
* @param integer $id the unique identifier of a webhook belonging to this account
|
56 |
+
* @return struct the information about the webhook
|
57 |
+
* - id integer a unique integer indentifier for the webhook
|
58 |
+
* - url string The URL that the event data will be posted to
|
59 |
+
* - description string a description of the webhook
|
60 |
+
* - auth_key string the key used to requests for this webhook
|
61 |
+
* - events array The message events that will be posted to the hook
|
62 |
+
* - events[] string the individual message event (send, hard_bounce, soft_bounce, open, click, spam, unsub, or reject)
|
63 |
+
* - created_at string the date and time that the webhook was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
64 |
+
* - last_sent_at string the date and time that the webhook last successfully received events as a UTC string in YYYY-MM-DD HH:MM:SS format
|
65 |
+
* - batches_sent integer the number of event batches that have ever been sent to this webhook
|
66 |
+
* - events_sent integer the total number of events that have ever been sent to this webhook
|
67 |
+
* - last_error string if we've ever gotten an error trying to post to this webhook, the last error that we've seen
|
68 |
+
*/
|
69 |
+
public function info($id) {
|
70 |
+
$_params = array("id" => $id);
|
71 |
+
return $this->master->call('webhooks/info', $_params);
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Update an existing webhook
|
76 |
+
* @param integer $id the unique identifier of a webhook belonging to this account
|
77 |
+
* @param string $url the URL to POST batches of events
|
78 |
+
* @param string $description an optional description of the webhook
|
79 |
+
* @param array $events an optional list of events that will be posted to the webhook
|
80 |
+
* - events[] string the individual event to listen for
|
81 |
+
* @return struct the information for the updated webhook
|
82 |
+
* - id integer a unique integer indentifier for the webhook
|
83 |
+
* - url string The URL that the event data will be posted to
|
84 |
+
* - description string a description of the webhook
|
85 |
+
* - auth_key string the key used to requests for this webhook
|
86 |
+
* - events array The message events that will be posted to the hook
|
87 |
+
* - events[] string the individual message event (send, hard_bounce, soft_bounce, open, click, spam, unsub, or reject)
|
88 |
+
* - created_at string the date and time that the webhook was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
89 |
+
* - last_sent_at string the date and time that the webhook last successfully received events as a UTC string in YYYY-MM-DD HH:MM:SS format
|
90 |
+
* - batches_sent integer the number of event batches that have ever been sent to this webhook
|
91 |
+
* - events_sent integer the total number of events that have ever been sent to this webhook
|
92 |
+
* - last_error string if we've ever gotten an error trying to post to this webhook, the last error that we've seen
|
93 |
+
*/
|
94 |
+
public function update($id, $url, $description=null, $events=array()) {
|
95 |
+
$_params = array("id" => $id, "url" => $url, "description" => $description, "events" => $events);
|
96 |
+
return $this->master->call('webhooks/update', $_params);
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Delete an existing webhook
|
101 |
+
* @param integer $id the unique identifier of a webhook belonging to this account
|
102 |
+
* @return struct the information for the deleted webhook
|
103 |
+
* - id integer a unique integer indentifier for the webhook
|
104 |
+
* - url string The URL that the event data will be posted to
|
105 |
+
* - description string a description of the webhook
|
106 |
+
* - auth_key string the key used to requests for this webhook
|
107 |
+
* - events array The message events that will be posted to the hook
|
108 |
+
* - events[] string the individual message event (send, hard_bounce, soft_bounce, open, click, spam, unsub, or reject)
|
109 |
+
* - created_at string the date and time that the webhook was created as a UTC string in YYYY-MM-DD HH:MM:SS format
|
110 |
+
* - last_sent_at string the date and time that the webhook last successfully received events as a UTC string in YYYY-MM-DD HH:MM:SS format
|
111 |
+
* - batches_sent integer the number of event batches that have ever been sent to this webhook
|
112 |
+
* - events_sent integer the total number of events that have ever been sent to this webhook
|
113 |
+
* - last_error string if we've ever gotten an error trying to post to this webhook, the last error that we've seen
|
114 |
+
*/
|
115 |
+
public function delete($id) {
|
116 |
+
$_params = array("id" => $id);
|
117 |
+
return $this->master->call('webhooks/delete', $_params);
|
118 |
+
}
|
119 |
+
|
120 |
+
}
|
121 |
+
|
122 |
+
|
lib/Mandrill/Mandrill/Whitelists.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Mandrill_Whitelists {
|
4 |
+
public function __construct(Mandrill_Mandrill $master) {
|
5 |
+
$this->master = $master;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Adds an email to your email rejection whitelist. If the address is
|
10 |
+
currently on your blacklist, that blacklist entry will be removed
|
11 |
+
automatically.
|
12 |
+
* @param string $email an email address to add to the whitelist
|
13 |
+
* @param string $comment an optional description of why the email was whitelisted
|
14 |
+
* @return struct a status object containing the address and the result of the operation
|
15 |
+
* - email string the email address you provided
|
16 |
+
* - added boolean whether the operation succeeded
|
17 |
+
*/
|
18 |
+
public function add($email, $comment=null) {
|
19 |
+
$_params = array("email" => $email, "comment" => $comment);
|
20 |
+
return $this->master->call('whitelists/add', $_params);
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Retrieves your email rejection whitelist. You can provide an email
|
25 |
+
address or search prefix to limit the results. Returns up to 1000 results.
|
26 |
+
* @param string $email an optional email address or prefix to search by
|
27 |
+
* @return array up to 1000 whitelist entries
|
28 |
+
* - return[] struct the information for each whitelist entry
|
29 |
+
* - email string the email that is whitelisted
|
30 |
+
* - detail string a description of why the email was whitelisted
|
31 |
+
* - created_at string when the email was added to the whitelist
|
32 |
+
*/
|
33 |
+
public function getList($email=null) {
|
34 |
+
$_params = array("email" => $email);
|
35 |
+
return $this->master->call('whitelists/list', $_params);
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Removes an email address from the whitelist.
|
40 |
+
* @param string $email the email address to remove from the whitelist
|
41 |
+
* @return struct a status object containing the address and whether the deletion succeeded
|
42 |
+
* - email string the email address that was removed from the blacklist
|
43 |
+
* - deleted boolean whether the address was deleted successfully
|
44 |
+
*/
|
45 |
+
public function delete($email) {
|
46 |
+
$_params = array("email" => $email);
|
47 |
+
return $this->master->call('whitelists/delete', $_params);
|
48 |
+
}
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
|
lib/Mandrill/Message.php
ADDED
@@ -0,0 +1,191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author : Ebizmarts <info@ebizmarts.com>
|
4 |
+
* Date : 8/14/14
|
5 |
+
* Time : 6:48 PM
|
6 |
+
* File : Message.php
|
7 |
+
* Module : Ebizmarts_Mandrill
|
8 |
+
*/
|
9 |
+
class Mandrill_Message extends Mandrill_Mandrill
|
10 |
+
{
|
11 |
+
protected $_attachments = array();
|
12 |
+
protected $_bcc = array();
|
13 |
+
protected $_bodyText = false;
|
14 |
+
protected $_bodyHtml = false;
|
15 |
+
protected $_subject = null;
|
16 |
+
protected $_from = null;
|
17 |
+
protected $_to = array();
|
18 |
+
protected $_headers = array();
|
19 |
+
|
20 |
+
|
21 |
+
public function createAttachment($body,
|
22 |
+
$mimeType = Zend_Mime::TYPE_OCTETSTREAM,
|
23 |
+
$disposition = Zend_Mime::DISPOSITION_ATTACHMENT,
|
24 |
+
$encoding = Zend_Mime::ENCODING_BASE64,
|
25 |
+
$filename = null)
|
26 |
+
{
|
27 |
+
$att = array('type' => $mimeType,'name' => $filename,'content'=> base64_encode($body));
|
28 |
+
array_push($this->_attachments,$att);
|
29 |
+
}
|
30 |
+
public function log($m)
|
31 |
+
{
|
32 |
+
$storeId = Mage::app()->getStore()->getId();
|
33 |
+
if(Mage::getStoreConfig(Ebizmarts_Mandrill_Model_System_Config::ENABLE_LOG,$storeId))
|
34 |
+
{
|
35 |
+
Mage::log($m,Zend_Log::INFO,'Mandrill.log');
|
36 |
+
}
|
37 |
+
}
|
38 |
+
public function getAttachments()
|
39 |
+
{
|
40 |
+
return $this->_attachments;
|
41 |
+
}
|
42 |
+
public function addBcc($bcc)
|
43 |
+
{
|
44 |
+
$storeId = Mage::app()->getStore()->getId();
|
45 |
+
if(is_array($bcc))
|
46 |
+
{
|
47 |
+
foreach($bcc as $email)
|
48 |
+
{
|
49 |
+
array_push($this->_bcc,$email);
|
50 |
+
}
|
51 |
+
}
|
52 |
+
else
|
53 |
+
{
|
54 |
+
array_push($this->_bcc,$bcc);
|
55 |
+
}
|
56 |
+
}
|
57 |
+
public function getBcc()
|
58 |
+
{
|
59 |
+
return $this->_bcc;
|
60 |
+
}
|
61 |
+
public function addTo($email, $name='')
|
62 |
+
{
|
63 |
+
if (!is_array($email)) {
|
64 |
+
$email = array($name => $email);
|
65 |
+
}
|
66 |
+
|
67 |
+
foreach ($email as $n => $recipient) {
|
68 |
+
$this->_to[] = $recipient;
|
69 |
+
}
|
70 |
+
|
71 |
+
return $this;
|
72 |
+
}
|
73 |
+
public function getTo()
|
74 |
+
{
|
75 |
+
return $this->_to;
|
76 |
+
}
|
77 |
+
|
78 |
+
public function setBodyHtml($html, $charset = null, $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE)
|
79 |
+
{
|
80 |
+
$this->_bodyHtml = $html;
|
81 |
+
}
|
82 |
+
public function getBodyHtml()
|
83 |
+
{
|
84 |
+
return $this->_bodyHtml;
|
85 |
+
}
|
86 |
+
public function setBodyText($txt, $charset = null, $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE)
|
87 |
+
{
|
88 |
+
$this->_bodyText = $txt;
|
89 |
+
}
|
90 |
+
public function getBodyText()
|
91 |
+
{
|
92 |
+
return $this->_bodyText;
|
93 |
+
}
|
94 |
+
public function setSubject($subject)
|
95 |
+
{
|
96 |
+
if ($this->_subject === null) {
|
97 |
+
$subject = $this->_filterOther($subject);
|
98 |
+
$this->_subject = $subject;
|
99 |
+
}
|
100 |
+
return $this;
|
101 |
+
}
|
102 |
+
public function getSubject()
|
103 |
+
{
|
104 |
+
return $this->_subject;
|
105 |
+
}
|
106 |
+
public function setFrom($email, $name = null)
|
107 |
+
{
|
108 |
+
|
109 |
+
$email = $this->_filterEmail($email);
|
110 |
+
// $name = $this->_filterName($name);
|
111 |
+
$this->_from = $email;
|
112 |
+
// $this->_storeHeader('From', $this->_formatAddress($email, $name), true);
|
113 |
+
|
114 |
+
return $this;
|
115 |
+
}
|
116 |
+
public function getFrom()
|
117 |
+
{
|
118 |
+
return $this->_from;
|
119 |
+
}
|
120 |
+
protected function _filterEmail($email)
|
121 |
+
{
|
122 |
+
$rule = array("\r" => '',
|
123 |
+
"\n" => '',
|
124 |
+
"\t" => '',
|
125 |
+
'"' => '',
|
126 |
+
',' => '',
|
127 |
+
'<' => '',
|
128 |
+
'>' => '',
|
129 |
+
);
|
130 |
+
|
131 |
+
return strtr($email, $rule);
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Filter of name data
|
136 |
+
*
|
137 |
+
* @param string $name
|
138 |
+
* @return string
|
139 |
+
*/
|
140 |
+
protected function _filterName($name)
|
141 |
+
{
|
142 |
+
$rule = array("\r" => '',
|
143 |
+
"\n" => '',
|
144 |
+
"\t" => '',
|
145 |
+
'"' => "'",
|
146 |
+
'<' => '[',
|
147 |
+
'>' => ']',
|
148 |
+
);
|
149 |
+
|
150 |
+
return trim(strtr($name, $rule));
|
151 |
+
}
|
152 |
+
protected function _filterOther($data)
|
153 |
+
{
|
154 |
+
$rule = array("\r" => '',
|
155 |
+
"\n" => '',
|
156 |
+
"\t" => '',
|
157 |
+
);
|
158 |
+
|
159 |
+
return strtr($data, $rule);
|
160 |
+
}
|
161 |
+
public function setReplyTo($email, $name = null)
|
162 |
+
{
|
163 |
+
$email = $this->_filterEmail($email);
|
164 |
+
$name = $this->_filterName($name);
|
165 |
+
$this->_headers[] = array('Reply-To'=>sprintf('%s <%s>',$name,$email));
|
166 |
+
return $this;
|
167 |
+
}
|
168 |
+
public function addHeader($name, $value, $append = false)
|
169 |
+
{
|
170 |
+
$prohibit = array('to', 'cc', 'bcc', 'from', 'subject',
|
171 |
+
'reply-to', 'return-path',
|
172 |
+
'date', 'message-id',
|
173 |
+
);
|
174 |
+
if (in_array(strtolower($name), $prohibit)) {
|
175 |
+
/**
|
176 |
+
* @see Zend_Mail_Exception
|
177 |
+
*/
|
178 |
+
#require_once 'Zend/Mail/Exception.php';
|
179 |
+
throw new Zend_Mail_Exception('Cannot set standard header from addHeader()');
|
180 |
+
}
|
181 |
+
|
182 |
+
$this->_header[] = array($name=>$value);
|
183 |
+
|
184 |
+
return $this;
|
185 |
+
}
|
186 |
+
public function getHeaders()
|
187 |
+
{
|
188 |
+
return $this->_headers;
|
189 |
+
}
|
190 |
+
|
191 |
+
}
|
package.xml
CHANGED
@@ -1,31 +1,28 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ebizmarts_MageMonkey</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>MailChimp integration for Magento by Ebizmarts</summary>
|
10 |
<description>Full MailChimp integration, automatic webhooks, multiple lists, interest groups</description>
|
11 |
-
<notes>
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-

|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
<authors><author><name>Ebizmarts Development Team</name><user>ebizmarts</user><email>info@ebizmarts.com</email></author></authors>
|
26 |
-
<date>2014-05-09</date>
|
27 |
-
<time>19:57:48</time>
|
28 |
-
<contents><target name="magecommunity"><dir name="Ebizmarts"><dir name="AbandonedCart"><dir name="Block"><dir name="Adminhtml"><dir name="Abandonedmails"><file name="Grid.php" hash="1d6aa7470345b86ebc544865b1d5988b"/></dir><file name="Abandonedmails.php" hash="1602122456b4a710638e049e87135a57"/><dir name="Abandonedorder"><file name="Grid.php" hash="abdca6b6f4eb45a73eb55b5d553ef4cd"/></dir><file name="Abandonedorder.php" hash="eb6b272bf9da062c0d922f733fd5684d"/><dir name="Dashboard"><file name="Sales.php" hash="0242b35fd7d779e997c9d583d2067200"/><file name="Totals.php" hash="592fdd17f9c4fd19181e37eb47c2a348"/></dir><file name="Dashboard.php" hash="b308fe4aa4339bb980f911ddaf244bf1"/><dir name="System"><dir name="Config"><file name="Date.php" hash="c2c968c7e44e4512afcf1d280b596b12"/><dir name="Fieldset"><file name="Hint.php" hash="7421b2285cbf14f737f197647c444e13"/></dir></dir></dir></dir><dir name="Email"><dir name="Order"><file name="Items.php" hash="c18a4206bfc381771978568276a7a93d"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="3e1fa681e66943898a0ee4e5c7330814"/></dir><dir name="Model"><file name="Config.php" hash="e29adc5eb69c371307de1d4316c7efdb"/><file name="Cron.php" hash="f61ef8688dff08de79994cc370463d48"/><file name="EventObserver.php" hash="9db91c963384183d0bf21ec686620594"/><file name="Mailssent.php" hash="c4bb348f7df03d057b6e71793a35099f"/><dir name="Resource"><dir name="Mailssent"><file name="Collection.php" hash="32a7f66ed04d2774708608e93673eb60"/></dir><file name="Mailssent.php" hash="587b8c706766b178be80dc6539e4172b"/><dir name="Order"><file name="Collection.php" hash="7ba53f0d262e55e55c2212bffeff3fc7"/></dir></dir><dir name="System"><dir name="Config"><file name="Automatic.php" hash="4796f50ff325b34bb7478ae19da5f455"/><file name="Cmspage.php" hash="97fb52c0878ba73934fc54bd23a00284"/><file name="Customergroup.php" hash="56192685ca9110ae95431fc63c494e25"/><file name="Discounttype.php" hash="680ae0d05305ea8ead09bd176914935d"/><file name="Unit.php" hash="a20bb2f70dbff61ad99b12e169116a68"/></dir></dir></dir><dir name="controllers"><file name="AbandonedController.php" hash="c5d4146adaaa34ca06cc444299c13bd1"/><dir name="Adminhtml"><file name="AbandonedmailsController.php" hash="53e508bee05b83175bf940e8e569e5c5"/><file name="AbandonedorderController.php" hash="fa050d8ecfe1d665178375c677a83c38"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="c2a82d9e46d715f3d10a5ae40f457c89"/><file name="config.xml" hash="a80947ce8926b8f751002c0ec8cc9df3"/><file name="system.xml" hash="8dbddb62fd9413ed1620732fc6ddcfbf"/></dir><dir name="sql"><dir name="ebizmarts_abandonedcart_setup"><file name="mysql4-install-0.1.0.php" hash="0e1a8c0391654c480773b78a50db5a83"/><file name="mysql4-upgrade-0.1.12-0.1.13.php" hash="4835436b744f8cbff61a66c2e345976f"/><file name="mysql4-upgrade-0.1.18-0.1.19.php" hash="e51b332cb70c81ee472b586fda4e8a7e"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="2e87d09a5008ac2f2432a25e08474c87"/><file name="mysql4-upgrade-0.1.20-0.1.21.php" hash="c461ba10961b4ee4e9385173d4264617"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="60daa0d70a1af929a39d6e20ee52ee9c"/></dir></dir></dir><dir name="Autoresponder"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backtostock"><dir name="Fieldset"><file name="Hint.php" hash="2ce3d676335024c283c8cb7004f2fd70"/></dir></dir><dir name="Birthday"><dir name="Fieldset"><file name="Hint.php" hash="b90407590390af8a3b7a5f28fe30fc1d"/></dir></dir><dir name="Fieldset"><file name="Hint.php" hash="6512f3966ad7a5805b37ec347fe3f45d"/></dir><dir name="Review"><dir name="Fieldset"><file name="Hint.php" hash="3a30e310d54d553551645b4ba65d3a97"/></dir></dir><dir name="Wishlist"><dir name="Fieldset"><file name="Hint.php" hash="d958534a50e224778b4f21ab91965c93"/></dir></dir></dir></dir></dir><dir name="Backtostock"><file name="Notice.php" hash="a0ed5dc687baa5eff1c5582fe3d1d7b8"/></dir><dir name="Customer"><dir name="Account"><file name="List.php" hash="12114dfff4daa3fb66ec67886ecd65ce"/></dir></dir><dir name="Email"><dir name="Backtostock"><file name="Item.php" hash="52fdf4d6b9e46af278e845af141babaf"/></dir><dir name="Related"><file name="Items.php" hash="a307ecd59fa183dfd631f3e852d5b0b4"/></dir><dir name="Review"><file name="Items.php" hash="58310c2423a7844e4876adf0fee8d1f8"/></dir><dir name="Wishlist"><file name="Items.php" hash="ea252dac50f360125f964a493db00252"/></dir></dir><dir name="Review"><file name="Form.php" hash="36b468ca8507f5880e792cf2ca144084"/></dir><file name="Unsubscribe.php" hash="3320837d5f53290bea5911184f2f8e89"/></dir><dir name="Helper"><file name="Data.php" hash="9b4a79044374ef53028bfd53d6f6cb8c"/></dir><dir name="Model"><file name="Backtostock.php" hash="bbe12c4e362b4a6b3ff289c4cfad1c1d"/><file name="Backtostockalert.php" hash="7c13e74e80769ce9ec5348dff3146ed7"/><file name="Config.php" hash="c3d0f8a39bd9c4704cd5ef161420e345"/><file name="Cron.php" hash="b59125e9bdffba559d45ab4ad9d6d173"/><file name="EventObserver.php" hash="6d0948c1d54f6494a27cb3b81878a1be"/><dir name="Resource"><dir name="Backtostock"><file name="Collection.php" hash="ed8d4e1356ee483a17c916f3caf5e004"/></dir><file name="Backtostock.php" hash="f843a3a2c8784ebf5844dd24851152b5"/><dir name="Backtostockalert"><file name="Collection.php" hash="0c8888bcd7f10ee01c40ffb1be379b29"/></dir><file name="Backtostockalert.php" hash="667c31247de8122c896f7056f76d69e4"/><dir name="Review"><file name="Collection.php" hash="f6d6fea1af97d22c763ca066f35b60c1"/></dir><file name="Review.php" hash="c452559a7e879c3c1744d0fe2a8d3c44"/><dir name="Unsubscribe"><file name="Collection.php" hash="ce69c3e9a94270d56586d98b9848c40e"/></dir><file name="Unsubscribe.php" hash="52d3a3276a4ffc9dac8969a9f71ab7fe"/><dir name="Visited"><file name="Collection.php" hash="bd6f6853caf49b5cc775853982d080a4"/></dir><file name="Visited.php" hash="2c1255d46620bd32976ec62a74ea8ee5"/></dir><file name="Review.php" hash="3972ef6776b94ccecf6e05b2aa1972db"/><dir name="System"><dir name="Config"><file name="Automatic.php" hash="a13826aaa72aa13d783e9b8032255d11"/><file name="Couponcounter.php" hash="6a5667391ba4ec58490fef07c4b0c20b"/><file name="Customergroup.php" hash="9dacae8f22f927f63fffa065698436b0"/><file name="Discounttype.php" hash="f0434d0bd53e7a18a2a7377b9e08fe5f"/><file name="Generaltype.php" hash="871b01315f4bdcef6fe4317d0ee421fd"/><file name="Time.php" hash="3bb74c6af5f1d2d0920e290f5ff4978a"/></dir></dir><file name="Unsubscribe.php" hash="60b3692fd5f2e29c711954fd0ca91141"/><file name="Visited.php" hash="36850b4973097fd7dfe4d05c45b8dbdd"/></dir><dir name="controllers"><file name="AutoresponderController.php" hash="dcc9961677efd579fa17c9c07df10b00"/><file name="BacktostockController.php" hash="0a7f9280f87c7a663f06529e3811cfc1"/></dir><dir name="etc"><file name="adminhtml.xml" hash="59a240f12b496566f1a2b1de5f053e96"/><file name="config.xml" hash="edf3760cded047a8939bb43e2287fd25"/><file name="system.xml" hash="e46216b7e0f5b0dc36566c2a77e432e3"/></dir><dir name="sql"><dir name="ebizmarts_autoresponder_setup"><file name="mysql4-install-0.1.0.php" hash="791af0eec35753144d506294bb4c03ad"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="78438ac4a76091f713815249b89a0fb8"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="b2b4f343d16d99c1396987452fba1039"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="378accc07eb80b16029db84f56bed683"/></dir></dir></dir><dir name="MageMonkey"><dir name="Block"><dir name="Adminhtml"><dir name="Bulksync"><dir name="Export"><file name="Form.php" hash="3128fdbf1d272d661ddcd35589f6fd58"/></dir><file name="Export.php" hash="8bad2b20c02e6f46bebcf632ca1a47bb"/><dir name="Import"><file name="Form.php" hash="88dfb149d89a293f2e161cc994a6d66d"/></dir><file name="Import.php" hash="25f84fabb2e3ec99281bcdd8fa2f36da"/><dir name="Queue"><file name="Grid.php" hash="66bad4f57dada919cb46b4422aa353ec"/></dir><file name="Queue.php" hash="59ad9d88015d45a8b6874a1946cbb79b"/><dir name="QueueExport"><file name="Grid.php" hash="35e1ec26f0860c35d63132d09b22b9e0"/></dir><file name="QueueExport.php" hash="47358e2366a683b99d974f3c88fea9b9"/><dir name="QueueImport"><file name="Grid.php" hash="2291c0025c67441a667ee85c849b938c"/></dir><file name="QueueImport.php" hash="3674342fcbe1aa23499bdf5bcb16da54"/></dir><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Memberactivity.php" hash="480c555fdfd348a830af84cc1b2ec749"/></dir></dir></dir><dir name="Ecommerce"><file name="Grid.php" hash="c328363a48a54819727153270664ccf0"/></dir><file name="Ecommerce.php" hash="218f3f43ab85966c56a51b612dc0d19f"/><dir name="Ecommerceapi"><file name="Grid.php" hash="1d94069e2fe5c5ca96cabbce0ec6b398"/><dir name="Renderer"><file name="Items.php" hash="b7da6bfbfb676c8bcd812b34ee84b7bc"/></dir></dir><file name="Ecommerceapi.php" hash="35fab157ffd89365f58d3f6a7d215af8"/><dir name="Memberactivity"><file name="Grid.php" hash="0dd76b6f10e87bcc8e5516f823a53d77"/></dir><dir name="Renderer"><file name="Date.php" hash="057956ab3107ff1ab1bb63580960db00"/><file name="Importypes.php" hash="db0727a05feebbf5cb6aa4193c7aa5a2"/><file name="Lists.php" hash="d7358169a3fbbaf7422e96eb73642786"/><file name="Progress.php" hash="6476d05d169196791fca792fcc2787c5"/><file name="Yesno.php" hash="9b8689c9c2bc5e51d57d5b8a37345188"/></dir><dir name="System"><dir name="Config"><file name="Account.php" hash="e667fd667ab5b5f98aaf6aa59482b155"/><dir name="Fieldset"><file name="Hint.php" hash="c68500d47c69ad31858b0e7e8f80e1af"/></dir><dir name="Form"><dir name="Field"><file name="Mapfields.php" hash="f12afdd267131675bc65c9da4e98a27d"/></dir></dir><file name="OauthWizard.php" hash="4426268d1c895cc75282788f9c3c57fe"/></dir></dir><dir name="Transactionalemail"><dir name="Mandrill"><file name="Grid.php" hash="16f4ddfb22908829211549cd67910ed5"/></dir><file name="Mandrill.php" hash="20c99e8d4451e5e6948f1869fcf09fad"/><dir name="Newemail"><file name="Form.php" hash="6b1d604005694896751ea448bf5d4fbb"/></dir><file name="Newemail.php" hash="f3f816f536a0ff164e5c9b32de07991f"/><dir name="Sts"><file name="Grid.php" hash="125845125287b0756e1d436c590db7a1"/></dir><file name="Sts.php" hash="c94b5e2a3d4aa977dd1b505ae9dd0733"/></dir></dir><dir name="Checkout"><file name="Subscribe.php" hash="a455450dad6e612cb8c1c53130e62c52"/></dir><dir name="Customer"><dir name="Account"><file name="Lists.php" hash="63d14c898f9399f711b6225e83659908"/></dir></dir><file name="Lists.php" hash="8fba0d27d0a163e9b3c1068439d71fdc"/><file name="Signup.php" hash="222115a830f5fe9d35a7d15d811936bd"/></dir><dir name="Helper"><file name="Cache.php" hash="67e65a10f74e15e46e198ff938614d46"/><file name="Data.php" hash="ff40bacb6981f0ed8806c40bb9259cb9"/><file name="Export.php" hash="e38bc4a6a62e1d421b56b33d951b50f3"/><file name="Oauth2.php" hash="5dde916a8a3683c792d4253a80305371"/></dir><dir name="Model"><file name="Api.php" hash="84fbce714b98a7a1cba24d9a7f0ed443"/><file name="BulksyncExport.php" hash="5963222008697fe79772d7520e91705c"/><file name="BulksyncImport.php" hash="f55ae237b2a1e633a26020d646a78e33"/><file name="Cache.php" hash="64aaa1feca20ee3bbe606076d82034c7"/><file name="Cron.php" hash="2c67424b577391fb84c59827aef1e99c"/><dir name="Custom"><file name="Collection.php" hash="5cf9b979cb7d3863d1db58e4f575e8d0"/></dir><file name="Ecommerce.php" hash="d74ca44e23d32d22f5f64898028d784f"/><file name="Ecommerce360.php" hash="550bc08ace4bfe8a3f057504bf3f4045"/><dir name="Email"><file name="Template.php" hash="e1c1a054a2a99ea4341ce6c63370a589"/></dir><dir name="Feed"><file name="Updates.php" hash="f376504e208008cf935f5e84c363982d"/></dir><file name="MCAPI.php" hash="aa72303864dd40867a5d9a9fdf8bbafe"/><file name="MCEXPORTAPI.php" hash="c8f16211692cf33992fbd785019c01f7"/><file name="Monkey.php" hash="16dd9b512c80d7fc41a36cd9bebf8b82"/><dir name="Mysql4"><dir name="Apidebug"><file name="Collection.php" hash="9f75f1d9dd0f108657ac23607eff50da"/></dir><file name="Apidebug.php" hash="6fbad3a26c6608e84ef0a4d86314af0b"/><dir name="Bulksync"><dir name="Export"><file name="Collection.php" hash="44d269eed50f52146033ff89ed7a2891"/></dir><file name="Export.php" hash="4ae1ac47449cccb7ce25157f7d9d2f11"/><dir name="Import"><file name="Collection.php" hash="7e6be7ba8998b9e173b5be61b2a5f02b"/></dir><file name="Import.php" hash="422523ecbf7248e9340ed5e18486b68b"/></dir><dir name="Ecommerce"><file name="Collection.php" hash="24a35bd64c38d18e3abb2ab9dcea8f34"/></dir><file name="Ecommerce.php" hash="71a3b94d770649dd40e9eabf4a9191ca"/></dir><file name="Observer.php" hash="6ea744276a3668ec450f09b78654ac1d"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Account.php" hash="5fdee829d7167aac52f2daf91f8c4b64"/><file name="BulksyncDatasource.php" hash="bb42813d2227fecc62476ff819e6bfa0"/><file name="BulksyncStatus.php" hash="745e4a9a98c4d74e82184403de7606b8"/><file name="Checkoutsubscribe.php" hash="6d8ce080d9949eda81a5f83dcb0789e9"/><file name="CronProcessLimit.php" hash="201fb2c0d26a121b5b902fff9ba49f88"/><file name="Ecommerce360.php" hash="14a8bc7fd552ec7f35bacaca2c326def"/><file name="List.php" hash="12114a33e1301ae0f2c80e5c19a13796"/><file name="OrderStatus.php" hash="0be73f31140b5b713dcf5fc141052a5c"/><file name="Status.php" hash="4ef26d94a5a1645477c8b1aced56cf01"/><file name="TransactionalEmails.php" hash="406a0998c5d518c0cb177f8c853acb6d"/><file name="WebhookDelete.php" hash="d3628cea58b71611a9b38f3e140ecd5f"/></dir></dir></dir><dir name="TransactionalEmail"><file name="Adapter.php" hash="22d05169667a6be152a898bb2c9fb129"/><file name="MANDRILL.php" hash="b84f4f27564f68ef5a3a35a1d3bf2902"/><file name="STS.php" hash="e49a76aa693d12778dd69a4fbbd613bb"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="BulksyncController.php" hash="14e771adfcbe3395d5624e3f3ca6e8a2"/><file name="EcommerceController.php" hash="4bfd1a7890dffd5468fab55badc905c2"/><file name="TransactionalemailController.php" hash="0b1288af0ab97e26d2a07da425378249"/></dir><dir name="Customer"><file name="AccountController.php" hash="149184229b87fa5c2365992784d560ed"/></dir><file name="SignupController.php" hash="24f60fa1eaf04bf90459ef2f2d3be893"/><file name="WebhookController.php" hash="134517b313c1173fc47b5bd9481656c1"/></dir><dir name="etc"><file name="adminhtml.xml" hash="95fef632f0e0eda69d6717d7231749bd"/><file name="config.xml" hash="c4f38fc5744dac69f4781cf847a0a1e8"/><file name="system.xml" hash="f2b00fb8edb31e32178bcf9e1b0df21e"/></dir><dir name="sql"><dir name="monkey_setup"><file name="mysql4-install-0.0.1.php" hash="4df34769f4d5a8ceca90fd582500e3a9"/><file name="mysql4-upgrade-0.0.1-0.0.2.php" hash="d81147dab407bc55c59cddb5a764c53e"/><file name="mysql4-upgrade-0.0.2-0.0.3.php" hash="ce1925ff2ab03aa9fd6cbe43283ea37d"/><file name="mysql4-upgrade-0.0.3-0.0.4.php" hash="7f1e38bcf030e6346a9fd8321f1a4362"/><file name="mysql4-upgrade-0.0.4-0.0.5.php" hash="bbe6b895320effca77cc2c23431f043f"/><file name="mysql4-upgrade-0.0.5-0.0.6.php" hash="98b72d9ef4ec8078c09a1f641fc35a39"/><file name="mysql4-upgrade-0.0.6-0.0.7.php" hash="ea15755fc072e7c82b78063589360779"/><file name="mysql4-upgrade-1.0.10-1.0.11.php" hash="b2ec497921eb2bd9a97a318554fd980b"/><file name="mysql4-upgrade-1.1.5-1.1.6.php" hash="14750274ece5816d6c1ab490f7d610ab"/></dir></dir></dir><dir name="Mandrill"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="7a88051c88658d6650265c26ed532dba"/></dir><file name="Userinfo.php" hash="fc19ad47dda8547fe66d4fc13821ef66"/></dir></dir><dir name="Users"><dir name="Senders"><file name="Grid.php" hash="fbd15f7d0b651e3c0d3897672050d782"/></dir><file name="Senders.php" hash="99e60358acb36389b10a7e7c02d9a8f6"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="c8587a3d23e283bd9643fe74c9bd135f"/></dir><dir name="Model"><file name="Customcollection.php" hash="f024ab2663565eeca20a0d071e0cffbc"/><dir name="Email"><file name="Template.php" hash="a10f149033ffd6a8224d85f244393e0e"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Userinfo.php" hash="7ebeeb08caa8a0413cab7ba0c7316e1e"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Mandrill"><file name="UsersController.php" hash="22458a083848a119e36edad0fba44972"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="edc966e4e162e73e9955bc7de57b7f74"/><file name="config.xml" hash="da5b10af4ff6b2655d56d1e10c14be62"/><file name="system.xml" hash="c46c48e817034d874aa4a675cf841425"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ebizmarts_MageMonkey.xml" hash="9a4b1c469b4652442c7a5f945dd12cac"/><file name="Ebizmarts_Mandrill.xml" hash="c80aa6f98ccc3890303bb4c278f8ad95"/><file name="Ebizmarts_Autoresponder.xml" hash="97302f94f5893147db18c4034d135256"/><file name="Ebizmarts_AbandonedCart.xml" hash="48c4cfe8246d5a995e2836c43ab38d74"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="ebizmarts"><file name="abandonedcart.xml" hash="72945454a4d24ef8d1718bf177272ffe"/><file name="autoresponder.xml" hash="f85ced7b7bbcea27f5370b166ff971a8"/></dir><file name="magemonkey.xml" hash="f86c4a1e77468bf497bbc31f00d379c9"/></dir><dir name="template"><dir name="magemonkey"><dir name="checkout"><file name="subscribe.phtml" hash="e6fc1193e1416db374f17783084f384e"/></dir><file name="lists.phtml" hash="8fdb435eb979aa15372076629503640b"/></dir><dir name="ebizmarts_abandonedcart"><dir name="email"><dir name="order"><dir name="items"><dir name="order"><file name="default.phtml" hash="5ff74635419e7ffb4d3660c306ad6590"/></dir></dir><file name="items.phtml" hash="cd81265b83dc2df835301b5fafb70f8f"/></dir></dir></dir><dir name="ebizmarts"><dir name="autoresponder"><dir name="backtostock"><dir name="catalog"><dir name="product"><file name="form.phtml" hash="0bf63a70962abf54ad5d995ef38724d3"/><file name="notice.phtml" hash="50e73f8633d6c90ef0a6f630e4d23802"/></dir></dir><file name="item.phtml" hash="f21ac40fa3279b8765012de283206e71"/></dir><dir name="customer"><file name="list.phtml" hash="be9cd36a644a39e3569c9ae0ded2087d"/></dir><dir name="related"><file name="items.phtml" hash="b05bfbbe1bdf48324d2e3e2df7d7ae97"/></dir><dir name="review"><file name="items.phtml" hash="a1fdcb739b6032b607e67047fd3b65f9"/></dir><file name="unsubscribe.phtml" hash="2635dae225a8a4536d58a87c4de9054d"/><dir name="wishlist"><file name="items.phtml" hash="217b12ebbabd46d14c2a95b57aa9dad0"/></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="ebizmarts"><file name="abandonedcart.xml" hash="56b2ca552b73a976207cd33afbcfb299"/><file name="abandonedcart.xml" hash="56b2ca552b73a976207cd33afbcfb299"/></dir><file name="magemonkey.xml" hash="613e5cd38048dedadb96434b9c3cc704"/><file name="mandrill.xml" hash="a79308bc32db35d45b151c01041be72d"/></dir><dir name="template"><dir name="ebizmarts"><dir name="abandonedcart"><dir name="dashboard"><file name="index.phtml" hash="180d73784745e0c1d5b37b0d435a2cc0"/><file name="salebar.phtml" hash="50a0c2645e2f651da9ba72fd875986cb"/><file name="totalbar.phtml" hash="139566ade758da1b8763590c680d65bd"/></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="769a7167480f7dd4e46a5cc99e88af20"/></dir></dir></dir></dir><dir name="autoresponder"><dir name="system"><dir name="config"><dir name="backtostock"><dir name="fieldset"><file name="hint.phtml" hash="f02d4d7e5e45bc45b20cf8d531017c61"/></dir></dir><dir name="birthday"><dir name="fieldset"><file name="hint.phtml" hash="577162540f6f45b822d7784463c31456"/></dir></dir><dir name="fieldset"><file name="hint.phtml" hash="4dc3f6561861ae893eda757221ca8027"/></dir><dir name="review"><dir name="fieldset"><file name="hint.phtml" hash="a3e506441b757f5372337fa59de1d64f"/></dir></dir><dir name="wishlist"><dir name="fieldset"><file name="hint.phtml" hash="8f4427235da3afa30d271745f040c767"/></dir></dir></dir></dir></dir></dir><dir name="magemonkey"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="f4bbe778592be65a6b452002dfc84c24"/></dir><file name="oauth_wizard.phtml" hash="226d42be1f41838bb80da0e2c3567d71"/></dir></dir></dir><dir name="mandrill"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="d4025820e90c8e20bc8c6664984a78a1"/></dir><file name=".DS_Store" hash="40417025e55f5123b774e00f7e6e85da"/></dir><file name=".DS_Store" hash="2aa13fb9b981abc32578af2c9fca6a26"/></dir><file name=".DS_Store" hash="4b3efb1c0d10a07bde02cec631a81bbb"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Ebizmarts_AbandonedCart.csv" hash="29ee25f32946e687917cf542aaa66941"/><file name="Ebizmarts_MageMonkey.csv" hash="181e91ed91dfea5fe7dab66af5719af8"/><file name="Ebizmarts_Mandrill.csv" hash="3dac3af57664fd34f5eda8abf4098ee0"/><dir name="template"><dir name="email"><dir name="ebizmarts"><dir name="autoresponder"><file name="backtostock.html" hash="f470d282c2c91627119a131210aab56f"/><file name="birthday.html" hash="80c07ab41e13f953bac72f6164a8e9b1"/><file name="neworder.html" hash="c5f7af81d02baa3b4c851f327640c9d0"/><file name="noactivity.html" hash="9dfb99e8cea787a37e552c1e7ecdc961"/><file name="relatedproducts.html" hash="68a2b450dfeff78b4aefd77c1b6000b3"/><file name="review.html" hash="4fbb9589e1b1b7d6a356a59baa7382cb"/><file name="reviewcoupon.html" hash="a169187b1d057bb62f2b154c7c1589fc"/><file name="visitedproducts.html" hash="39eb203e97a10dc3944a57f07103b340"/><file name="wishlist.html" hash="f8dc86167dd0df3100f8821b8db77285"/></dir></dir><dir name="sales"><file name="abandoned_cart.html" hash="98e069b6316232dc155408326162c3aa"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="ebizmarts"><dir name="autoresponders"><file name="visitedproducts.js" hash="a8baeac3511ff874b7972c9008c6543b"/></dir></dir></dir></target><target name="magelib"><dir name="Mandrill"><file name="API.php" hash="9339873211ba696114c51c47a0efcc27"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="ebizmarts"><file name="ebizmarts-tab.png" hash="6dfa08c5cd4329d1df6e7b71fb1f925a"/><file name="ebizmarts.css" hash="10afb44e9b6b09378da6f7adccf1a711"/></dir><dir name="abandonedcart"><file name="abandonedcart.css" hash="0d29bc510ac4af6ae38b89c62019f797"/></dir><dir name="magemonkey"><file name="magemonkey.css" hash="00f0b145e9f9cc99eb46cf97faba3f65"/><file name="magemonkey.js" hash="e40717a83ef300776cc79ad9f8191005"/><file name="mailchimp-connected-ebizmarts-title.png" hash="c6bcb1aa606ecd3b0a9753bb48ddeb58"/><file name="mailchimp-ico.png" hash="14978ec398cede4060bc9b00365bb6c5"/><file name="mailchimp-section-background.png" hash="d4536261c6a3534fbb855428c0cca62c"/><file name="mailchimp-tab.png" hash="61972b4e063364071e81d8c9e10d8feb"/></dir><dir name="mandrill"><file name="mandrill-tab.png" hash="d7eaf9deef355e4b8b55a96070b90ffe"/><file name="mandrill.css" hash="37a538f63b82a486c364b337420ca8ad"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="magemonkey"><file name="magemonkey.css" hash="d4eac40764271596a3edc30d1014887f"/><file name="monkey.js" hash="d7d2e3f137d97202214fe29551695739"/></dir></dir></dir></dir></target></contents>
|
29 |
<compatible/>
|
30 |
-
<dependencies
|
31 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Ebizmarts_MageMonkey</name>
|
4 |
+
<version>1.1.22</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>MailChimp integration for Magento by Ebizmarts</summary>
|
10 |
<description>Full MailChimp integration, automatic webhooks, multiple lists, interest groups</description>
|
11 |
+
<notes>1.1.22
|
12 |
+
--------
|
13 |
+
- New Mandrill implementation
|
14 |
+
- Async implementation for subscritions and ecommerce360
|
15 |
+
- New mark for identify if the customers click on subscribe or not
|
16 |
+
- New implementation for differentiate abandoned cart emails
|
17 |
+
- New buttons for reset ecommerce360 order (local and remote)
|
18 |
+
- New customer group management
|
19 |
+
- Fix for product availability in abandoned cart
|
20 |
+
- Fix for ecommerce360 currency
|
21 |
+
- Fix for coupons</notes>
|
22 |
+
<authors><author><name>Ebizmarts Development Team</name><user>auto-converted</user><email>info@ebizmarts.com</email></author></authors>
|
23 |
+
<date>2014-09-22</date>
|
24 |
+
<time>20:08:08</time>
|
25 |
+
<contents><target name="magecommunity"><dir name="Ebizmarts"><dir name="MageMonkey"><dir name="Block"><dir name="Adminhtml"><dir name="Bulksync"><dir name="Export"><file name="Form.php" hash="3128fdbf1d272d661ddcd35589f6fd58"/></dir><dir name="Import"><file name="Form.php" hash="88dfb149d89a293f2e161cc994a6d66d"/></dir><dir name="Queue"><file name="Grid.php" hash="66bad4f57dada919cb46b4422aa353ec"/></dir><dir name="QueueExport"><file name="Grid.php" hash="35e1ec26f0860c35d63132d09b22b9e0"/></dir><dir name="QueueImport"><file name="Grid.php" hash="2291c0025c67441a667ee85c849b938c"/></dir><file name="Export.php" hash="8bad2b20c02e6f46bebcf632ca1a47bb"/><file name="Import.php" hash="25f84fabb2e3ec99281bcdd8fa2f36da"/><file name="Queue.php" hash="59ad9d88015d45a8b6874a1946cbb79b"/><file name="QueueExport.php" hash="47358e2366a683b99d974f3c88fea9b9"/><file name="QueueImport.php" hash="3674342fcbe1aa23499bdf5bcb16da54"/></dir><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Memberactivity.php" hash="480c555fdfd348a830af84cc1b2ec749"/></dir></dir></dir><dir name="Ecommerce"><file name="Grid.php" hash="c328363a48a54819727153270664ccf0"/></dir><dir name="Ecommerceapi"><dir name="Renderer"><file name="Items.php" hash="b7da6bfbfb676c8bcd812b34ee84b7bc"/></dir><file name="Grid.php" hash="1d94069e2fe5c5ca96cabbce0ec6b398"/></dir><dir name="Memberactivity"><file name="Grid.php" hash="0dd76b6f10e87bcc8e5516f823a53d77"/></dir><dir name="Renderer"><file name="Date.php" hash="057956ab3107ff1ab1bb63580960db00"/><file name="Importypes.php" hash="db0727a05feebbf5cb6aa4193c7aa5a2"/><file name="Lists.php" hash="d7358169a3fbbaf7422e96eb73642786"/><file name="Progress.php" hash="6476d05d169196791fca792fcc2787c5"/><file name="Yesno.php" hash="9b8689c9c2bc5e51d57d5b8a37345188"/></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="c68500d47c69ad31858b0e7e8f80e1af"/></dir><dir name="Form"><dir name="Field"><file name="Mapfields.php" hash="f12afdd267131675bc65c9da4e98a27d"/></dir></dir><file name="Account.php" hash="e667fd667ab5b5f98aaf6aa59482b155"/><file name="Date.php" hash="c7aa6aa77b9ba59119a753a6e217f0ab"/><file name="OauthWizard.php" hash="4426268d1c895cc75282788f9c3c57fe"/><file name="ResetLocalEcommerce.php" hash="e42a097caf3af8a1927748ff0ed36509"/><file name="ResetRemoteEcommerce.php" hash="0912559d8068a1af340765695b36eb7e"/></dir></dir><dir name="Transactionalemail"><dir name="Mandrill"><file name="Grid.php" hash="16f4ddfb22908829211549cd67910ed5"/></dir><dir name="Newemail"><file name="Form.php" hash="6b1d604005694896751ea448bf5d4fbb"/></dir><dir name="Sts"><file name="Grid.php" hash="125845125287b0756e1d436c590db7a1"/></dir><file name="Mandrill.php" hash="20c99e8d4451e5e6948f1869fcf09fad"/><file name="Newemail.php" hash="f3f816f536a0ff164e5c9b32de07991f"/><file name="Sts.php" hash="c94b5e2a3d4aa977dd1b505ae9dd0733"/></dir><file name="Ecommerce.php" hash="218f3f43ab85966c56a51b612dc0d19f"/><file name="Ecommerceapi.php" hash="35fab157ffd89365f58d3f6a7d215af8"/></dir><dir name="Checkout"><file name="Subscribe.php" hash="a455450dad6e612cb8c1c53130e62c52"/></dir><dir name="Customer"><dir name="Account"><file name="Lists.php" hash="63d14c898f9399f711b6225e83659908"/></dir></dir><file name="Lists.php" hash="f28a37562c410fba09d976e730f769af"/><file name="Signup.php" hash="222115a830f5fe9d35a7d15d811936bd"/></dir><dir name="Helper"><file name="Cache.php" hash="67e65a10f74e15e46e198ff938614d46"/><file name="Data.php" hash="9e1708ebd0dc4924e4973697142d7839"/><file name="Export.php" hash="e38bc4a6a62e1d421b56b33d951b50f3"/><file name="Oauth2.php" hash="5dde916a8a3683c792d4253a80305371"/></dir><dir name="Model"><dir name="Custom"><file name="Collection.php" hash="5cf9b979cb7d3863d1db58e4f575e8d0"/></dir><dir name="Email"><file name="Template.php" hash="e1c1a054a2a99ea4341ce6c63370a589"/></dir><dir name="Feed"><file name="Updates.php" hash="f376504e208008cf935f5e84c363982d"/></dir><dir name="Mysql4"><dir name="Apidebug"><file name="Collection.php" hash="9f75f1d9dd0f108657ac23607eff50da"/></dir><dir name="Asyncorders"><file name="Collection.php" hash="c3ef445b7524a374c725e8872347e627"/></dir><dir name="Asyncsubscribers"><file name="Collection.php" hash="766012d25d0b1edd1550a80a046e56c9"/></dir><dir name="Bulksync"><dir name="Export"><file name="Collection.php" hash="44d269eed50f52146033ff89ed7a2891"/></dir><dir name="Import"><file name="Collection.php" hash="7e6be7ba8998b9e173b5be61b2a5f02b"/></dir><file name="Export.php" hash="4ae1ac47449cccb7ce25157f7d9d2f11"/><file name="Import.php" hash="422523ecbf7248e9340ed5e18486b68b"/></dir><dir name="Ecommerce"><file name="Collection.php" hash="24a35bd64c38d18e3abb2ab9dcea8f34"/></dir><file name="Apidebug.php" hash="6fbad3a26c6608e84ef0a4d86314af0b"/><file name="Asyncorders.php" hash="63fe2090cc9421409669d1b1acdc2bee"/><file name="Asyncsubscribers.php" hash="42c900ee0d457187631208a9d1201fd2"/><file name="Ecommerce.php" hash="71a3b94d770649dd40e9eabf4a9191ca"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Account.php" hash="5fdee829d7167aac52f2daf91f8c4b64"/><file name="BulksyncDatasource.php" hash="bb42813d2227fecc62476ff819e6bfa0"/><file name="BulksyncStatus.php" hash="745e4a9a98c4d74e82184403de7606b8"/><file name="Checkoutsubscribe.php" hash="b2db54b9fb5c3cec5d64dc3bacb437cc"/><file name="CronProcessLimit.php" hash="201fb2c0d26a121b5b902fff9ba49f88"/><file name="CustomerGroup.php" hash="fdd4a2532a7e67dc5206a0cd67c4b859"/><file name="Ecommerce360.php" hash="14a8bc7fd552ec7f35bacaca2c326def"/><file name="List.php" hash="12114a33e1301ae0f2c80e5c19a13796"/><file name="OrderProcessLimit.php" hash="54358f98da63c7c3c6eef0002ee5364b"/><file name="OrderStatus.php" hash="0be73f31140b5b713dcf5fc141052a5c"/><file name="Status.php" hash="4ef26d94a5a1645477c8b1aced56cf01"/><file name="TransactionalEmails.php" hash="406a0998c5d518c0cb177f8c853acb6d"/><file name="WebhookDelete.php" hash="d3628cea58b71611a9b38f3e140ecd5f"/></dir></dir></dir><dir name="TransactionalEmail"><file name="Adapter.php" hash="22d05169667a6be152a898bb2c9fb129"/><file name="MANDRILL.php" hash="b84f4f27564f68ef5a3a35a1d3bf2902"/><file name="STS.php" hash="e49a76aa693d12778dd69a4fbbd613bb"/></dir><file name="Api.php" hash="84fbce714b98a7a1cba24d9a7f0ed443"/><file name="Asyncorders.php" hash="1b738740a19ea53869e3e19e531ddd03"/><file name="Asyncsubscribers.php" hash="502567bfcb6ab39bd310e670b590eeb3"/><file name="BulksyncExport.php" hash="5963222008697fe79772d7520e91705c"/><file name="BulksyncImport.php" hash="f55ae237b2a1e633a26020d646a78e33"/><file name="Cache.php" hash="64aaa1feca20ee3bbe606076d82034c7"/><file name="Cron.php" hash="e68a4a99bc5fda1bdd3776c3e63f9761"/><file name="Ecommerce.php" hash="d74ca44e23d32d22f5f64898028d784f"/><file name="Ecommerce360.php" hash="bff87004ce4eb7410dfde9ab7e4ffddc"/><file name="MCAPI.php" hash="086a523af515ce216ac20730f56bdd47"/><file name="MCEXPORTAPI.php" hash="c8f16211692cf33992fbd785019c01f7"/><file name="Monkey.php" hash="16dd9b512c80d7fc41a36cd9bebf8b82"/><file name="Observer.php" hash="8e2471c52572c2513811603c68f2f0a1"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BulksyncController.php" hash="14e771adfcbe3395d5624e3f3ca6e8a2"/><file name="ConfigController.php" hash="72dcb0b31d5bcaaab9f9d4ca4a6e22e6"/><file name="EcommerceController.php" hash="97d7b13c988d2f276560a4a2fb523a5e"/><file name="TransactionalemailController.php" hash="0b1288af0ab97e26d2a07da425378249"/></dir><dir name="Customer"><file name="AccountController.php" hash="149184229b87fa5c2365992784d560ed"/></dir><file name="SignupController.php" hash="24f60fa1eaf04bf90459ef2f2d3be893"/><file name="WebhookController.php" hash="134517b313c1173fc47b5bd9481656c1"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2cd1bef6c2144cfbdcd68da1647e100c"/><file name="config.xml" hash="c1a3fd94f2503cf606bf90cd36ac3f77"/><file name="system.xml" hash="fd1923beed4749924162c6c257cbcb7c"/></dir><dir name="sql"><dir name="monkey_setup"><file name="mysql4-install-0.0.1.php" hash="4df34769f4d5a8ceca90fd582500e3a9"/><file name="mysql4-upgrade-0.0.1-0.0.2.php" hash="d81147dab407bc55c59cddb5a764c53e"/><file name="mysql4-upgrade-0.0.2-0.0.3.php" hash="ce1925ff2ab03aa9fd6cbe43283ea37d"/><file name="mysql4-upgrade-0.0.3-0.0.4.php" hash="7f1e38bcf030e6346a9fd8321f1a4362"/><file name="mysql4-upgrade-0.0.4-0.0.5.php" hash="bbe6b895320effca77cc2c23431f043f"/><file name="mysql4-upgrade-0.0.5-0.0.6.php" hash="98b72d9ef4ec8078c09a1f641fc35a39"/><file name="mysql4-upgrade-0.0.6-0.0.7.php" hash="ea15755fc072e7c82b78063589360779"/><file name="mysql4-upgrade-1.0.10-1.0.11.php" hash="b2ec497921eb2bd9a97a318554fd980b"/><file name="mysql4-upgrade-1.1.21-1.1.22.php" hash="52d1950ebedd5d0afe69cf381245cef0"/><file name="mysql4-upgrade-1.1.5-1.1.6.php" hash="14750274ece5816d6c1ab490f7d610ab"/></dir></dir></dir><dir name="Mandrill"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="fb729d3c111d1626577017d5bd88b693"/></dir><file name="Userinfo.php" hash="fc19ad47dda8547fe66d4fc13821ef66"/></dir></dir><dir name="Templates"><dir name="Templates"><file name="Grid.php" hash="2bd56817ffdf97181552fb461006956c"/></dir><file name="Templates.php" hash="b11427fda30f8e0f51a35fcfbd4e2cff"/></dir><dir name="Users"><dir name="Senders"><file name="Grid.php" hash="97927a2897f543a6b0603c8f3705c2e0"/></dir><file name="Senders.php" hash="d2f5c303467c2ffc08414394c30e94b0"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="265550db051e8ee3bc81e9a8bcec0731"/></dir><dir name="Model"><dir name="Email"><file name="Template.php" hash="c670b249708a5f341df96d7b269f31a6"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Userinfo.php" hash="ab0252b2116f0f5f4fa19c30fc007561"/></dir></dir><file name="Config.php" hash="070947579c992a16e7a335c521684ffd"/></dir><file name="Customcollection.php" hash="f024ab2663565eeca20a0d071e0cffbc"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Mandrill"><file name="UsersController.php" hash="22458a083848a119e36edad0fba44972"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="8c0b7fda27820f53b3064f18a524c930"/><file name="config.xml" hash="6f0d837f1a85ef7c82f52d16ba14d2c1"/><file name="system.xml" hash="d05b90ca129297b6ffda52a4ba1fd26a"/></dir></dir><dir name="AbandonedCart"><dir name="Block"><dir name="Adminhtml"><dir name="Abandonedmails"><file name="Grid.php" hash="1d6aa7470345b86ebc544865b1d5988b"/></dir><dir name="Abandonedorder"><file name="Grid.php" hash="abdca6b6f4eb45a73eb55b5d553ef4cd"/></dir><dir name="Dashboard"><file name="Sales.php" hash="0242b35fd7d779e997c9d583d2067200"/><file name="Totals.php" hash="9590493276691d775bc16be69570371e"/></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="7421b2285cbf14f737f197647c444e13"/></dir><file name="Date.php" hash="c2c968c7e44e4512afcf1d280b596b12"/></dir></dir><file name="Abandonedmails.php" hash="1602122456b4a710638e049e87135a57"/><file name="Abandonedorder.php" hash="eb6b272bf9da062c0d922f733fd5684d"/><file name="Dashboard.php" hash="b308fe4aa4339bb980f911ddaf244bf1"/></dir><dir name="Email"><dir name="Order"><file name="Items.php" hash="898f46053e5d6dc70e8ea84306069905"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="3e1fa681e66943898a0ee4e5c7330814"/></dir><dir name="Model"><dir name="Resource"><dir name="Mailssent"><file name="Collection.php" hash="32a7f66ed04d2774708608e93673eb60"/></dir><dir name="Order"><file name="Collection.php" hash="7ba53f0d262e55e55c2212bffeff3fc7"/></dir><file name="Mailssent.php" hash="587b8c706766b178be80dc6539e4172b"/></dir><dir name="System"><dir name="Config"><file name="Automatic.php" hash="4796f50ff325b34bb7478ae19da5f455"/><file name="Cmspage.php" hash="97fb52c0878ba73934fc54bd23a00284"/><file name="Customergroup.php" hash="56192685ca9110ae95431fc63c494e25"/><file name="Discounttype.php" hash="680ae0d05305ea8ead09bd176914935d"/><file name="Maxemails.php" hash="d3e4eb78c3496a7e3f1dafb66c765407"/><file name="Unit.php" hash="a20bb2f70dbff61ad99b12e169116a68"/></dir></dir><file name="Config.php" hash="5227e21f99c5f77f0fc628e1597fabf7"/><file name="Cron.php" hash="529bd17883e7122dd738ec824a27c962"/><file name="EventObserver.php" hash="9ef907a467920256f28d564e08059f7f"/><file name="Mailssent.php" hash="c4bb348f7df03d057b6e71793a35099f"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="AbandonedmailsController.php" hash="53e508bee05b83175bf940e8e569e5c5"/><file name="AbandonedorderController.php" hash="fa050d8ecfe1d665178375c677a83c38"/></dir><file name="AbandonedController.php" hash="c5d4146adaaa34ca06cc444299c13bd1"/></dir><dir name="etc"><file name="adminhtml.xml" hash="c2a82d9e46d715f3d10a5ae40f457c89"/><file name="config.xml" hash="9e5e895f96a0374c2a7feb489e95364d"/><file name="system.xml" hash="2a44e4c642dcb454622af0219514e04c"/></dir><dir name="sql"><dir name="ebizmarts_abandonedcart_setup"><file name="mysql4-install-0.1.0.php" hash="0e1a8c0391654c480773b78a50db5a83"/><file name="mysql4-upgrade-0.1.12-0.1.13.php" hash="4835436b744f8cbff61a66c2e345976f"/><file name="mysql4-upgrade-0.1.18-0.1.19.php" hash="e51b332cb70c81ee472b586fda4e8a7e"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="2e87d09a5008ac2f2432a25e08474c87"/><file name="mysql4-upgrade-0.1.20-0.1.21.php" hash="c461ba10961b4ee4e9385173d4264617"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="60daa0d70a1af929a39d6e20ee52ee9c"/></dir></dir></dir><dir name="Autoresponder"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backtostock"><dir name="Fieldset"><file name="Hint.php" hash="2ce3d676335024c283c8cb7004f2fd70"/></dir></dir><dir name="Birthday"><dir name="Fieldset"><file name="Hint.php" hash="b90407590390af8a3b7a5f28fe30fc1d"/></dir></dir><dir name="Fieldset"><file name="Hint.php" hash="6512f3966ad7a5805b37ec347fe3f45d"/></dir><dir name="Review"><dir name="Fieldset"><file name="Hint.php" hash="3a30e310d54d553551645b4ba65d3a97"/></dir></dir><dir name="Wishlist"><dir name="Fieldset"><file name="Hint.php" hash="d958534a50e224778b4f21ab91965c93"/></dir></dir></dir></dir></dir><dir name="Backtostock"><file name="Notice.php" hash="a0ed5dc687baa5eff1c5582fe3d1d7b8"/></dir><dir name="Customer"><dir name="Account"><file name="List.php" hash="12114dfff4daa3fb66ec67886ecd65ce"/></dir></dir><dir name="Email"><dir name="Backtostock"><file name="Item.php" hash="52fdf4d6b9e46af278e845af141babaf"/></dir><dir name="Related"><file name="Items.php" hash="a307ecd59fa183dfd631f3e852d5b0b4"/></dir><dir name="Review"><file name="Items.php" hash="58310c2423a7844e4876adf0fee8d1f8"/></dir><dir name="Wishlist"><file name="Items.php" hash="ea252dac50f360125f964a493db00252"/></dir></dir><dir name="Review"><file name="Form.php" hash="36b468ca8507f5880e792cf2ca144084"/></dir><file name="Unsubscribe.php" hash="3320837d5f53290bea5911184f2f8e89"/></dir><dir name="Helper"><file name="Data.php" hash="9b4a79044374ef53028bfd53d6f6cb8c"/></dir><dir name="Model"><dir name="Resource"><dir name="Backtostock"><file name="Collection.php" hash="ed8d4e1356ee483a17c916f3caf5e004"/></dir><dir name="Backtostockalert"><file name="Collection.php" hash="0c8888bcd7f10ee01c40ffb1be379b29"/></dir><dir name="Review"><file name="Collection.php" hash="f6d6fea1af97d22c763ca066f35b60c1"/></dir><dir name="Unsubscribe"><file name="Collection.php" hash="ce69c3e9a94270d56586d98b9848c40e"/></dir><dir name="Visited"><file name="Collection.php" hash="bd6f6853caf49b5cc775853982d080a4"/></dir><file name="Backtostock.php" hash="f843a3a2c8784ebf5844dd24851152b5"/><file name="Backtostockalert.php" hash="667c31247de8122c896f7056f76d69e4"/><file name="Review.php" hash="c452559a7e879c3c1744d0fe2a8d3c44"/><file name="Unsubscribe.php" hash="52d3a3276a4ffc9dac8969a9f71ab7fe"/><file name="Visited.php" hash="2c1255d46620bd32976ec62a74ea8ee5"/></dir><dir name="System"><dir name="Config"><file name="Automatic.php" hash="a13826aaa72aa13d783e9b8032255d11"/><file name="Couponcounter.php" hash="6a5667391ba4ec58490fef07c4b0c20b"/><file name="Customergroup.php" hash="9dacae8f22f927f63fffa065698436b0"/><file name="Discounttype.php" hash="f0434d0bd53e7a18a2a7377b9e08fe5f"/><file name="Generaltype.php" hash="871b01315f4bdcef6fe4317d0ee421fd"/><file name="Time.php" hash="3bb74c6af5f1d2d0920e290f5ff4978a"/></dir></dir><file name="Backtostock.php" hash="bbe12c4e362b4a6b3ff289c4cfad1c1d"/><file name="Backtostockalert.php" hash="7c13e74e80769ce9ec5348dff3146ed7"/><file name="Config.php" hash="c3d0f8a39bd9c4704cd5ef161420e345"/><file name="Cron.php" hash="b59125e9bdffba559d45ab4ad9d6d173"/><file name="EventObserver.php" hash="507db9bceb25832481e81053aecc082e"/><file name="Review.php" hash="3972ef6776b94ccecf6e05b2aa1972db"/><file name="Unsubscribe.php" hash="60b3692fd5f2e29c711954fd0ca91141"/><file name="Visited.php" hash="36850b4973097fd7dfe4d05c45b8dbdd"/></dir><dir name="controllers"><file name="AutoresponderController.php" hash="dcc9961677efd579fa17c9c07df10b00"/><file name="BacktostockController.php" hash="0a7f9280f87c7a663f06529e3811cfc1"/></dir><dir name="etc"><file name="adminhtml.xml" hash="59a240f12b496566f1a2b1de5f053e96"/><file name="config.xml" hash="78775a88cd3a28618aea456f55a92cb8"/><file name="system.xml" hash="e46216b7e0f5b0dc36566c2a77e432e3"/></dir><dir name="sql"><dir name="ebizmarts_autoresponder_setup"><file name="mysql4-install-0.1.0.php" hash="791af0eec35753144d506294bb4c03ad"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="78438ac4a76091f713815249b89a0fb8"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="b2b4f343d16d99c1396987452fba1039"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="378accc07eb80b16029db84f56bed683"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ebizmarts_MageMonkey.xml" hash="9a4b1c469b4652442c7a5f945dd12cac"/><file name="Ebizmarts_Mandrill.xml" hash="c80aa6f98ccc3890303bb4c278f8ad95"/><file name="Ebizmarts_AbandonedCart.xml" hash="48c4cfe8246d5a995e2836c43ab38d74"/><file name="Ebizmarts_Autoresponder.xml" hash="97302f94f5893147db18c4034d135256"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="ebizmarts"><file name="abandonedcart.xml" hash="72945454a4d24ef8d1718bf177272ffe"/><file name="autoresponder.xml" hash="e8eb1cc7faf18deb6a415b56f290f5f6"/></dir><file name="magemonkey.xml" hash="f86c4a1e77468bf497bbc31f00d379c9"/></dir><dir name="template"><dir name="magemonkey"><dir name="checkout"><file name="subscribe.phtml" hash="d4929f4baa9d908c9ac6d2a0ccd1c064"/></dir><file name="lists.phtml" hash="711deb72f80bbabca14a52d3a62bc661"/></dir><dir name="ebizmarts_abandonedcart"><dir name="email"><dir name="order"><dir name="items"><dir name="order"><file name="default.phtml" hash="5ff74635419e7ffb4d3660c306ad6590"/></dir></dir><file name="items.phtml" hash="28f65bf1836a33234bff58edda857532"/></dir></dir></dir><dir name="ebizmarts"><dir name="autoresponder"><dir name="backtostock"><dir name="catalog"><dir name="product"><file name="form.phtml" hash="0bf63a70962abf54ad5d995ef38724d3"/><file name="notice.phtml" hash="50e73f8633d6c90ef0a6f630e4d23802"/></dir></dir><file name="item.phtml" hash="f21ac40fa3279b8765012de283206e71"/></dir><dir name="customer"><file name="list.phtml" hash="be9cd36a644a39e3569c9ae0ded2087d"/></dir><dir name="related"><file name="items.phtml" hash="b05bfbbe1bdf48324d2e3e2df7d7ae97"/></dir><dir name="review"><file name="items.phtml" hash="a1fdcb739b6032b607e67047fd3b65f9"/></dir><dir name="wishlist"><file name="items.phtml" hash="217b12ebbabd46d14c2a95b57aa9dad0"/></dir><file name="unsubscribe.phtml" hash="2635dae225a8a4536d58a87c4de9054d"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="ebizmarts"><file name="mandrill.xml" hash="a1fa45084bc7b71260f92dbf62f98a93"/><file name="abandonedcart.xml" hash="56b2ca552b73a976207cd33afbcfb299"/></dir><file name="magemonkey.xml" hash="613e5cd38048dedadb96434b9c3cc704"/></dir><dir name="template"><dir name="magemonkey"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="f4bbe778592be65a6b452002dfc84c24"/></dir><file name="oauth_wizard.phtml" hash="226d42be1f41838bb80da0e2c3567d71"/><file name="resetlocal360.phtml" hash="b33c2f9490e0d7ba1dd984b1b61686ca"/><file name="resetremote360.phtml" hash="1dd1ea0de2041a07de09a4344c336b87"/></dir></dir></dir><dir name="ebizmarts"><dir name="mandrill"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="d4025820e90c8e20bc8c6664984a78a1"/></dir></dir></dir></dir><dir name="abandonedcart"><dir name="dashboard"><file name="index.phtml" hash="180d73784745e0c1d5b37b0d435a2cc0"/><file name="salebar.phtml" hash="50a0c2645e2f651da9ba72fd875986cb"/><file name="totalbar.phtml" hash="ff53860a369cbf2e2c067607147afe83"/></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="ffde58e7c920e022c949601fb5533820"/></dir></dir></dir></dir><dir name="autoresponder"><dir name="system"><dir name="config"><dir name="backtostock"><dir name="fieldset"><file name="hint.phtml" hash="f02d4d7e5e45bc45b20cf8d531017c61"/></dir></dir><dir name="birthday"><dir name="fieldset"><file name="hint.phtml" hash="577162540f6f45b822d7784463c31456"/></dir></dir><dir name="fieldset"><file name="hint.phtml" hash="03ca0e64ef7648018ea459fc18ee2b4a"/></dir><dir name="review"><dir name="fieldset"><file name="hint.phtml" hash="a3e506441b757f5372337fa59de1d64f"/></dir></dir><dir name="wishlist"><dir name="fieldset"><file name="hint.phtml" hash="8f4427235da3afa30d271745f040c767"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="ebizmarts"><dir name="abandonedcart"><file name="abandoned_cart_mail_1.html" hash="7cdd7e280cf62ecc901e44486348cb42"/><file name="abandoned_cart_mail_2.html" hash="a80a49564d4bf2f1d2e218436bd5b3c2"/><file name="abandoned_cart_mail_3.html" hash="040178e0d03339613f7874982d666517"/><file name="abandoned_cart_mail_generic.html" hash="73f8caed42f738e3bffe5da4d8a882a4"/></dir><dir name="autoresponder"><file name="backtostock.html" hash="873a69e2975f86203e0459410154c11f"/><file name="birthday.html" hash="6c4b7fc9c04c63a010637430c542398c"/><file name="neworder.html" hash="0bf363484cf971b52b2b2b6ac466e743"/><file name="noactivity.html" hash="050ed39458f9a4b182f3a047c07ea6ba"/><file name="relatedproducts.html" hash="9c4993edce3474c7b063cfbb4a4cb849"/><file name="review.html" hash="c6349dcd4be0b3c73473a45849a261ac"/><file name="reviewcoupon.html" hash="8b8262acb1d67c315a582f6a70330c49"/><file name="visitedproducts.html" hash="1bfe817dcccc9b1eeba23b439b68da5e"/><file name="wishlist.html" hash="f2f55a5740d653cdddecb359f18c5325"/></dir></dir></dir></dir><file name="Ebizmarts_MageMonkey.csv" hash="181e91ed91dfea5fe7dab66af5719af8"/><file name="Ebizmarts_Mandrill.csv" hash="3dac3af57664fd34f5eda8abf4098ee0"/><file name="Ebizmarts_AbandonedCart.csv" hash="29ee25f32946e687917cf542aaa66941"/><file name="Ebizmarts_Autoresponder.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="magemonkey"><file name="magemonkey.css" hash="00f0b145e9f9cc99eb46cf97faba3f65"/><file name="magemonkey.js" hash="e40717a83ef300776cc79ad9f8191005"/><file name="mailchimp-connected-ebizmarts-title.png" hash="c6bcb1aa606ecd3b0a9753bb48ddeb58"/><file name="mailchimp-ico.png" hash="14978ec398cede4060bc9b00365bb6c5"/><file name="mailchimp-section-background.png" hash="d4536261c6a3534fbb855428c0cca62c"/><file name="mailchimp-tab.png" hash="61972b4e063364071e81d8c9e10d8feb"/></dir><dir name="abandonedcart"><file name="abandonedcart.css" hash="0d29bc510ac4af6ae38b89c62019f797"/></dir><dir name="ebizmarts"><dir name="mandrill"><file name="mandrill-tab.png" hash="d7eaf9deef355e4b8b55a96070b90ffe"/><file name="mandrill.css" hash="37a538f63b82a486c364b337420ca8ad"/></dir><file name="ebizmarts-tab.png" hash="6dfa08c5cd4329d1df6e7b71fb1f925a"/><file name="ebizmarts.css" hash="10afb44e9b6b09378da6f7adccf1a711"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="magemonkey"><file name="magemonkey.css" hash="d4eac40764271596a3edc30d1014887f"/><file name="monkey.js" hash="d7d2e3f137d97202214fe29551695739"/></dir></dir></dir></dir></target><target name="mage"><dir name="lib"><dir name="Mandrill"><dir name="Mandrill"><file name="Exceptions.php" hash="c1b76471b87d66b9118cfacf42b309a2"/><file name="Exports.php" hash="89ab0610609c675b873d7f17db7e384d"/><file name="Inbound.php" hash="194af722064b87ec08fb08196d0b112e"/><file name="Internal.php" hash="26470edbb8134ff0b03f110f2cdc3bf8"/><file name="Ips.php" hash="37c362fec92e6e1a122cfa1c9363b426"/><file name="Messages.php" hash="0c846d38f80303b0a403258b00bcbe46"/><file name="Metadata.php" hash="f513ee87966aa29738f4f9d95f852da1"/><file name="Rejects.php" hash="562aae94138d2fd6cb44cd48058ed25f"/><file name="Senders.php" hash="30c01ced259070fd170b2447dd0053a1"/><file name="Subaccounts.php" hash="43f762b6cab8b0dc54eceff42402c386"/><file name="Tags.php" hash="92760c835fa7312a1ce9c401c3116f9b"/><file name="Templates.php" hash="b212c80d72590920e169a0850c43355b"/><file name="Urls.php" hash="8438b47d6f283ebb5a9821b7997d972f"/><file name="Users.php" hash="ac0fc5f8b264b8436ad8e98aa7ce214d"/><file name="Webhooks.php" hash="51ec40806b2cf3966557389143143f58"/><file name="Whitelists.php" hash="14e150230d31880b7fa0a56802b2fa7c"/></dir><file name="Mandrill.php" hash="dfbaecea4b88464d3d3a62c269075d5d"/><file name="Message.php" hash="42361e8199df12c74a271bd296643e46"/></dir></dir><dir name="js"><dir name="ebizmarts"><dir name="autoresponders"><file name="visitedproducts.js" hash="a8baeac3511ff874b7972c9008c6543b"/></dir></dir></dir></target></contents>
|
|
|
|
|
|
|
26 |
<compatible/>
|
27 |
+
<dependencies/>
|
28 |
</package>
|
skin/adminhtml/default/default/{mandrill → ebizmarts/mandrill}/mandrill-tab.png
RENAMED
File without changes
|
skin/adminhtml/default/default/{mandrill → ebizmarts/mandrill}/mandrill.css
RENAMED
File without changes
|