Skip to content

Commit b780250

Browse files
Merge pull request #882 from mailchimp/pre_release-1.1.15
Merge release 1.1.15
2 parents 1e47830 + c1ac44c commit b780250

File tree

53 files changed

+4523
-323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4523
-323
lines changed

CHANGELOG.md

+26-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
# Change Log
22

3-
## [1.1.14](https://github.com/mailchimp/mc-magento/tree/1.1.14) (2019-01-16)
3+
## [1.1.15](https://github.com/mailchimp/mc-magento/tree/1.1.15) (2019-02-18)
4+
5+
[Full Changelog](https://github.com/mailchimp/mc-magento/compare/1.1.14...1.1.15)
6+
7+
**Implemented enhancements:**
8+
9+
- Catch exception if mandrill api is not available [\#859](https://github.com/mailchimp/mc-magento/issues/859)
10+
- Add subscription option on order success page [\#770](https://github.com/mailchimp/mc-magento/issues/770)
411

12+
**Fixed bugs:**
13+
14+
- Subscribers status doesn't change to subscribed if double opt-in is activated using Magento email through Mandrill [\#874](https://github.com/mailchimp/mc-magento/issues/874)
15+
- Multiple confirmation email from Mailchimp after group subscription [\#873](https://github.com/mailchimp/mc-magento/issues/873)
16+
- Undefined variable: acl [\#871](https://github.com/mailchimp/mc-magento/issues/871)
17+
- Spelling error in order status sent to mailchimp [\#868](https://github.com/mailchimp/mc-magento/issues/868)
18+
- Subscription fails when one store view is disabled with the API key in blank [\#867](https://github.com/mailchimp/mc-magento/issues/867)
19+
- The program fails when set up the extension in one store view and disable another store view leaving the API key in blank [\#863](https://github.com/mailchimp/mc-magento/issues/863)
20+
- Avoid real time calls to Mailchimp API in case it's down [\#862](https://github.com/mailchimp/mc-magento/issues/862)
21+
- If connection ping fails for one store it cancels the entire process [\#846](https://github.com/mailchimp/mc-magento/issues/846)
22+
- 1.1.12 "Display on order grid" also hides Ebizmarts\_MailChimp\_Block\_Adminhtml\_Sales\_Order\_View\_Info\_Monkey [\#826](https://github.com/mailchimp/mc-magento/issues/826)
23+
24+
## [1.1.14](https://github.com/mailchimp/mc-magento/tree/1.1.14) (2019-01-16)
525
[Full Changelog](https://github.com/mailchimp/mc-magento/compare/1.1.13...1.1.14)
626

727
**Implemented enhancements:**
@@ -11,13 +31,17 @@
1131

1232
**Fixed bugs:**
1333

34+
- Flag parent as modified when child product is modified [\#848](https://github.com/mailchimp/mc-magento/issues/848)
35+
- Change modified abandoned carts sending method from DELETE -\> POST to PATCH [\#836](https://github.com/mailchimp/mc-magento/issues/836)
1436
- Orders belonging to deleted stores do not show correct syncing status under "synced to MailChimp" column [\#840](https://github.com/mailchimp/mc-magento/issues/840)
1537

1638
## [1.1.13](https://github.com/mailchimp/mc-magento/tree/1.1.13) (2018-12-11)
1739
[Full Changelog](https://github.com/mailchimp/mc-magento/compare/1.1.12...1.1.13)
1840

1941
**Implemented enhancements:**
2042

43+
- Add option to send unresized product images to Mailchimp [\#834](https://github.com/mailchimp/mc-magento/issues/834)
44+
- Optimize deletion of processed webhooks [\#832](https://github.com/mailchimp/mc-magento/issues/832)
2145
- Send subscription confirmation email via Magento [\#793](https://github.com/mailchimp/mc-magento/issues/793)
2246
- Order confirmation email is bypassing Aschroder\_SMTPPro [\#673](https://github.com/mailchimp/mc-magento/issues/673)
2347
- Add support for List Groups [\#514](https://github.com/mailchimp/mc-magento/issues/514)
@@ -452,4 +476,4 @@
452476
## [1.0.0](https://github.com/mailchimp/mc-magento/tree/1.0.0) (2016-06-06)
453477

454478

455-
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
479+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?php
2+
/**
3+
* mc-magento Magento Component
4+
*
5+
* @category Ebizmarts
6+
* @package mc-magento
7+
* @author Ebizmarts Team <[email protected]>
8+
* @copyright Ebizmarts (http://ebizmarts.com)
9+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10+
* @date: 6/10/16 12:38 AM
11+
* @file: Grid.php
12+
*/
13+
class Ebizmarts_MailChimp_Block_Adminhtml_Customer_Edit_Tab_Mailchimp extends Mage_Adminhtml_Block_Widget_Grid
14+
{
15+
16+
protected $_lists = array();
17+
protected $_info = array();
18+
protected $_myLists = array();
19+
protected $_generalList = array();
20+
protected $_form;
21+
protected $_api;
22+
protected $_customer;
23+
/**
24+
* @var Ebizmarts_MailChimp_Helper_Data
25+
*/
26+
protected $helper;
27+
protected $storeId;
28+
29+
public function __construct()
30+
{
31+
parent::__construct();
32+
$this->setTemplate('ebizmarts/mailchimp/customer/tab/mailchimp.phtml');
33+
$this->helper = $this->makeHelper();
34+
$customerId = (int) $this->getRequest()->getParam('id');
35+
if ($customerId) {
36+
$this->_customer = $this->getCustomerModel()->load($customerId);
37+
$this->storeId = $this->getCustomer()->getStoreId();
38+
}
39+
}
40+
41+
public function getInterest()
42+
{
43+
$customer = $this->getCustomer();
44+
$subscriber = $this->getSubscriberModel();
45+
$subscriber->loadByEmail($customer->getEmail());
46+
$subscriberId = $subscriber->getSubscriberId();
47+
$customerId = $customer->getId();
48+
$storeId = $this->getStoreId();
49+
$interest = $this->helper->getInterestGroups($customerId, $subscriberId, $storeId);
50+
51+
return $interest;
52+
}
53+
54+
/**
55+
* @return Mage_Newsletter_Model_Subscriber
56+
*/
57+
protected function getSubscriberModel()
58+
{
59+
return Mage::getModel('newsletter/subscriber');
60+
}
61+
62+
/**
63+
* @return Ebizmarts_MailChimp_Helper_Data
64+
*/
65+
protected function makeHelper()
66+
{
67+
return Mage::helper('mailchimp');
68+
}
69+
70+
/**
71+
* @return false|Mage_Core_Model_Abstract
72+
*/
73+
protected function getCustomerModel()
74+
{
75+
return Mage::getModel('customer/customer');
76+
}
77+
78+
/**
79+
* @return Mage_Core_Model_Abstract
80+
*/
81+
protected function getCustomer()
82+
{
83+
return $this->_customer;
84+
}
85+
86+
/**
87+
* If customer was created in admin panel use the store view selected for MailChimp.
88+
*
89+
* @return mixed
90+
*/
91+
protected function getStoreId()
92+
{
93+
$storeId = $this->storeId;
94+
if (!$storeId) {
95+
$storeId = $this->_customer->getMailchimpStoreView();
96+
}
97+
return $storeId;
98+
}
99+
}

app/code/community/Ebizmarts/MailChimp/Block/Checkout/Subscribe.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class Ebizmarts_MailChimp_Block_Checkout_Subscribe extends Mage_Core_Block_Templ
1717
protected $_generalList = array();
1818
protected $_form;
1919
protected $_api;
20+
/**
21+
* @var Ebizmarts_MailChimp_Helper_Data
22+
*/
2023
protected $helper;
2124
protected $storeId;
2225

@@ -116,8 +119,6 @@ public function getGeneralList()
116119
$helper = $this->helper;
117120
$listId = $helper->getGeneralList($storeId);
118121

119-
//@Todo add support for intetest groups
120-
121122
return $listId;
122123
}
123124
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?php
2+
3+
/**
4+
* Checkout subscribe interest groups block renderer
5+
*
6+
* @category Ebizmarts
7+
* @package Ebizmarts_MailChimp
8+
* @author Ebizmarts Team <[email protected]>
9+
* @license http://opensource.org/licenses/osl-3.0.php
10+
*/
11+
class Ebizmarts_MailChimp_Block_Checkout_Success_Groups extends Mage_Core_Block_Template
12+
{
13+
protected $_currentIntesrest;
14+
/**
15+
* @var Ebizmarts_MailChimp_Helper_Data
16+
*/
17+
protected $helper;
18+
protected $storeId;
19+
20+
public function __construct()
21+
{
22+
parent::__construct();
23+
$this->helper = Mage::helper('mailchimp');
24+
$this->storeId = Mage::app()->getStore()->getId();
25+
}
26+
27+
public function getFormUrl()
28+
{
29+
return $this->getSuccessInterestUrl();
30+
}
31+
32+
public function getSuccessInterestUrl()
33+
{
34+
$url = 'mailchimp/group/index';
35+
return Mage::app()->getStore()->getUrl($url);
36+
}
37+
38+
public function getInterest()
39+
{
40+
$subscriber = $this->getSubscriberModel();
41+
$order = $this->getSessionLastRealOrder();
42+
$subscriber->loadByEmail($order->getCustomerEmail());
43+
$subscriberId = $subscriber->getSubscriberId();
44+
$customerId = $order->getCustomerId();
45+
$helper = $this->getMailChimpHelper();
46+
$interest = $helper->getInterestGroups($customerId, $subscriberId, $order->getStoreId());
47+
return $interest;
48+
}
49+
50+
public function getMessageBefore()
51+
{
52+
$storeId = $this->storeId;
53+
$message = $this->getMailChimpHelper()->getCheckoutSuccessHtmlBefore($storeId);
54+
return $message;
55+
}
56+
57+
public function getMessageAfter()
58+
{
59+
$storeId = $this->storeId;
60+
$message = $this->getMailChimpHelper()->getCheckoutSuccessHtmlAfter($storeId);
61+
return $message;
62+
}
63+
64+
/**
65+
* @return false|Mage_Core_Model_Abstract
66+
*/
67+
protected function getSubscriberModel()
68+
{
69+
return Mage::getModel('newsletter/subscriber');
70+
}
71+
72+
/**
73+
* @return mixed
74+
*/
75+
protected function getSessionLastRealOrder()
76+
{
77+
return Mage::getSingleton('checkout/session')->getLastRealOrder();
78+
}
79+
80+
/**
81+
* @return Ebizmarts_MailChimp_Helper_Data|Mage_Core_Helper_Abstract
82+
*/
83+
protected function getMailChimpHelper()
84+
{
85+
return $this->helper;
86+
}
87+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
3+
/**
4+
* Customer account subscribe interest groups block renderer
5+
*
6+
* @category Ebizmarts
7+
* @package Ebizmarts_MageMonkey
8+
* @author Ebizmarts Team <[email protected]>
9+
* @license http://opensource.org/licenses/osl-3.0.php
10+
*/
11+
class Ebizmarts_MailChimp_Block_Customer_Newsletter_Index extends Mage_Customer_Block_Newsletter
12+
{
13+
14+
protected $_lists = array();
15+
protected $_info = array();
16+
protected $_myLists = array();
17+
protected $_generalList = array();
18+
protected $_form;
19+
protected $_api;
20+
protected $_template = "ebizmarts/mailchimp/customer/newsletter/index.phtml";
21+
/**
22+
* @var Ebizmarts_MailChimp_Helper_Data
23+
*/
24+
protected $helper;
25+
protected $storeId;
26+
27+
public function __construct()
28+
{
29+
$this->setTemplate('ebizmarts/mailchimp/customer/newsletter/index.phtml');
30+
$this->helper = Mage::helper('mailchimp');
31+
$this->storeId = Mage::app()->getStore()->getId();
32+
}
33+
34+
public function getInterest()
35+
{
36+
$subscriber = $this->getSubscriberModel();
37+
$subscriber->loadByEmail($this->_getEmail());
38+
$helper = $this->getMailChimpHelper();
39+
$customerSession = $this->getCustomerSession();
40+
if (!$helper->isAdmin() && $customerSession->isLoggedIn()) {
41+
$customer = $customerSession->getCustomer();
42+
$customerId = $customer->getId();
43+
$storeId = ($subscriber->getStoreId()) ? $subscriber->getStoreId() : $customer->getStoreId();
44+
} else {
45+
$customerId = null;
46+
$storeId = $subscriber->getStoreId();
47+
}
48+
$interest = $helper->getInterestGroups($customerId, $subscriber->getSubscriberId(), $storeId);
49+
return $interest;
50+
}
51+
52+
/**
53+
* Retrieve email from Customer object in session
54+
*
55+
* @return string Email address
56+
*/
57+
protected function _getEmail()
58+
{
59+
return $this->helper('customer')->getCustomer()->getEmail();
60+
}
61+
62+
/**
63+
* @return Ebizmarts_MailChimp_Helper_Data
64+
*/
65+
protected function getMailChimpHelper()
66+
{
67+
return $this->helper;
68+
}
69+
70+
/**
71+
* @return Mage_Customer_Model_Session
72+
*/
73+
protected function getCustomerSession()
74+
{
75+
return Mage::getSingleton('customer/session');
76+
}
77+
78+
/**
79+
* @return Mage_Newsletter_Model_Subscriber
80+
*/
81+
protected function getSubscriberModel()
82+
{
83+
return Mage::getModel('newsletter/subscriber');
84+
}
85+
86+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
/**
4+
* Interest group type template selector block
5+
*
6+
* @category Ebizmarts
7+
* @package Ebizmarts_MageMonkey
8+
* @author Ebizmarts Team <[email protected]>
9+
* @license http://opensource.org/licenses/osl-3.0.php
10+
*/
11+
class Ebizmarts_MailChimp_Block_Group_Type extends Mage_Core_Block_Template
12+
{
13+
protected $_currentInterest;
14+
15+
public function __construct(array $args = array())
16+
{
17+
if (isset($args['interests'])) {
18+
$this->_currentInterest = $interests = $args['interests'];
19+
$type = $interests['interest']['type'];
20+
$this->setTemplate("ebizmarts/mailchimp/group/type/$type.phtml");
21+
}
22+
parent::__construct($args);
23+
}
24+
25+
/**
26+
* @return mixed
27+
*/
28+
protected function getCurrentInterest()
29+
{
30+
return $this->_currentInterest;
31+
}
32+
}

0 commit comments

Comments
 (0)