From f72d0236284de14fee099d96029a2d6fa39f622a Mon Sep 17 00:00:00 2001 From: "promptless[bot]" Date: Wed, 6 May 2026 10:33:56 +0000 Subject: [PATCH 1/4] Document --cleanup-only flag for mautic:reports:scheduler command Add documentation for the new --cleanup-only flag that allows users to run report cleanup separately from report sending, preventing duplicate Report Emails when both operations run simultaneously. --- docs/configuration/cron_jobs.rst | 34 +++++++++++++++++++++++++++++--- docs/reports/reports.rst | 8 ++++++-- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/docs/configuration/cron_jobs.rst b/docs/configuration/cron_jobs.rst index 26ab70635..6f5555274 100644 --- a/docs/configuration/cron_jobs.rst +++ b/docs/configuration/cron_jobs.rst @@ -274,6 +274,8 @@ Command parameters: - ``--min-contact-id`` and ``--max-contact-id`` allows the separation of Email sending by smaller chunks, by specifying contact ID ranges. If those ranges won't overlap, this allows you to run several broadcast commands in parallel. +.. _send scheduled reports cron job: + .. vale off Send scheduled Reports cron job @@ -285,11 +287,37 @@ Starting with Mautic 2.12.0, it's now possible to use cron to send scheduled Rep .. code-block:: php - php /path/to/mautic/bin/console mautic:reports:scheduler [--report=ID] + php /path/to/mautic/bin/console mautic:reports:scheduler [--report=ID] [--cleanup-only] -.. note:: +Command parameters: +******************* + +- ``--report=ID`` specifies a Report by ID. If not provided, processes all scheduled Reports. + +- ``--cleanup-only`` runs only the cleanup operation, removing old exported Report files without sending scheduled Reports. Use this to separate the cleanup and sending tasks to prevent duplicate Report Emails. + +.. note:: + + For releases prior to 1.1.3, it's required to append ``--env=prod`` to the cron job command to ensure commands execute correctly. + +Preventing duplicate Report Emails +********************************** + +Running the Report send and cleanup operations at the same time can cause duplicate Report Emails. To prevent this, run separate cron jobs: + +1. A cleanup-only job that removes old exported files: + + .. code-block:: php + + php /path/to/mautic/bin/console mautic:reports:scheduler --cleanup-only + +2. A separate job that sends scheduled Reports: + + .. code-block:: php + + php /path/to/mautic/bin/console mautic:reports:scheduler - for releases prior to 1.1.3, it's required to append ``--env=prod`` to the cron job command to ensure commands execute correctly. +Stagger these jobs so they don't run at the same time. .. vale off diff --git a/docs/reports/reports.rst b/docs/reports/reports.rst index fc065d69d..df0b34c52 100644 --- a/docs/reports/reports.rst +++ b/docs/reports/reports.rst @@ -177,9 +177,13 @@ Cron job to schedule Reports Mautic requires the following cron command to be able to send scheduled Reports: -``php /path/to/mautic/bin/console mautic:reports:scheduler [--report=ID]`` +``php /path/to/mautic/bin/console mautic:reports:scheduler [--report=ID] [--cleanup-only]`` -The ``--report=ID`` argument allows you to specify a Report by ID if required. For more information, see :ref:`Cron jobs`. +- The ``--report=ID`` argument allows you to specify a Report by ID if required. + +- The ``--cleanup-only`` argument runs only the cleanup operation to remove old exported files without sending Reports. + +For more information, see :ref:`Send scheduled Reports cron job`. Report options ============== From 452e7c9eba2e7cba2f588d4e9b5b0d81ea309823 Mon Sep 17 00:00:00 2001 From: "promptless[bot]" Date: Thu, 21 May 2026 09:19:11 +0000 Subject: [PATCH 2/4] Remove incorrect Mautic 1.1.3 version reference PR reviewer noted that Mautic 1.1.3 didn't have report schedule sends, so the --env=prod note for that version was incorrect. --- docs/configuration/cron_jobs.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/configuration/cron_jobs.rst b/docs/configuration/cron_jobs.rst index 6f5555274..771f1a4b3 100644 --- a/docs/configuration/cron_jobs.rst +++ b/docs/configuration/cron_jobs.rst @@ -296,10 +296,6 @@ Command parameters: - ``--cleanup-only`` runs only the cleanup operation, removing old exported Report files without sending scheduled Reports. Use this to separate the cleanup and sending tasks to prevent duplicate Report Emails. -.. note:: - - For releases prior to 1.1.3, it's required to append ``--env=prod`` to the cron job command to ensure commands execute correctly. - Preventing duplicate Report Emails ********************************** From e1dc6386afa9b46183a8e72215a9356110d10532 Mon Sep 17 00:00:00 2001 From: "promptless[bot]" Date: Thu, 28 May 2026 12:54:54 +0000 Subject: [PATCH 3/4] Address reviewer feedback on --cleanup-only documentation Apply all 7 suggestions from reviewer @adiati98: - Change "Command parameters:" header from asterisks to dashes - Wrap "Preventing duplicate Report Emails" header in vale off/on - Use #. instead of numbered list items for cron job steps - Capitalize "cron" to "Cron" in duplicate emails paragraph - Update bullet style and add cross-reference for report scheduler args - Fix RST label target capitalization for "Send scheduled Reports Cron job" - Use code block instead of inline code for command syntax in reports.rst --- docs/configuration/cron_jobs.rst | 16 ++++++++++------ docs/reports/reports.rst | 10 ++++++---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/docs/configuration/cron_jobs.rst b/docs/configuration/cron_jobs.rst index 771f1a4b3..39a7ecd9e 100644 --- a/docs/configuration/cron_jobs.rst +++ b/docs/configuration/cron_jobs.rst @@ -274,7 +274,7 @@ Command parameters: - ``--min-contact-id`` and ``--max-contact-id`` allows the separation of Email sending by smaller chunks, by specifying contact ID ranges. If those ranges won't overlap, this allows you to run several broadcast commands in parallel. -.. _send scheduled reports cron job: +.. _send scheduled Reports Cron job: .. vale off @@ -289,25 +289,29 @@ Starting with Mautic 2.12.0, it's now possible to use cron to send scheduled Rep php /path/to/mautic/bin/console mautic:reports:scheduler [--report=ID] [--cleanup-only] -Command parameters: -******************* +Command parameters +------------------ - ``--report=ID`` specifies a Report by ID. If not provided, processes all scheduled Reports. - ``--cleanup-only`` runs only the cleanup operation, removing old exported Report files without sending scheduled Reports. Use this to separate the cleanup and sending tasks to prevent duplicate Report Emails. +.. vale off + Preventing duplicate Report Emails ********************************** -Running the Report send and cleanup operations at the same time can cause duplicate Report Emails. To prevent this, run separate cron jobs: +.. vale on + +Running the Report send and cleanup operations at the same time can cause duplicate Report Emails. To prevent this, run separate Cron jobs: -1. A cleanup-only job that removes old exported files: +#. A cleanup-only job that removes old exported files: .. code-block:: php php /path/to/mautic/bin/console mautic:reports:scheduler --cleanup-only -2. A separate job that sends scheduled Reports: +#. A separate job that sends scheduled Reports: .. code-block:: php diff --git a/docs/reports/reports.rst b/docs/reports/reports.rst index df0b34c52..adc3b78e7 100644 --- a/docs/reports/reports.rst +++ b/docs/reports/reports.rst @@ -177,13 +177,15 @@ Cron job to schedule Reports Mautic requires the following cron command to be able to send scheduled Reports: -``php /path/to/mautic/bin/console mautic:reports:scheduler [--report=ID] [--cleanup-only]`` +.. code-block:: php -- The ``--report=ID`` argument allows you to specify a Report by ID if required. + php /path/to/mautic/bin/console mautic:reports:scheduler [--report=ID] [--cleanup-only] -- The ``--cleanup-only`` argument runs only the cleanup operation to remove old exported files without sending Reports. +* The ``--report=ID`` argument allows you to specify a Report by ID if required. -For more information, see :ref:`Send scheduled Reports cron job`. +* The ``--cleanup-only`` argument runs only the cleanup operation to remove old exported files without sending Reports. + +For more information, see :ref:`Send scheduled Reports Cron job`. Report options ============== From ac9ff069a7af4d6a130d5c4750297c6502ded080 Mon Sep 17 00:00:00 2001 From: "promptless[bot]" Date: Thu, 28 May 2026 13:11:27 +0000 Subject: [PATCH 4/4] Clarify --cleanup-only doesn't send Report Emails Address reviewer feedback to explicitly state that the cleanup-only job does not send Report Emails. --- docs/configuration/cron_jobs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration/cron_jobs.rst b/docs/configuration/cron_jobs.rst index 39a7ecd9e..45be47b36 100644 --- a/docs/configuration/cron_jobs.rst +++ b/docs/configuration/cron_jobs.rst @@ -305,7 +305,7 @@ Preventing duplicate Report Emails Running the Report send and cleanup operations at the same time can cause duplicate Report Emails. To prevent this, run separate Cron jobs: -#. A cleanup-only job that removes old exported files: +#. A cleanup-only job that removes old exported files without sending Report Emails: .. code-block:: php