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.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Screenshot 2025-04-03.png | 439.15 KB | saidatom |
Issue fork purge_users-3517192
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
Comment #3
keshav patel commentedPHPUnit tests are failing, marking it as "Needs work".
Comment #4
mably commented@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?
Comment #5
saidatomCurrent behavior:

With the settings shown in the attached image, users are currently receiving notifications 7 days ahead of today's date on outdated accounts.
Expected behavior:
Logically, notifications should be sent 7 days before the specific rule configured for each case.
Example:
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.
Comment #6
mably commentedIf 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?
Comment #7
saidatomComment #8
mably commentedTests are all green now 🎉
Comment #9
mably commentedComment #10
mably commentedComment #11
mably commentedComment #13
mably commented