First of all, thanks for the great module! I started using it recently and now need some change in functionality.

Problem/Motivation

By default authenticated users (un)subscribed immediately. But sometimes they need to be (un)subscribed with confirmation email. I haven't found similar requests/issues, so decided to create a new one.

Proposed resolution

I propose adding new option to field "Opt-in/out method" (/admin/config/services/simplenews/manage/{simplenews_newsletter}), called "Double (Forced)", which will be used for having confirmation email for all users.

Remaining tasks

As starting point I'm adding patch in the comment below, so it needs to be reviewed. I tested it locally and it works as I suppose it to be. I haven't updated tests yet (I mean updating existing or creating new cases for this), because not sure about best way for it (need more time from me to carefully study existing cases and implement new ones).

User interface changes

Field "Opt-in/out method" options and description on /admin/config/services/simplenews/manage/{simplenews_newsletter}.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ilya.no created an issue. See original summary.

ilya.no’s picture

Initial patch attached for 8.x-1.0-alpha2 version.

jonathanshaw’s picture

Title: Simplenews "Double" Opt-in/out method for authenticated users » Double" Opt-in/out method for authenticated users
Version: 8.x-1.0-alpha2 » 8.x-1.x-dev
Status: Active » Needs review
Issue tags: +Needs tests

Features always need tests.

Status: Needs review » Needs work

The last submitted patch, 2: simplenews-forced-double-optin-2830376-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

ilya.no’s picture

jonathanshaw’s picture

Status: Needs work » Needs review

Setting to NR to run tests

Status: Needs review » Needs work

The last submitted patch, 5: simplenews-forced-double-optin-2830376-5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

AdamPS’s picture

Status: Needs work » Postponed (maintainer needs more info)
Issue tags: -Needs tests

But sometimes they need to be (un)subscribed with confirmation email

The issue doesn't say why this would be useful. The main purpose of double-confirmation is to prove that the subscriber owns that email address. However Drupal core already has a setting "Require email verification when a visitor creates an account".