Periodic cleanup of emails does not exist in 2.0

Created on 12 January 2024, 11 months ago
Updated 15 April 2024, 8 months ago

Problem/Motivation

The feature described here -- https://www.drupal.org/project/mail_safety/issues/2894814 β†’ -- and added to Drupal 7 release does not exist in more recent versions.

"After enabling saving to the dashboard, mails will stack up and are never cleaned up. This can cause an the database to be overloaded with old mails. Feature request to add a periodic cron clean up, based on the settings the user can provide."

Proposed resolution

Add same functionality to most recent release

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada endless_wander

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

Comments & Activities

  • Issue created by @endless_wander
  • πŸ‡ΊπŸ‡ΈUnited States laboratory.mike

    Currently I have this in a cron job:

    $now = new DrupalDateTime('-90 days');
    $delete = \Drupal::database()->delete('mail_safety_dashboard');
    $delete->condition('sent', $now->getTimestamp(), '<');
    $delete->execute();
    

    We could set this up in a container with dependency injection, and add a config to set the retention time.

Production build 0.71.5 2024