0

I'm trying to read newsletter subscriber in Magento 1.9 from app\code\community\Salesmanago\Sso\Model\Observer.php with below code:

$subscriberRaw = Mage::getModel('Mage_Newsletter_Model_Subscriber')
                        ->getCollection()
                        ->addFilter('email',$subscriber['email']);

It gives me error:

There has been an error processing your request
Exception printing is disabled by default for security reasons.

Error log record number: 1500596311195

How to enable printing the errors? What's the proper way to get value from model with where clause. Where can I find good guide for learning Magento? Thank you! :)

1
  • rename the file local.sample.xml to local.xml under error and then you will see the exact error and also update your question with full error
    – Pramod
    Jun 24, 2020 at 9:39

1 Answer 1

1

To enable errors display on magento , open index.php :

//Comment if condition here
  //if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
    Mage::setIsDeveloperMode(true);
 //}

 //set display_errors to 1
 ini_set('display_errors', 1);

The proper way to get a newsletter subscriber by email :

 Mage::getModel('newsletter/subscriber')->loadByEmail($subscriber['email'])

A good guide to learn Magento here (I don't know a lot of guides ) :

https://alanstorm.com/category/magento/

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.