Skip to content

Commit

Permalink
Merge pull request #702 from mailchimp/issue700
Browse files Browse the repository at this point in the history
closes #700 Problem when updating customer email that is not subscribed
  • Loading branch information
ebizmarts-keller authored May 11, 2018
2 parents da25ae9 + 3942349 commit 4329dcb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/code/community/Ebizmarts/MailChimp/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,13 @@ public function customerSaveBefore(Varien_Event_Observer $observer)
if ($subscriber->getId()) {
// unsubscribe old email address
$apiSubscriber->deleteSubscriber($subscriber);
}

// subscribe new email address
$subscriber = $subscriberModel->loadByCustomer($customer);
$subscriber->setSubscriberEmail($customerEmail); // make sure we set the new email address
// subscribe new email address
$subscriber = $subscriberModel->loadByCustomer($customer);
$subscriber->setSubscriberEmail($customerEmail); // make sure we set the new email address

$apiSubscriber->updateSubscriber($subscriber, true);
$apiSubscriber->updateSubscriber($subscriber, true);
}
}
}
//update subscriber data if a subscriber with the same email address exists
Expand Down

0 comments on commit 4329dcb

Please sign in to comment.