Skip to content
This repository has been archived by the owner on Jun 1, 2018. It is now read-only.

Commit

Permalink
Fixed Magento's subscribe confirmation email.
Browse files Browse the repository at this point in the history
  • Loading branch information
Santiagoebizmarts committed May 11, 2015
1 parent 89d258f commit c2694da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Ebizmarts_MageMonkey.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<_>
<form_key>gveGebWj9soA7q8e</form_key>
<form_key>BjOutRh4APK9EY3O</form_key>
<name>Ebizmarts_MageMonkey</name>
<channel>community</channel>
<version_ids>
Expand Down Expand Up @@ -45,7 +45,7 @@ Removed filter to resend subscription confirmation email.</notes>
<max/>
</max>
<files>
<files> </files>
<files> </files>
</files>
</package>
<extension>
Expand Down
6 changes: 1 addition & 5 deletions app/code/community/Ebizmarts/MageMonkey/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ public function subscribeToList($object, $db, $listId = NULL, $forceSubscribe =
if (count($alreadyOnList) == 0) {
$isConfirmNeed = FALSE;
if (!Mage::helper('monkey')->isAdmin() &&
(Mage::getStoreConfig(Mage_Newsletter_Model_Subscriber::XML_PATH_CONFIRMATION_FLAG, $object->getStoreId()) == 1 && !$forceSubscribe)
(Mage::getStoreConfig(Mage_Newsletter_Model_Subscriber::XML_PATH_CONFIRMATION_FLAG, $object->getStoreId()) == 1 && !$forceSubscribe && !Mage::getStoreConfig(Ebizmarts_MageMonkey_Model_Config::GENERAL_CONFIRMATION_EMAIL, $object->getStoreId()))
) {
$isConfirmNeed = TRUE;
}
Expand Down Expand Up @@ -1006,7 +1006,6 @@ public function handlePost($request, $guestEmail)
//<state> param is an html serialized field containing the default form state
//before submission, we need to parse it as a request in order to save it to $odata and process it
// parse_str($request->getPost('state'), $odata);
Mage::log($request->getPost('state'), null, 'santiago.log', true);
$m = explode('&',$request->getPost('state'));
$odata = array();
$list = array();
Expand All @@ -1028,7 +1027,6 @@ public function handlePost($request, $guestEmail)
$odata[$g[0]] = $g[1];
}
}
Mage::log($odata, null, 'santiago.log', true);
$curlists = (TRUE === array_key_exists('list', $odata)) ? $odata['list'] : array();
$lists = $request->getPost('list', array());

Expand Down Expand Up @@ -1122,13 +1120,11 @@ public function handlePost($request, $guestEmail)
$subscriber->setListGroups($groupings);
$subscriber->setMcListId($listId);
$subscriber->setMcStoreId(Mage::app()->getStore()->getId());
$subscriber->setImportMode(TRUE);
$subscriber->subscribe($email);
} else {
$customer->setListGroups($groupings);
$customer->setMcListId($listId);
$subscriber = Mage::getModel('newsletter/subscriber')
->setImportMode(TRUE)
->setSubscriberEmail($email);
$this->subscribeToList($subscriber, 0, $listId);

Expand Down

0 comments on commit c2694da

Please sign in to comment.