Campaign completed actions but email not sent out

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.

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.

How did this happen?

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

Hello Joeyk
I installed my mautic instance following your script :slightly_smiling_face: 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

3 Likes

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