2

I want to change newsletter subscribe message for users who are already subscribed with that email. By default it show the same message as user gets first time for subscription success.

Thank you for your subscription.

Kindy guid me from where i can customize it. I am using magento(2.1.8) version.

0

In Newer version of Magento2, it has been resolved. but in your Magento version You need to overwrite controller "vendor/magento/module-newsletter/Controller/Subscriber/NewAction.php"

and put below code just after line 122 $this->validateEmailAvailable($email);

$subscriber = $this->_subscriberFactory->create()->loadByEmail($email);
 if ($subscriber->getId()
       && $subscriber->getSubscriberStatus() == \Magento\Newsletter\Model\Subscriber::STATUS_SUBSCRIBED
 ) {
      throw new \Magento\Framework\Exception\LocalizedException(
                        __('This email address is already subscribed.')
                    );
  }

to know about how to overwrite controller in Magento2, you can take reference of this link.

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.