Magento Newletter订阅-如果已订阅,则显示错误

Magento Newletter订阅-如果已订阅,则显示错误,magento,subscription,newsletter,Magento,Subscription,Newsletter,您好,我正在使用magento中的默认新闻稿订阅包。我需要显示一个错误,如果用户已经向我们注册了,我已经看到这样一个选项 $emailExist = Mage::getModel('newsletter/subscriber')->load($email, 'subscriber_email'); if ($emailExist->getId()) { Mage::throwException($this->__('This email addres

您好,我正在使用magento中的默认新闻稿订阅包。我需要显示一个错误,如果用户已经向我们注册了,我已经看到这样一个选项

    $emailExist = Mage::getModel('newsletter/subscriber')->load($email, 'subscriber_email');
    if ($emailExist->getId()) {
      Mage::throwException($this->__('This email address is already exist.'));
    }
从这里

但这对我不起作用,我仍然收到同样的感谢订阅信息。谢谢检查这个

$NewSellt= Mage::getModel('newsletter/subscriber')->subscribe($email);
if($NewSellt->getId()>0){
//if exits

}
如果客户是注册用户

$ownerId = Mage::getModel('customer/customer')
                        ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
                        ->loadByEmail($email)
                        ->getId();
    if ($ownerId !== null && $ownerId != $customerSession->getId()) {
                   //'This email address is already assigned to another user.
                }