For sites that have a significant number of users, it may be useful to use the Queue API to break the batch down into smaller chunks to process.

The reason being that the remote mail service (like Google) can rate limit (or block) mail sent from your website's IP if the batch size is above a certain threshold within a timeframe. An example of such a message returned is:
postfix/smtp[24859]: host gmail-smtp-in.l.google.com[] said: 421-4.7.0 [4] Our system has detected an unusual rate of 421-4.7.0 unsolicited mail originating from your IP address. To protect our 421-4.7.0 users from spam, mail sent from your IP address has been temporarily 421-4.7.0 rate limited. Please visit 421-4.7.0 https://support.google.com/mail/?p=UnsolicitedRateLimitError to 421 4.7.0 review our Bulk Email Senders Guidelines.

A new fieldset can be defined on the form with a boolean to indicate whether or not the batch should be queued and a dependent field with the number of e-mails to send per batch.

This should provide some more flexibility in the number of e-mails that go out at one time.

Comments

edwardchiapet created an issue. See original summary.

edwardchiapet’s picture

Issue summary: View changes
edwardchiapet’s picture

Issue summary: View changes
edwardchiapet’s picture

FiNeX’s picture

+1 for this feature!

shrop’s picture

How many emails should be sent at at time?

We could have a default to that number and config to change the value within a range. If we do that a good range for validation purposes would also help.

FiNeX’s picture

The default is hard to tell because each provider has its own rate limits. Usually hourly or daily. Looking on the ones I'm using it seems that a lower (safe) average could be around 20 mails per hour, it allows to safely use the free version of Gmail which is max 500 per day. The paid one (Google apps) allows max 2000 per day (~80 per hour). Another provider I'm using allows max 100 emails per hour before suspending the email for 24 hours.

I agree that the module should have a configurable "per hour" limit. The defalut value could be 20.