# Emails getting stuck in the middle of a campaign

**URL:** <https://forum.mautic.org/t/emails-getting-stuck-in-the-middle-of-a-campaign/21594>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [November 12, 2021, 3:37pm UTC](https://forum.mautic.org/t/emails-getting-stuck-in-the-middle-of-a-campaign/21594 "2021-11-12T15:37:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nunks](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nunks/32/1648_2.png) [@nunks](https://forum.mautic.org/u/nunks)\
**Post date:** [November 12, 2021, 3:37pm UTC](https://forum.mautic.org/t/emails-getting-stuck-in-the-middle-of-a-campaign/21594/1 "2021-11-12T15:37:10Z")

</div>

**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:

```auto
  ┏━━━━━━━━━━━━━━━━━━━━━━┓
  ┃ 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.

```auto
  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.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [November 12, 2021, 3:46pm UTC](https://forum.mautic.org/t/emails-getting-stuck-in-the-middle-of-a-campaign/21594/2 "2021-11-12T15:46:02Z")

</div>

Hello,

What happens is, that your contacts reach the maximum emails they can get in one day (possibly 1).  
Read this thread to understand more:

> [@Possible Issue with Email Frequency in 4.0.1](https://forum.mautic.org/t/possible-issue-with-email-frequency-in-4-0-1/21309):
>
> Your software My Mautic version is: 4.0.1 My PHP version is: 7.4 My Database type and version is: maraud Your problem My problem is: I have another open issue on this where emails are being set as queued. When I go and look at the frequency settings I see that it is set to 0 days. I tested this a few times and get different results. I then went and changed this to 100 emails per day, did a send and everything went through. My guess that somewhere inside Mautic it is not respecting the …

---

<div class="post-metadata">

**Author:** ![nunks](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nunks/32/1648_2.png) [@nunks](https://forum.mautic.org/u/nunks)\
**Post date:** [November 17, 2021, 10:37pm UTC](https://forum.mautic.org/t/emails-getting-stuck-in-the-middle-of-a-campaign/21594/3 "2021-11-17T22:37:13Z")

</div>

Thanks for answering and sorry for not finding the the email you pointed to before asking y question.

I set the default frequency to 100 and will check if it works out in next campaign.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/7/71e77d721da66ad8650e2a2cdc6cf710122d7a23.png)

A follow-up question: I understand a buggy frequency rule could be the problem when I want to send more than one email a day and the setting is NULL instead of zero (the default?). But if I’m scheduling campaign emails to be sent on different dates, why should this frequency rule apply, even if it’s buggy?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [November 18, 2021, 5:59am UTC](https://forum.mautic.org/t/emails-getting-stuck-in-the-middle-of-a-campaign/21594/4 "2021-11-18T05:59:28Z")

</div>

This is a limit per contact. In your settings you set 100 / day, so on a given date the 101st email won’t be sent. Next day the counter restarts.

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [November 18, 2021, 8:48am UTC](https://forum.mautic.org/t/emails-getting-stuck-in-the-middle-of-a-campaign/21594/5 "2021-11-18T08:48:29Z")

</div>

do we know if this is fixed in 4.0.2 ?
