1

There is a code for checked newsletter subscription in Magento 2 registration page like below.

enter image description here

Even if I click on the checkbox and register the newsletter subscription is not working as shown below.

enter image description here

2
  • Did you get any error in var/log folder? Sep 18, 2019 at 13:25
  • Please check with Magento's default template. If it is working with the default theme, the problem is in your custom theme. Sep 18, 2019 at 13:31

1 Answer 1

2

In Magento customer account create post page the code looks like below:

    if ($this->getRequest()->getParam('is_subscribed', false)) {
        $this->subscriberFactory->create()->subscribeCustomerById($customer->getId());
    }

If you see the data is posted correctly then you should look for the custom extensions which might be modifying the behavior of the method.

NOTE: This will not instantly subscribe the customer, he has to verify his mail first, depending on how you set it up in the settings at Store -> Configuration -> Customer -> Newsletter: Abonnement options -> Has to confirm.

So if the above method does not instantly subscribe, then check your mails and settings.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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