Problem/Motivation

Users who subscribe during registration receive two emails, sent in this order:

  1. Register email address confirmation. This allows the user to login, but doesn't confirm the subscriptions.
  2. Subscription confirmation (even for silent subscription which would be particularly baffling!). This confirms the subscriptions but doesn't allow the user to login.

Introduced to fix a security bug in #3049356: Anon user can alter any anonymous subscription.

Steps to reproduce

  1. Configure a newsletter with the setting "Subscribe new account" anything except none.
  2. A new user registers, and selects to subscribe to the newsletter.

Proposed resolution

Depends on #3332695: Model for confirmations is flawed

  1. In simplenews_user_profile_form_submit(), if there are subscriptions then call Subscriber::loadByMail($checkTrust = TRUE) and save the subscriptions in the resulting subscriber.
  2. In simplenews_user_login(), simplenews_user_view(), SubscriptionsAccountForm::buildForm() pass call Subscriber::loadByUid($unconfirmed = TRUE). For the latter two, if the subscriber is unconfirmed then output form text indicating that.
  3. Fill in the missing code in simplenews_user_login() by setting the subscriber to confirmed and saving.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#57 simplenews.subscription-reg.3238247-interdiff-55-57.txt3.36 KBadamps
#57 simplenews.subscription-reg.3238247-57.patch19.54 KBadamps
#55 simplenews.subscription-reg.3238247-interdiff-53-55.txt1.12 KBadamps
#55 simplenews.subscription-reg.3238247-55.patch18.63 KBadamps
#53 simplenews.subscription-reg.3238247-interdiff-51-53.txt2.18 KBadamps
#53 simplenews.subscription-reg.3238247-53.patch18.22 KBadamps
#51 simplenews.subscription-reg.3238247-51.patch16.33 KBadamps
#48 simplenews.registration.3238247-interdiff-45-47.txt3.95 KBadamps
#48 simplenews.registration.3238247-47.patch81.35 KBadamps
#46 simplenews.registration.3238247-interdiff-43-45.txt2 KBadamps
#46 simplenews.registration.3238247-45.patch77.97 KBadamps
#43 simplenews.registration.3238247-interdiff-41-43.txt6.83 KBadamps
#43 simplenews.registration.3238247-43.patch76.74 KBadamps
#41 simplenews.registration.3238247-interdiff-39-41.txt1.83 KBadamps
#41 simplenews.registration.3238247-41.patch76.09 KBadamps
#39 simplenews.registration.3238247-interdiff-37-39.txt4.36 KBadamps
#39 simplenews.registration.3238247-39.patch75.04 KBadamps
#37 simplenews.registration.3238247-interdiff-35-37.txt9.81 KBadamps
#37 simplenews.registration.3238247-37.patch74.49 KBadamps
#34 simplenews.registration.3238247-interdiff-33-35.txt1.14 KBadamps
#34 simplenews.registration.3238247-35.patch76.46 KBadamps
#33 simplenews.registration.3238247-interdiff-31-33.txt30.12 KBadamps
#33 simplenews.registration.3238247-33.patch75.19 KBadamps
#31 simplenews.registration.3238247-interdiff-29-31.txt3.88 KBadamps
#31 simplenews.registration.3238247-31.patch61.54 KBadamps
#29 simplenews.registration.3238247-interdiff-27-29.txt837 bytesadamps
#29 simplenews.registration.3238247-29.patch60.25 KBadamps
#27 simplenews.registration.3238247-interdiff-25-27.txt3.97 KBadamps
#27 simplenews.registration.3238247-27.patch60.38 KBadamps
#25 simplenews.registration.3238247-interdiff-23-25.txt2.93 KBadamps
#25 simplenews.registration.3238247-25.patch59.38 KBadamps
#23 simplenews.registration.3238247-interdiff-21-23.txt1.28 KBadamps
#23 simplenews.registration.3238247-23.patch58.52 KBadamps
#21 simplenews.registration.3238247-interdiff-19-21.txt12.99 KBadamps
#21 simplenews.registration.3238247-21.patch58.4 KBadamps
#19 simplenews.registration.3238247-interdiff-17-19.txt10.02 KBadamps
#19 simplenews.registration.3238247-19.patch46.76 KBadamps
#17 simplenews.registration.3238247-17.patch55.07 KBadamps

Issue fork simplenews-3238247

Command icon 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:

Comments

AdamPS created an issue. See original summary.

adamps’s picture

Issue summary: View changes
anruether’s picture

I'm bumping this up to major, because for cases with a "silent" newsletter this potentially blocks new users from being subscribed.

Background: We have a an "all users newsletter" where we send important technical information to all users about their account - which is a legitimate interest in the sense of the gdpr so no consent necessary.

  • User registers but does not subscribe to one of the non-silent newsletters
  • User gets email to confirm to subscription
  • User is likely to not confirm subscription because no subscription was made by the user

There is also no workaround because admins can't manually confirm users.

Since #3035367: Track history of subscribe/unsubscribe and proof of consent doesn't have much traction for quite a while now, what would be the approach to solve this with the current state of the module?

anruether’s picture

Priority: Normal » Major
adamps’s picture

what would be the approach to solve this with the current state of the module?

