Skip to content

Commit

Permalink
Merge pull request #882 from mailchimp/pre_release-1.1.15
Browse files Browse the repository at this point in the history
Merge release 1.1.15
  • Loading branch information
Santiagoebizmarts authored Feb 18, 2019
2 parents 1e47830 + c1ac44c commit b780250
Show file tree
Hide file tree
Showing 53 changed files with 4,523 additions and 323 deletions.
28 changes: 26 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
# Change Log

## [1.1.14](https://github.com/mailchimp/mc-magento/tree/1.1.14) (2019-01-16)
## [1.1.15](https://github.com/mailchimp/mc-magento/tree/1.1.15) (2019-02-18)

[Full Changelog](https://github.com/mailchimp/mc-magento/compare/1.1.14...1.1.15)

**Implemented enhancements:**

- Catch exception if mandrill api is not available [\#859](https://github.com/mailchimp/mc-magento/issues/859)
- Add subscription option on order success page [\#770](https://github.com/mailchimp/mc-magento/issues/770)

**Fixed bugs:**

- 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)
- Multiple confirmation email from Mailchimp after group subscription [\#873](https://github.com/mailchimp/mc-magento/issues/873)
- Undefined variable: acl [\#871](https://github.com/mailchimp/mc-magento/issues/871)
- Spelling error in order status sent to mailchimp [\#868](https://github.com/mailchimp/mc-magento/issues/868)
- Subscription fails when one store view is disabled with the API key in blank [\#867](https://github.com/mailchimp/mc-magento/issues/867)
- 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)
- Avoid real time calls to Mailchimp API in case it's down [\#862](https://github.com/mailchimp/mc-magento/issues/862)
- If connection ping fails for one store it cancels the entire process [\#846](https://github.com/mailchimp/mc-magento/issues/846)
- 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)

## [1.1.14](https://github.com/mailchimp/mc-magento/tree/1.1.14) (2019-01-16)
[Full Changelog](https://github.com/mailchimp/mc-magento/compare/1.1.13...1.1.14)

**Implemented enhancements:**
Expand All @@ -11,13 +31,17 @@

**Fixed bugs:**

- Flag parent as modified when child product is modified [\#848](https://github.com/mailchimp/mc-magento/issues/848)
- Change modified abandoned carts sending method from DELETE -\> POST to PATCH [\#836](https://github.com/mailchimp/mc-magento/issues/836)
- 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)

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

**Implemented enhancements:**

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


\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?php
/**
* mc-magento Magento Component
*
* @category Ebizmarts
* @package mc-magento
* @author Ebizmarts Team <[email protected]>
* @copyright Ebizmarts (http://ebizmarts.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @date: 6/10/16 12:38 AM
* @file: Grid.php
*/
class Ebizmarts_MailChimp_Block_Adminhtml_Customer_Edit_Tab_Mailchimp extends Mage_Adminhtml_Block_Widget_Grid
{

protected $_lists = array();
protected $_info = array();
protected $_myLists = array();
protected $_generalList = array();
protected $_form;
protected $_api;
protected $_customer;
/**
* @var Ebizmarts_MailChimp_Helper_Data
*/
protected $helper;
protected $storeId;

public function __construct()
{
parent::__construct();
$this->setTemplate('ebizmarts/mailchimp/customer/tab/mailchimp.phtml');
$this->helper = $this->makeHelper();
$customerId = (int) $this->getRequest()->getParam('id');
if ($customerId) {
$this->_customer = $this->getCustomerModel()->load($customerId);
$this->storeId = $this->getCustomer()->getStoreId();
}
}

public function getInterest()
{
$customer = $this->getCustomer();
$subscriber = $this->getSubscriberModel();
$subscriber->loadByEmail($customer->getEmail());
$subscriberId = $subscriber->getSubscriberId();
$customerId = $customer->getId();
$storeId = $this->getStoreId();
$interest = $this->helper->getInterestGroups($customerId, $subscriberId, $storeId);

return $interest;
}

/**
* @return Mage_Newsletter_Model_Subscriber
*/
protected function getSubscriberModel()
{
return Mage::getModel('newsletter/subscriber');
}

/**
* @return Ebizmarts_MailChimp_Helper_Data
*/
protected function makeHelper()
{
return Mage::helper('mailchimp');
}

/**
* @return false|Mage_Core_Model_Abstract
*/
protected function getCustomerModel()
{
return Mage::getModel('customer/customer');
}

/**
* @return Mage_Core_Model_Abstract
*/
protected function getCustomer()
{
return $this->_customer;
}

/**
* If customer was created in admin panel use the store view selected for MailChimp.
*
* @return mixed
*/
protected function getStoreId()
{
$storeId = $this->storeId;
if (!$storeId) {
$storeId = $this->_customer->getMailchimpStoreView();
}
return $storeId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class Ebizmarts_MailChimp_Block_Checkout_Subscribe extends Mage_Core_Block_Templ
protected $_generalList = array();
protected $_form;
protected $_api;
/**
* @var Ebizmarts_MailChimp_Helper_Data
*/
protected $helper;
protected $storeId;

Expand Down Expand Up @@ -116,8 +119,6 @@ public function getGeneralList()
$helper = $this->helper;
$listId = $helper->getGeneralList($storeId);

//@Todo add support for intetest groups

return $listId;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?php

/**
* Checkout subscribe interest groups block renderer
*
* @category Ebizmarts
* @package Ebizmarts_MailChimp
* @author Ebizmarts Team <[email protected]>
* @license http://opensource.org/licenses/osl-3.0.php
*/
class Ebizmarts_MailChimp_Block_Checkout_Success_Groups extends Mage_Core_Block_Template
{
protected $_currentIntesrest;
/**
* @var Ebizmarts_MailChimp_Helper_Data
*/
protected $helper;
protected $storeId;

public function __construct()
{
parent::__construct();
$this->helper = Mage::helper('mailchimp');
$this->storeId = Mage::app()->getStore()->getId();
}

public function getFormUrl()
{
return $this->getSuccessInterestUrl();
}

public function getSuccessInterestUrl()
{
$url = 'mailchimp/group/index';
return Mage::app()->getStore()->getUrl($url);
}

public function getInterest()
{
$subscriber = $this->getSubscriberModel();
$order = $this->getSessionLastRealOrder();
$subscriber->loadByEmail($order->getCustomerEmail());
$subscriberId = $subscriber->getSubscriberId();
$customerId = $order->getCustomerId();
$helper = $this->getMailChimpHelper();
$interest = $helper->getInterestGroups($customerId, $subscriberId, $order->getStoreId());
return $interest;
}

public function getMessageBefore()
{
$storeId = $this->storeId;
$message = $this->getMailChimpHelper()->getCheckoutSuccessHtmlBefore($storeId);
return $message;
}

public function getMessageAfter()
{
$storeId = $this->storeId;
$message = $this->getMailChimpHelper()->getCheckoutSuccessHtmlAfter($storeId);
return $message;
}

/**
* @return false|Mage_Core_Model_Abstract
*/
protected function getSubscriberModel()
{
return Mage::getModel('newsletter/subscriber');
}

/**
* @return mixed
*/
protected function getSessionLastRealOrder()
{
return Mage::getSingleton('checkout/session')->getLastRealOrder();
}

/**
* @return Ebizmarts_MailChimp_Helper_Data|Mage_Core_Helper_Abstract
*/
protected function getMailChimpHelper()
{
return $this->helper;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

/**
* Customer account subscribe interest groups block renderer
*
* @category Ebizmarts
* @package Ebizmarts_MageMonkey
* @author Ebizmarts Team <[email protected]>
* @license http://opensource.org/licenses/osl-3.0.php
*/
class Ebizmarts_MailChimp_Block_Customer_Newsletter_Index extends Mage_Customer_Block_Newsletter
{

protected $_lists = array();
protected $_info = array();
protected $_myLists = array();
protected $_generalList = array();
protected $_form;
protected $_api;
protected $_template = "ebizmarts/mailchimp/customer/newsletter/index.phtml";
/**
* @var Ebizmarts_MailChimp_Helper_Data
*/
protected $helper;
protected $storeId;

public function __construct()
{
$this->setTemplate('ebizmarts/mailchimp/customer/newsletter/index.phtml');
$this->helper = Mage::helper('mailchimp');
$this->storeId = Mage::app()->getStore()->getId();
}

public function getInterest()
{
$subscriber = $this->getSubscriberModel();
$subscriber->loadByEmail($this->_getEmail());
$helper = $this->getMailChimpHelper();
$customerSession = $this->getCustomerSession();
if (!$helper->isAdmin() && $customerSession->isLoggedIn()) {
$customer = $customerSession->getCustomer();
$customerId = $customer->getId();
$storeId = ($subscriber->getStoreId()) ? $subscriber->getStoreId() : $customer->getStoreId();
} else {
$customerId = null;
$storeId = $subscriber->getStoreId();
}
$interest = $helper->getInterestGroups($customerId, $subscriber->getSubscriberId(), $storeId);
return $interest;
}

/**
* Retrieve email from Customer object in session
*
* @return string Email address
*/
protected function _getEmail()
{
return $this->helper('customer')->getCustomer()->getEmail();
}

/**
* @return Ebizmarts_MailChimp_Helper_Data
*/
protected function getMailChimpHelper()
{
return $this->helper;
}

/**
* @return Mage_Customer_Model_Session
*/
protected function getCustomerSession()
{
return Mage::getSingleton('customer/session');
}

/**
* @return Mage_Newsletter_Model_Subscriber
*/
protected function getSubscriberModel()
{
return Mage::getModel('newsletter/subscriber');
}

}
32 changes: 32 additions & 0 deletions app/code/community/Ebizmarts/MailChimp/Block/Group/Type.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

/**
* Interest group type template selector block
*
* @category Ebizmarts
* @package Ebizmarts_MageMonkey
* @author Ebizmarts Team <[email protected]>
* @license http://opensource.org/licenses/osl-3.0.php
*/
class Ebizmarts_MailChimp_Block_Group_Type extends Mage_Core_Block_Template
{
protected $_currentInterest;

public function __construct(array $args = array())
{
if (isset($args['interests'])) {
$this->_currentInterest = $interests = $args['interests'];
$type = $interests['interest']['type'];
$this->setTemplate("ebizmarts/mailchimp/group/type/$type.phtml");
}
parent::__construct($args);
}

/**
* @return mixed
*/
protected function getCurrentInterest()
{
return $this->_currentInterest;
}
}
Loading

0 comments on commit b780250

Please sign in to comment.