Problem/Motivation

If i choose "7 days" in user notification before deletion. It will send notifications for all accounts from today -7 days.

But what i expected from that email is to send 7 days before every value and period that i selected before.

Steps to reproduce

  • Enable Purge users who have never logged in for with 3 year
  • Enable Notification User Before Deletion in for with 7 days
  • Will catch all accounts from today - 7days when will send the notifications. But when run the deletion will be delete accounts never logged in for today - 3years

Proposed resolution

Calculate the notification based on each rule setting plus the notification value/period.

Based in example before i expect -3 year + 7 days

Remaining tasks

Implement the proposal changes.

CommentFileSizeAuthor
#5 Screenshot 2025-04-03.png439.15 KBsaidatom
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

saidatom created an issue. See original summary.

keshav patel’s picture

Status: Active » Needs work

PHPUnit tests are failing, marking it as "Needs work".

mably’s picture

@saidatom sadly, I'm not sure to understand what you are trying to do.

Would you mind trying to explain in more detail what the problem is and how you are trying to fix it?

saidatom’s picture

Status: Needs work » Active
StatusFileSize
new439.15 KB

Current behavior:
With the settings shown in the attached image, users are currently receiving notifications 7 days ahead of today's date on outdated accounts.
Only local images are allowed.

Expected behavior:
Logically, notifications should be sent 7 days before the specific rule configured for each case.

Example:

  • User A: Has not logged in for 8 months
  • User B: Has not logged in for 2 years

Currently, both users receive a notification about account cancellation. However, based on the rule that specifies "1 year of inactivity," only User B should receive the notification (since 8 months is not enough to trigger it).

What I'm correcting:

I’m updating the logic so that the system sends notifications only to users who match a specific rule's condition — and only 7 days before that rule’s threshold is met.

mably’s picture

If I understand it correctly, it's more a "Bug report" than a "Feature request" then.

And that definitely needs to be fixed.

Sounds strange that the unit tests are failing though.

Does that mean that we were testing for a wrong behavior?

saidatom’s picture

Category: Feature request » Bug report
mably’s picture

Status: Active » Needs review

Tests are all green now 🎉

mably’s picture

Title: Value/Period before notification User deletion » Calculate the notification time by subtracting the notification period from each rule's value
Component: User interface » Code
mably’s picture

Title: Calculate the notification time by subtracting the notification period from each rule's value » Calculate the notification time by adding the notification period to each rule's value
Issue summary: View changes
mably’s picture

Title: Calculate the notification time by adding the notification period to each rule's value » Calculate the notification time by subtracting the notification period from each rule's value

  • mably committed e0549cdc on 4.x authored by saidatom
    Issue #3517192 by saidatom, mably: Calculate the notification time by...
mably’s picture

Version: 4.0.0-rc2 » 4.x-dev
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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