# Campaign completed actions but email not sent out

**URL:** <https://forum.mautic.org/t/campaign-completed-actions-but-email-not-sent-out/28678>\
**Category:** Product Support\
**Created:** [July 22, 2023, 5:03am UTC](https://forum.mautic.org/t/campaign-completed-actions-but-email-not-sent-out/28678 "2023-07-22T05:03:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johntech](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/johntech/32/6553_2.png) [@johntech](https://forum.mautic.org/u/johntech)\
**Post date:** [July 22, 2023, 5:03am UTC](https://forum.mautic.org/t/campaign-completed-actions-but-email-not-sent-out/28678/1 "2023-07-22T05:03:39Z")

</div>

**Your software**  
My Mautic version is: 4.4.9  
My PHP version is:7.4  
My Database type and version is: Mariadb 10.5

**Your problem**  
My problem is: the campaign showed completed actions but actually there is no email sent out.

These errors are showing in the log: no logs associated with this.

Steps I have tried to fix the problem: segment with 8 contacts is OK but this segment with 1800 contacts cannot work.

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

Crob Jobs as below  
\*/2 \* \* \* \* /bin/bash /usr/local/bin/mauticgymcrons.sh  
#!/bin/bash

MAUTICCONSOLE=“/var/www/html/mauticgym/bin/console”  
if [-z “$(ls -A /var/www/html/mauticgym/var/spool)”]; then

```
    php $MAUTICCONSOLE mautic:broadcasts:send --limit=2
    php $MAUTICCONSOLE mautic:campaigns:rebuild --batch-limit=300
    php $MAUTICCONSOLE mautic:segment:update --batch-limit=900
    php $MAUTICCONSOLE mautic:campaigns:trigger --campaign-limit=2
    php $MAUTICCONSOLE mautic:import --limit=500
    php $MAUTICCONSOLE mautic:webhooks:process
    php $MAUTICCONSOLE mautic:reports:scheduler
    php $MAUTICCONSOLE mautic:email:fetch

```

else  
php $MAUTICCONSOLE mautic:broadcasts:send --limit=2  
php $MAUTICCONSOLE mautic:emails:send --message-limit=200  
php $MAUTICCONSOLE mautic:email:fetch  
fi

There are no contacts appearing in the contact tab of email.

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

How did this happen?

---

<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:** [July 23, 2023, 7:16am UTC](https://forum.mautic.org/t/campaign-completed-actions-but-email-not-sent-out/28678/2 "2023-07-23T07:16:42Z")

</div>

> [@johntech](#):
>
> A /var/www/html/mauticgym/var/spool

Hello John,  
First of all, I love your bash script.  
Also: I suggest you check if there are any files in your

`/var/www/html/mauticgym/var/spool`

folder.  
You can even count them with this command:

`ls | wc`

---

<div class="post-metadata">

**Author:** ![johntech](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/johntech/32/6553_2.png) [@johntech](https://forum.mautic.org/u/johntech)\
**Post date:** [August 8, 2023, 7:02am UTC](https://forum.mautic.org/t/campaign-completed-actions-but-email-not-sent-out/28678/3 "2023-08-08T07:02:19Z")

</div>

Hello Joeyk  
I installed my mautic instance following your script 🙂 which is very convenient for me to deal with crob job setting up.

Thanks for your response. I have taken one week to solve the problems. But I can share my experience below in case of the same issues by other users.  
php $MAUTICCONSOLE mautic:campaigns:trigger --kickoff-only --scheduled-only  
Actually, trigger action includes two steps, firstly it will priority command (-kickoff-only) to finish all the fresh contact to initial scheduled sending event. Then It will execute the email sending ( --scheduled-only) based on the sending time.

So that’s why it showed the yellow tab"984" but did not send the email.

Also, we can limit the number of contact execution by the trigger after adding " --campaign-limit=2".

Why I do this because I want to limit the number of sending emails every day. Below is my campaign command part just limit the “–scheduled-only” is enough:  
php $MAUTICCONSOLE mautic:campaigns:trigger --kickoff-only  
php $MAUTICCONSOLE mautic:campaigns:trigger --scheduled-only --campaign-limit=2

---

<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:** [August 8, 2023, 7:48am UTC](https://forum.mautic.org/t/campaign-completed-actions-but-email-not-sent-out/28678/4 "2023-08-08T07:48:12Z")

</div>

Thank you @johntech , this is super valuable insight in Mautic campaigns command!
