Problem/Motivation
Avoid sending users when user notification email, when the time to purge users is reached, if the notification mail is checked and purge on cron is checked as well.
If the user select "Disable the account and keep its content." or "Disable the account and unpublish its content." instead of the user deletion, the system will send an email when the cron is ran.
Steps to reproduce
- Enable the module.
- Go to "admin/people/purge-rule".
- Set some purge user value and period to disable the user.
- Enable the checkbox
- Enable the "Check to send email notification to purged users." checkbox.
- Click on save
- Go to the cron page "admin/config/system/cron"
- Click on run
- Check that user receive an email
- Run again the cron
- Check that the user receives another email.
Proposed resolution
Save the UID in case the user is purged to avoid spamming. Figure out where to store the UIDs.
The test NotificationTest.php is failing.
Remaining tasks
User interface changes
API changes
Data model changes
This issue is blocked by https://www.drupal.org/project/purge_users/issues/3227269
The code from 3227269 is merged into this one to build further testing for this ticket.
Issue fork purge_users-3251360
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 #4
donquixote CreditAttribution: donquixote at European Commission and European Union Institutions, Agencies and Bodies commentedI also have another test I could add.
However, this depends on the KernelTestBase from https://git.drupalcode.org/project/purge_users/-/merge_requests/11#a5f69..., which we would have to merge first.
See https://www.drupal.org/project/purge_users/issues/3246399#mr11-note65543
Comment #8
Andras_Szilagyi CreditAttribution: Andras_Szilagyi for European Commission and European Union Institutions, Agencies and Bodies commented