Broadcast sending stop suddenly during the process no issues from Cron Job or Queue

My Mautic version is: 4.1.0
My PHP version is:7.4
My Database type and version is: Mariadb 10.5
How should email be handled?–>Immediately
Default Frequency Rule–>Do not send me more than–>20 per day.

Cron Job

          • /bin/bash /usr/local/bin/mauticcrons.sh

Script below

Your problem
My problem is: the Broadcast stopped sending the rest 36 of 162 emails.

These errors are shown in the log:
No Logs

Steps I have tried to fix the problem:
I have done a new Broadcast with just 6 emails to test, It is no problem.

What is the possible reason?

Hey @johntech !
First of all, good job on using this script. Batch scripts are the way to go :slight_smile:
Why the limit=1 ?

I have a suspicion:
How EXACTLY is your broadcast sending time window? How much time you have set between “Publish up and publish down” ?

PS:
According to the script you only fetch emails if you have something to send.

Hi @joeyk , here are the photos.
I want to keep my email reputation and send broadcast 1 email every minute.

I copied your Crob Job and not sure how it works exactly.
Should I set email fetch up on Crontab, not on this bash script?

Email:

Sending Time View

Broadcast Email Publish Details

This is how the script works:

You have fetching emails in both places as well, so all good.
You don’t use spool, so you wouldn’t even need to check for the spool to be empty/filled

Can you enter in ssh the broadcast email command to see what is the output?
php /var/www/html/mautic/bin/console mautic:broadcasts:send --limit=1

@joeyk OK for the fetching and thanks for your explanation. In case of future use, I keep the spool script there.
One question:how to adjust this broadcast scrip to send 1 email every 2 or 3 minutes?
I think it maybe needs to set on crontab not on script?

Yes, below is the result:

I can see that 1 Email failed in that channel. This is why it’s not sent. Now you need to figure out why that email is failing. Last time for me it was something so trivial as leaving a COMMA in the sender name.
Maybe there is something with your tokens?

Regarding your 2nd quertion, there are 3 solutions:

  1. If you run your script every minute and you send 1 email / broadcast, then your rate will be 1 email / min (not a solution)

  2. If you want to slow it down, you need to run your script only every 2-3 min. (not a solution)

  3. You can take your broadcast cron and run it separately every 3 min:
    */3 * * * * command

  4. Secret solution: you could adjust the script to have a condition that makes sure the script is run only every 3 min.

I have checked the syntax of the rest 36 emails and tokens. I cannot find any issues.

I can send you my account to check. Is that OK? I don’t where to send you this secret account.

About your solutions. they are good. I think solution 2 and 3 will be OK for me as I have no code experience. Thank you

I pm YOU, and we will debug it :slight_smile: