# Database queue for email in Mautic 5 doesn't work as expected

**URL:** <https://forum.mautic.org/t/database-queue-for-email-in-mautic-5-doesnt-work-as-expected/34696>\
**Category:** Product Support\
**Created:** [January 9, 2025, 12:29pm UTC](https://forum.mautic.org/t/database-queue-for-email-in-mautic-5-doesnt-work-as-expected/34696 "2025-01-09T12:29:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaloch](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aaloch/32/13510_2.png) [@aaloch](https://forum.mautic.org/u/aaloch)\
**Post date:** [January 9, 2025, 12:29pm UTC](https://forum.mautic.org/t/database-queue-for-email-in-mautic-5-doesnt-work-as-expected/34696/1 "2025-01-09T12:29:45Z")

</div>

**Your software**  
My Mautic version is: 5 ( latest from the download page )  
My PHP version is: PHP Version 8.1.2-1ubuntu2.20  
My Database type and version is: 10.6.18-MariaDB-0ubuntu0.22.04.1  
My Doctrine driver: pdo\_mysql  
My Doctrine database platform (automatically detected): Doctrine\DBAL\Platforms\MariaDb1052Platform

**Your problem**  
I followed this tutorial [Email sending in Mautic 5: Cron, Queue and Daemons – Joey Keller](https://joeykeller.com/email-sending-in-mautic-5-cron-queue-and-daemons/) to set database queue. However, I couldn’t get it to work. For the context:

- I’m using AWS SES with pm-pmaas/etailors\_amazon\_ses ( followed [this tutorial](https://www.youtube.com/watch?v=ejd7wfJjhQo) ) which works fine
- When I send a test email from **Email Settings** it works, but when I send an email from \*\* Queue Settings\*\* it doesn’t work.
- When I send an email from a single **Contact** page it works, but when I send a \*\* Segment email\*\* it doesn’t work, it just stays pending.

The queue configuration is set as required ( `'messenger_dsn_email' => 'doctrine://default',` ), and the `bin/console messenger:consume email` is running in the background using a system daemon.

I tried to track the problem down, so I stopped the daemon and triggered a new Segment email, I checked `messenger_messages ` table, all emails were there. I started the daemon again and the messages disappeared from the table, but nothing is sent. Unfortunately, the `messenger:consume email` isn’t logging anything.

As soon as I run this command `bin/console mautic:broadcasts:send --limit=50 --batch=20` I get the following:

```auto
Mautic Integration Testing 2
 4/4 [============================] 100%

+-------------------------------------+--------+----------+
| Channel | # sent | # failed |
+-------------------------------------+--------+----------+
| Email: Mautic Integration Testing 2 | 4 | 0 |
+-------------------------------------+--------+----------+

```

After the `bin/console mautic:broadcasts:send` command, all messages get delivered. So, it seems that there is an issue with how the queues are handled. I checked Symphony docs and tried to follow all instructions, but nothing worked.

Note that there is nothing being logged in `var/logs` and `messenger:consume email` doesn’ log anything even with the flag `-vvv`. I tried using it with a daemon, cron job, directly in the command line, but it’s not sending or showing anything, but it does something in the background when it’s triggered since the queue messages disappear from the database table as soon as it’s triggered.

Any help would be appreciated, I’m stuck with this for 2 days and can’t find a solution.

---

<div class="post-metadata">

**Author:** ![rcarabelli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rcarabelli/32/6807_2.png) [@rcarabelli](https://forum.mautic.org/u/rcarabelli)\
**Post date:** [January 31, 2026, 1:33am UTC](https://forum.mautic.org/t/database-queue-for-email-in-mautic-5-doesnt-work-as-expected/34696/2 "2026-01-31T01:33:19Z")

</div>

You have 3 key commands in this

2 are for sending the messages to the queue and 1 is for actually sending the queue

For filling the queue:

> php bin/console mautic:campaigns:trigger  
> _This will send campaign events into the queue_
> 
> php bin/console mautic:campaigns:trigger  
> _This will send segmented emails and SMS into the queue_
> 
> php bin/console messenger:consume email  
> _This will process the queue and actually send the emails and sms_

> Here is some extra info about the consume command (thanks ChatGPT)
> 
> `php bin/console messenger:consume email` — options (the useful manual)
> 
> Syntax (core):  
> `messenger:consume [-l|--limit] [-f|--failure-limit] [-m|--memory-limit] [-t|--time-limit] [--sleep] [-b|--bus] [--queues] [--no-reset] [<receivers>...]`
> 
> ### Options you actually use
> 
> - `--limit=NUM` → process **NUM messages** then exit (good for cron).
> 
> - `--time-limit=SECONDS` → run up to **SECONDS** (finishes current message, then exits).
> 
> - `--memory-limit=128M|256M|...` → exit if memory exceeds that (prevents slow leaks).
> 
> - `--failure-limit=NUM` → stop after **NUM failed messages** (useful when something is broken).
> 
> - `--sleep=SECONDS` → when queue is empty, wait this long before polling again (CPU-friendly).
> 
> - `--queues=NAME1,NAME2` → only consume specific queue(s) **if the transport supports it**.
> 
> - `--bus=BUSNAME` → force which bus receives the messages (rare in Mautic setups).
> 
> - `--no-reset` → don’t reset services after each message (can leak state; only use if you _really_ know why).
> 
> ### Two Mautic-specific “gotchas” (important)
> 
> - If you run `messenger:consume` from **cron** , Mautic docs recommend you include at least one of: `--memory-limit`, `--limit`, or `--time-limit` (otherwise it becomes a long-lived process).
> 
> - The receiver name `email` is just the **transport/receiver**. For “WhatsApp”, it would be whatever receiver you configured (e.g. `whatsapp`). Messenger doesn’t care what it sends — it just consumes that receiver.
