0

I am looking to show a custom message to customers who subscribed to newsletter on the checkout confirmation page on our magento site but I am not able to check the subscription status using the following method in success.phtml:

<?php 
$customerSession = Mage::getSingleton("customer/session");
$email = $customerSession->getCustomer()->getEmail();
$subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);

$status = $subscriber->isSubscribed();  // status should be  1 if subscribed.

Can anyone help?

1

Use this code this may help

  $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
  $status = $subscriber->getSubscriberStatus();//This will be 1 if user subscribed
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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