I absolutely need a throttling feature between emails

I get your frustration, and luckily this is kinda easy to setup. I guess you already know that mautic can send emails in two ways; send immediately and by queuing.

To throttle the sending time, you first need to go to the config panel -> Email Setting, and set “How should email be handled?” to Queue (I guess you already did that)

Here is where things get interesting, under the Email Setting section, you’ll see “Message limit for queue processing

The “message limit for queue processing” set the number of emails that should be processed every time an instance call to send the emails triggers, e.g your cron job, another way of saying this is that the “message limit for queue processing” is how many emails that are “Pending” will be processed the next time the cron job designated for sending emails is triggered.

If 100 email is pending, how many do you want to send when the cron job for sending an email is triggered, it is as simple as that.

So, if you set the “mautic:emails:send” cron job to trigger every 15 minutes, and you set the “message limit for queue processing” to 10, this means that you are throttling the mail sending to only send 10 emails every 15minutes. 60 (1 hour) divided by 15 is 4, so, you can send 40 emails/hour.

The point here is knowing the frequency at which the cron job triggers. If you for example set the “mautic:emails:send” cron job to trigger every minute, and you set the “message limit for queue processing” to 40, this gives us 40 x 60 = 2400/emails/hour

Here is a way to throttle email in small batch, I’ll assume you want to send 60 emails per hour, so this is what I’ll do, I’ll change the frequency of the cron job to 5 minutes, that is the minutes the cron job triggers. Now, divide the number of emails you want to send per hour by the amount of time the cron job will trigger per hour, 60/12 = 5

Navigate on to the Email Settings, and change the “message limit for queue processing” to 5, and this way you can send 60 emails per hour.

Feel free to adjust the number as you see fit, just make note of the time the cron job triggers.

Good Luck!

2 Likes