You should define a preference (via di.xml) for the OOTB Controller that handles the Subscription sign-up process (Magento/Newsletter/Controller/Subscriber/NewAction.php) and in your custom controller’s execute method – add the desired logic to check whether/not the customer has already subscribed and handle it accordingly.
2
Answers
You should define a preference (via di.xml) for the OOTB Controller that handles the Subscription sign-up process (Magento/Newsletter/Controller/Subscriber/NewAction.php) and in your custom controller’s execute method – add the desired logic to check whether/not the customer has already subscribed and handle it accordingly.
You need to modify this simple checking.
Try this –
Go to this path if you haven’t override
NewAction.php
file yetvendormagentomodule-newsletterControllerSubscriber
and openNewAction.php
file.Replace this code:
With:
That’s all.