Yes - it looks like we need to define the --batch and --limit.
If I understand correctly, the batch should be:
- 10 for SMTP
- 50 for mailjet since API v3
- etc.
This is the batch size - mails per call. With queuing, it will be pumped into the messenger_messages table and be no issue.
But without queue, we should set both parameters to useful numbers.
So if I run the queue each other minute, and have 14 mails / sec. and 40 loops to consume the queue… I may send up to 560 mails per cronjob run.
This means, I could set the broadcast command to 560 mails and batch them by 560 (if I wouldn’t want the queue to grow much more). But there is a reason there is the queue so we could load it a bit more and let the consumption run over time.
But true - we should also set the limit. Without queuing, the batch size needs to be adjusted to the service.
Do you agree?
This was the source, summarized by Perplexity:
Yes, the mautic:broadcasts:send
command in Mautic offers both a --batch
and a --limit
parameter, although they are used differently in practice.
### --batch
Parameter
The --batch
parameter determines the number of emails sent in a single API call to the email service provider. This is particularly important because different email service providers have different limits for the number of emails per API call. For example, SparkPost allows up to 1000 emails per call, while SMTP typically only allows 10 emails per batch.
### --limit
Parameter
The --limit
parameter specifies how many contacts are processed per execution of the command. This means that during each execution of the command, a certain number of contacts are processed before the command is run again. The default value is 100 contacts per execution.
### Practical Use
In practice, the --batch
parameter is used to control the number of emails sent in a single API call, while the --limit
parameter controls the total number of contacts processed per execution. Both parameters can be used to optimize email sending and control server load.
Example of using both parameters:
bash* *php /path/to/mautic/bin/console mautic:broadcasts:send --batch=100 --limit=200* *
This command would process up to 200 contacts per execution and send 100 emails per API call.
It is important to note that the use of these parameters may vary depending on the version and configuration of Mautic. In some cases, the --limit
parameter may not be explicitly supported, and instead, the --batch
parameter is used to control the number of emails per API call.