Skip to content

Commit

Permalink
Merge pull request #1139 from mailchimp/pre-release/1.1.19
Browse files Browse the repository at this point in the history
Pre release/1.1.19
  • Loading branch information
Santiagoebizmarts authored Mar 3, 2020
2 parents 22816e6 + 1926584 commit 215ea17
Show file tree
Hide file tree
Showing 123 changed files with 5,670 additions and 4,608 deletions.
71 changes: 36 additions & 35 deletions CHANGELOG.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Integration to sync all the Magento data (Newsletter subscriber, Customers, Orde
The integration includes a Mandrill SMTP module that overrides the one integrated from Magento, you will need to enable Mandrill with its API key from your Mandrill account (mandrillapp.com) for the transactional emails to work.
If you want to use the Mailchimp integration without Mandrill for SMTP, contact our support so we can tell you how to set that up.

## Features
## Main Features

* Two way sync between a MailChimp list and Magento’s newsletter
* Responsive Email Catcher Popup when accessing the site
Expand All @@ -22,15 +22,15 @@ Magento Community Edition (1.7 or above) or Magento Enterprise (1.11 or above)

<a href="http://www.mailchimp.com/signup?pid=ebizmarts&source=website" target="_blank">MailChimp Account</a>

## Installation
## Step Installation

To get a copy of the project up and running on your local machine for development and testing purposes, just clone this repository on your Magento’s root directory and flush the Magento’s cache.

Alternatively, use modman to install this module.

``modman clone https://github.com/mailchimp/mc-magento.git -b 'master'``

## Module Configuriation
## Module Configuration

To enable MailChimp For Magento:

Expand All @@ -42,7 +42,7 @@ To enable MailChimp For Magento:

More guides and tutorials about the Mailchimp integration with Magento can be found on the [tutorial page of Mailchimp](https://mailchimp.com/help/connect-or-disconnect-mailchimp-for-magento/).

## Report issues
## Report Issues

For reporting issues, follow this [guidelines](https://github.com/mailchimp/mc-magento/wiki/Issue-reporting-guidelines) or your issue will be rejected.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* mc-magento Magento Component
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* mc-magento Magento Component
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function __construct()
);

$scopeArray = $this->getScopeArrayIfValueExists();

if ($scopeArray !== false) {
$jsCondition = 'true';
} else {
Expand Down Expand Up @@ -107,8 +108,9 @@ protected function getScopeArrayIfValueExists()
$helper = $this->makeHelper();
$currentMCStoreId = Mage::registry('current_mailchimpstore')->getStoreid();
$keyIfExist = $helper->getScopeByMailChimpStoreId($currentMCStoreId);

if ($keyIfExist === null) {
$keyIfExist = 'false';
$keyIfExist = false;
}

return $keyIfExist;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function _prepareForm()
$prefix = '';
$storeId = $s->getStoreId();

if(!$helper->ping($storeId)) {
if (!$helper->ping($storeId)) {
$prefix = '[Invalid]: ';
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* mc-magento Magento Component
*
Expand All @@ -17,10 +18,10 @@ public function getMessageNotification()
{
$helper = $this->makeHelper();
if ($helper->isImageCacheFlushed() && $helper->isEcomSyncDataEnabledInAnyScope()) {
$message = '<strong style=color:red>Important: </strong>'.
$message = '<strong style=color:red>Important: </strong>' .
'<span>Image cache has been flushed please '
. '<a href="#" onclick="openResendEcommerceDialog();">'
. 'resend the products</a> in order to update image URL</span>';
. 'resend the products</a> in order to update image URL</span>';
return $message;
}
}
Expand All @@ -32,8 +33,8 @@ public function getMessage()
{
$helper = $this->makeHelper();
$message = 'Are you sure you want to delete the local data in order to send all items again?\n'
.'Automations will work normally but the synchronization process for the old data will take '
. 'longer than resetting the MailChimp store.';
. 'Automations will work normally but the synchronization process for the old data will take '
. 'longer than resetting the MailChimp store.';
return $helper->__($message);
}

Expand All @@ -59,7 +60,6 @@ public function getUrlForResendEcommerce()
}



/**
* @return Ebizmarts_MailChimp_Helper_Data
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* mc-magento Magento Component
*
Expand Down Expand Up @@ -28,6 +29,7 @@ public function getButtonHtml()
{
$helper = $this->makeHelper();
$scopeArray = $helper->getCurrentScope();

if ($helper->isSubscriptionEnabled($scopeArray['scope_id'], $scopeArray['scope'])
|| $scopeArray['scope_id'] == 0
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* MailChimp For Magento
*
Expand All @@ -15,28 +16,32 @@ class Ebizmarts_MailChimp_Block_Popup_Emailcatcher extends Mage_Core_Block_Templ
protected function _canCancel()
{
$storeId = Mage::app()->getStore()->getId();

return Mage::getStoreConfig(Ebizmarts_MailChimp_Model_Config::ENABLE_POPUP, $storeId)
&& Mage::getStoreConfig(
Ebizmarts_MailChimp_Model_Config::POPUP_CAN_CANCEL,
$storeId
);
&& Mage::getStoreConfig(
Ebizmarts_MailChimp_Model_Config::POPUP_CAN_CANCEL,
$storeId
);
}

protected function _popupHeading()
{
$storeId = Mage::app()->getStore()->getId();

return Mage::getStoreConfig(Ebizmarts_MailChimp_Model_Config::POPUP_HEADING, $storeId);
}

protected function _popupMessage()
{
$storeId = Mage::app()->getStore()->getId();

return Mage::getStoreConfig(Ebizmarts_MailChimp_Model_Config::POPUP_TEXT, $storeId);
}

protected function _modalSubscribe()
{
$storeId = Mage::app()->getStore()->getId();

return Mage::getStoreConfig(Ebizmarts_MailChimp_Model_Config::POPUP_SUBSCRIPTION, $storeId);
}

Expand All @@ -53,6 +58,7 @@ protected function _handleCookie()
$cookieValues = explode('/', $emailCookie);
$email = $cookieValues[0];
$email = str_replace(' ', '+', $email);

if (isset($cookieValues[1])) {
$fName = $cookieValues[1];
}
Expand All @@ -63,6 +69,7 @@ protected function _handleCookie()

if ($subscribeCookie == 'true') {
$subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);

if (!$subscriber->getId()) {
$subscriber = Mage::getModel('newsletter/subscriber')
->setStoreId($storeId);
Expand All @@ -78,6 +85,7 @@ protected function _handleCookie()
}

$subscriber->subscribe($email);

return 'location.reload';
}
}
Expand Down
57 changes: 57 additions & 0 deletions app/code/community/Ebizmarts/MailChimp/Helper/Curl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

/**
*
* MailChimp For Magento
*
* Class Ebizmarts_MailChimp_Helper_Curl
* @category Ebizmarts_MailChimp
* @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: 9/5/19 3:55 PM
* @file: Curl.php
*/

class Ebizmarts_MailChimp_Helper_Curl extends Mage_Core_Helper_Abstract
{
/**
* @param array $options
* @return array An array with...
*/
public function curlExec($url, $httpMethod, $curlOptions = array(), $params = array())
{
if ($url === false) {
return array('error' => "It's required an URL to be requested with any http method.");
}

if ($httpMethod === false) {
return array('error' => "It's required to specify the HTTP method.");
}

$curlError = null;
$curl = new Mage_HTTP_Client_Curl();

foreach ($curlOptions as $key => $value) {
if (isset($value)) {
$curl->setOption($key, $value);
}
}

$curlResult = null;

try {
if ($httpMethod == Zend_Http_Client::GET) {
$curl->get($url);
} elseif ($httpMethod == Zend_Http_Client::POST) {
$curl->post($url, $params);
}

$curlResult = $curl->getBody();
} catch (Exception $e) {
$curlError = $e->getMessage();
}

return array('response' => $curlResult, 'error' => $curlError);
}
}
Loading

0 comments on commit 215ea17

Please sign in to comment.