Take notify_subscriptions into account

Created on 27 July 2021, over 3 years ago
Updated 27 September 2023, about 1 year ago

Problem/Motivation

I have been using notify with admin users only for testing.
Yesterday I restored the full user tables; notify and notify_subscriptions. Hundreds of users.

I checked several users and there were no content types checked for nearly 200 users.
Despite this these people have been receiving notifications for years (D7).
There is no content checked for these users because the uid is in the notify table but not the notify_subscriptions table.

In D7 these all appear as checked, so users would have assumed they were subscribed and they never pressed the "Save settings" button and as such nothing was ever written to the notify_subscriptions table for about 200 users.

In D9 these appear as unchecked.

I truncated the notify_subscriptions table. Completely empty. Flushed caches.
I loaded a content item and all users still received the notification email.

I added two entries to the notify_subscriptions table, one each for 2 different users.
I added these via the Notification settings tab on the user account page.

The notify_subscriptions table now has 2 entries, each has one content type enabled, article or event (See notify_subscriptions.png)

I added a different content type (not and article or event) to Drupal and sent out the notification queue.
All users received the notification, including the 2 users who did not have that content type checked.

Maybe I'm missing something here, but it looks to me like the table notify_subscriptions doesn't do anything?

Proposed resolution

The notification for each user is composed in "src/Notify.php", and it checks notify_subscriptions correctly, but this is not being taking into account when adding the links to the email. Code has to be changed to do this correctly.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇦🇺Australia CBEEM

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024