Email Queue - Which table is this in the Database? - Need to delete/clear the outstanding queue manually

Email Queue - Which table is this in the Database?

  • Need to delete/clear the outstanding queue manually

Sending 200k emails and had a warm up on the domain to throttle it - but priorities have changed and need to kill the outstanding

Unable to see anything in the database that screams an obvious table name.

Its in the file system.
mautic/var/spool

Each email is a file.

haha yikes okay thats going to be fun cleaning up

Thx mate

@joeyk
Is there any other references? anything else we gotta be mindful of?

How does the logic work? just run batches from the email send cron?
Get throttle variable from config - send email - delete file

So in theory we could add to our commands.php file

Count queue

$queue_count= count(glob("/var/spool/" . "*"));
echo $queue_count;

Then Delete

$queue_files = glob('/var/spool/*'); // get all file names
foreach($queue_files as $queue_file){ // iterate files
  if(is_file($queue_file)) {
    unlink($queue_file); // delete file
  }
}

I would play with the cron execution + batch size.
Here is a guide:

To sum up:
You want to play with
How often you run the command that sends emails + how many emails you send.
If you run your mautic:emails:send command every 10 minutes with a batch size of 150:
mautic:emails:send --message-limit=150

Then you will send out 150 emails / 10 min = 900 emails / hour.

But deleting those files to kill off the queue? - all good?

No other considerations?

Yes it will kill the queue.
The emails wont be sent out.
In Mautic you will see as ‘sent’ because this status is added once the email is “baked” and ready to be delivered = added to the queue.
So if you delete them, it’s the equivalent of the delivery guy ate the pizza. Counts as delivered but you stay hungry.

1 Like

Haha love the metaphor mate

But yep fully acknowledged
Cheers mate

1 Like