Skip to content
Snippets Groups Projects

Archive Mailing

When mailings are archived, compile stats and tidy up the database details. Also provides a Scheduled Job to automatically archive mailings after a certain number of days (disabled by default).

Statistics for mailings are kept on a per-mailing basis, but the per-contact statistics are deleted.

Aims to improve performance by cleaning up database tables that can become very large after a certain amount of time, while still retaining some statistics about mailings sent.

The extension is licensed under AGPL-3.0.

Requirements

  • PHP v7.2+
  • CiviCRM (FIXME: Version number)

Installation

Install as a regular CiviCRM extension.

Getting Started

(* FIXME: Where would a new user navigate to get started? What changes would they see? *)

Known Issues

(* FIXME *)

TODO

  • Hoping this gets merged: https://github.com/civicrm/civicrm-core/pull/22800
  • Api function to archive the mailings.
    • Calculate the stats for the civicrm_mailing_archive_stat table
    • delete from civicrm_mailing_event_queue where job_id IN (2270,2271,2273,2278,2279,2281); - it will cascade the deletion for clics, opens, bounces, etc.
  • Override CRM/Mailing/Page/Report::run via hook, so that we can populate the compiled stats instead.
  • When a mailing is archived in the interface, archive the stats.
  • Scheduled Job to automatically archive mailings after a certain number of days.