I have to hide the newsletter subscription form from customers who already subscribed.

For registered and loggedin customer i'm able to check the subscription status using the following method:

$customerSession = Mage::getSingleton("customer/session");
$email = $customerSession->getCustomer()->getEmail();
$subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
    $status = $subscriber->isSubscribed(); // status = 1 if subscribed.

But I want to hide it for guest customers also (obviously for that particular session alone).

How could I do that? Can anyone help?

2 Answers 2


Your config.xml:

    /*another config nodes*/

Your Observer.php:

public function newsletterSubscriberSaveAfter($observer)
    $subscription = $observer->getEvent()->getSubscriber();
    if ($subscription->subscriber_email) {

Template /app/design/frontend/base/default/template/newsletter/subscribe.phtml:

<?php if (!Mage::getSingleton('customer/session')->getSubscribed()): ?>
<!--here is original html -->
<?php endif; ?>

Override the subscriber controller Mage_Newsletter_SubscriberController and on the newAction() method, when the customer is subscribed just add a flag to the session.
Then, in the newsletter block template, just check if that session flag is set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.