Collection of scripts - Cleanup test form submissions

Hi there,

I’m starting a small collection of maintenance scripts for Mautic. The first tool addresses a common pain point: test data bloating statistics.

We have a client who uses a UI test script to regularly verify form functionality. While helpful, it creates a lot of noise in the reporting. To solve this, I’ve created mautic_clean_submissions.sh.

What it does: It allows you to target a specific user (by email address) and wipe their entire submission history.

Key Features:

  • Deep Clean: It doesn’t just touch the central submission log; it dynamically identifies and cleans the specific form_results_X tables associated with that lead.

  • Multi-Form Support: Handles leads who have submitted multiple different forms.

  • Safety First: Includes a Dry Run mode by default to preview affected rows before any deletion happens.

  • External Execution: Designed to run securely outside the Mautic web root using a .env configuration.

I tested it with Mautic 5.2.10 - please use it at your own risk! Please let me know when you find issues with it directly in github.