1

I am using magento default newsletter subscriber. I found that the error There was a problem with the subscription: This email address is already assigned to another user. will be shown only if the subscriber has an account in magento store. If the subscriber is a guest customer then the error will not be shown, A success msg will be shown stating Newsletter Has been subscribed. How can I show message in guest subscriber also.

Ankita Agrawal
  • 504
  • 8
  • 28
  • I think the email you used already have an account in your magento store.You need to login first with that account to susbcribe. – Rohit S Jun 25 '13 at 04:57
  • In magento guest user can also subscribe to newsletter. Can we not check for guest user also. – Ankita Agrawal Jun 25 '13 at 05:27
  • Sorry i misread your question.The error will be shown only if the subscriber has an account in magento store and he is not logged in.If the subscriber is a guest customer then the error will not be shown,A success msg will be shown stating Newsletter Has been subscribed.This is magento's default behavior – Rohit S Jun 25 '13 at 05:58
  • That I know this is magento default behavior, but can I change this so that in guest subscription also it will show error message – Ankita Agrawal Jun 25 '13 at 07:08
  • You need to make it clear while asking the question.Else you will end up getting no response. and regarding your question yes its possible.Please make your question clear about what you want to acheive so that someone might be able to help you. – Rohit S Jun 25 '13 at 07:22

1 Answers1

1

You should edit the following file :

/app/code/core/Mage/Newsletter/controllers/SubscriberController.php

in line #63 above this line of code :

$status = Mage::getModel('newsletter/subscriber')->subscribe($email);

add the following codes :

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