It would be something like this, but I'm not sure if it's actually possible.

  1. In simplenews_user_profile_form_submit() there are calls to $subscription_manager->subscribe. We would like no confirmation mails and yet no subscribe immediate. We need to alter the interface to allow this. I suggest we add a new parameter "bool $skip_confirmation_mail = FALSE". Remove the @todo comment in this function.
  2. In SubscriptionManager::subscribe() write code to handle $skip_confirmation_mail equals TRUE. It's a bit awkward as we do need to call $subscriber->setChanges() but not $this->mailer->sendCombinedConfirmation().
  3. In simplenews_user_login(), write code similar to ConfirmationController::confirmCombined(). However I'm not sure how we know if the changes in the subscriber are still the same ones - what do we use as equivalent to the $hash? Remove the @todo comment.

I think the whole model for confirmations is currently quite flawed.

geek-merlin’s picture

> I think the whole model for confirmations is currently quite flawed.
Yup.

I have worked with the email_confirmer module and i like the approach of factoring out that functionality.
Unfortunately it is effectively unmaintained, but can be a good start for such a component.

super_romeo’s picture

I wonder why there are so few subscribers on this issue. It affects thousands of sites.
I think it's just that the administrators have not checked the registration for a long time, like me.

super_romeo’s picture

The problem is wider.

Emails send in this sequence:

  1. register email address confirmation,
  2. subscription confirmation.

Thus this emails appears in email app in in reverse order.
So user firstly follow the subscription confirmation link. And after click button he is wondering why he is still not logged in???
Big percent just leave my website.

super_romeo’s picture

Checking checkbox Skip email verification (discouraged) on /admin/config/services/simplenews/settings/subscription fixed this problem.

adamps’s picture

I created #3332695: Model for confirmations is flawed.

I have worked with the email_confirmer module and i like the approach of factoring out that functionality.

Interesting. However I think the problem is not really with the code that sends the emails and receives the confirmations. Instead we are lacking somewhere to store the unconfirmed subscription. That's what the new issue fixes, and I believe we'd need that fix even if we switch to a different confirmation model.

I wonder why there are so few subscribers on this issue.

It only affects sites that allow subscription on the email registration form. I guess that reduces the number of sites.

Checking checkbox Skip email verification (discouraged) on /admin/config/services/simplenews/settings/subscription fixed this problem.

True but you then have no confirmations in all cases - also when subscribing via the subscriber block.

adamps’s picture

adamps’s picture

Issue summary: View changes
adamps’s picture

Title: Confirmation email sent for subscriptions during user registration » Major confusion for subscriptions during user registration
Issue summary: View changes
adamps’s picture

Issue summary: View changes

Davidrb1992 made their first commit to this issue’s fork.

adamps’s picture

adamps’s picture

Status: Active » Needs review
StatusFileSize
new55.07 KB

This patch is code complete with some brief manual testing. The tests have not yet been updated.

adamps’s picture

Status: Needs review » Needs work
adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new46.76 KB
new10.02 KB

Status: Needs review » Needs work

The last submitted patch, 19: simplenews.registration.3238247-19.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new58.4 KB
new12.99 KB

Status: Needs review » Needs work

The last submitted patch, 21: simplenews.registration.3238247-21.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new58.52 KB
new1.28 KB

Status: Needs review » Needs work

The last submitted patch, 23: simplenews.registration.3238247-23.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new59.38 KB
new2.93 KB

Status: Needs review » Needs work

The last submitted patch, 25: simplenews.registration.3238247-25.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new60.38 KB
new3.97 KB

Status: Needs review » Needs work

The last submitted patch, 27: simplenews.registration.3238247-27.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new60.25 KB
new837 bytes

Status: Needs review » Needs work

The last submitted patch, 29: simplenews.registration.3238247-29.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new61.54 KB
new3.88 KB

Status: Needs review » Needs work

The last submitted patch, 31: simplenews.registration.3238247-31.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new75.19 KB
new30.12 KB

Some redesign of the subscriber fields...

adamps’s picture

The last submitted patch, 33: simplenews.registration.3238247-33.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Status: Needs review » Needs work

The last submitted patch, 34: simplenews.registration.3238247-35.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new74.49 KB
new9.81 KB

Status: Needs review » Needs work

The last submitted patch, 37: simplenews.registration.3238247-37.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new75.04 KB
new4.36 KB

Status: Needs review » Needs work

The last submitted patch, 39: simplenews.registration.3238247-39.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new76.09 KB
new1.83 KB

Status: Needs review » Needs work

The last submitted patch, 41: simplenews.registration.3238247-41.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

adamps’s picture

adamps’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 43: simplenews.registration.3238247-43.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new77.97 KB
new2 KB

Status: Needs review » Needs work

The last submitted patch, 46: simplenews.registration.3238247-45.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new81.35 KB
new3.95 KB
adamps’s picture

Issue summary: View changes
Status: Needs review » Active

Oops all the patches so far are actually for #3332695: Model for confirmations is flawed, which is a blocker for this.

adamps’s picture

Version: 3.x-dev » 4.x-dev
adamps’s picture

Status: Active » Needs review
StatusFileSize
new16.33 KB

Status: Needs review » Needs work

The last submitted patch, 51: simplenews.subscription-reg.3238247-51.patch, failed testing. View results

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new18.22 KB
new2.18 KB

Status: Needs review » Needs work

The last submitted patch, 53: simplenews.subscription-reg.3238247-53.patch, failed testing. View results

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new18.63 KB
new1.12 KB

Status: Needs review » Needs work

The last submitted patch, 55: simplenews.subscription-reg.3238247-55.patch, failed testing. View results

adamps’s picture

Status: Needs work » Needs review
StatusFileSize
new19.54 KB
new3.36 KB

  • AdamPS committed 61873699 on 4.x
    Issue #3238247 by AdamPS: Major confusion for subscriptions during user...
adamps’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.