Your software
My Mautic version is: 4.0.1
My PHP version is: 7.4.11
My Database type and version is: MariaDB 10.5.12
Your problem
Hi, I’m getting some confusing behavior in Mautic and I’m baffled as to how to troubleshoot it.
I built a campaign selecting contacts from two segments, and before the first email set a rule to “exclude” contacts with a certain tag:
┏━━━━━━━━━━━━━━━━━━━━━━┓
┃ Segment A, Segment B ┃
┗━━━━━━━━━━━━━━━━━━━━━━┛
||
╲╱
(Wait until a date/time)
┏━━━━━━━━━━━━━━━━━━━━━━┓
┃ If contact has Tag X ┃
┗━━━━━━━━━━━━━━━━━━━━━━┛
(yes) (no)
||
╲╱
┏━━━━━━━━━━━━━━┓
┃ Send Email 1 ┃
┗━━━━━━━━━━━━━━┛
||
╲╱
(Wait until another date)
┏━━━━━━━━━━━━━━┓
┃ Send Email 2 ┃
┗━━━━━━━━━━━━━━┛
…and so on. I have an initial test for tag X to exclude a specific group of contacts, and then schedule daily emails for the rest of the contacts from the initial segments.
My problem is that Mautic sends only Email 1. From 2 onwards it queues the send operation (gray box in email list), but never sends them and they never appear in the spool directory.
Steps I have tried to fix the problem:
If I clone the already queued emails as Broadcast ones and try to schedule them directly using a publish date, they also get queue but never sent. The mautic:broadcasts:send operation lists the broadcast as “pending” for N contacts, but on the next run it lists as 0 pending, as if the emails were actually sent. In the email list they are shown as queued (gray box again), never as sent (yellow box).
I also tried creating a new segment, joining Segments A and B and also excluding Tag X through segment filters, and then creating a campaign to just schedule the emails without the need for a decision block, but the result is the same: all emails get stuck in queued state.
What I’m doing daily as a workaround is copying (not cloning, but manually copying everything) the stuck email for the day and creating ad-hoc campaigns to send each email immediately.
I have a script that runs each of the following operations scheduled every 2 minutes in crontab. It uses flock to keep it from starting if another instance of the script is still running, but it is generally taking ~20 seconds to run if there aren’t any emails to send in the spool.
mautic:segments:update
mautic:campaigns:update
mautic:campaigns:trigger
mautic:broadcasts:send
mautic:messages:send
mautic:emails:send
These errors are showing in the log:
Nothing is written to the Mautic log files when this happens.