Problem/Motivation
Hello, with Simplenews 4.0 the Webform Simplenews Handler 2.0.1 auto activates the subscription passing by the 'Verification of anonymous users' setting of the Simplenews module.
Steps to reproduce
Just use the Webform Simplenews Handler 2.0.1 version with Simplenews 4.0 and after subscribing an email through the Webform Simplenews Handler the subscription has status Active instead of Unconfirmed.
Proposed resolution
The Simplenews 4.0 method subscribe() of the subscriptionManager class no longer defines the $confirm as a function variable. A quick work around for me was to add the below line to SubscriptionManager.php (line 107)
$subscriber->setStatus(SubscriberInterface::UNCONFIRMED);
Issue fork webform_simplenews_handler-3444604
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3444604-verification-of-anonymous
changes, plain diff MR !8 /
changes, plain diff MR !7
Comments
Comment #3
luksakI was quite confused by this. I think the simplenews 4.x release took the wrong path here... This is a very unintuitive API. And in my opinion very prone to errors. Take a look at this:
Any logged in user can skip confirmation to subscribe any email address. And this is on an API level.
Comment #5
luksakHere is a first draft to fix this issue.
Comment #8
luksakThe MR is a hacky fix for this.
Comment #10
vuil