Summary email limit sent in 1 hour

Is the limit of the number of summary e-mails that can be sent up to 1 hour adjustable.
(sorry for bad english)

1 Like

Not sure I understand what you are referring to , but see Discourse Activity Summary Emails Guide for more details on the summary emails and how they work.

2 Likes

Likely his email provider only allows x emails per hour and he wants to make sure Discourse sends fewer than that.

Here’s an answer to a similar question: How to set Email sending speed limit?

Yes @Jonathan5 I wanted to ask this. thanks for sharing. I will read the subject

Yes, this is currently easily set for digest emails using a Discourse global setting, for example to set your digests limit to 40 per hour you can set this in your container build file:

 DISCOURSE_MAX_DIGESTS_ENQUEUED_PER_30_MINS_PER_SITE: 20

This Discourse global setting for digests defaults to 10,000 every 30 minutes, and if you have a huge number of users, this can send out a lot of digests.

On our site, we use SendGrid (a paid plan) to send out 100,000 digests a month, plus or minus, so we set this to:

100,000 divided by 30 days per month divided by 24 hours a day divided by 2 per hour, so roughly: 60 digests per 30 minutes and it has been working smoothly.

See also:

Note: This requires a container rebuild / bootstrap so please consider this before making the change.

1 Like

@neounix thank you so much. I was having a problem with e-mail because I have too many users.
I bought a mail server myself. There is a limit of 800 emails per hour. I was still having a problem.

1 Like

You are welcome @ozkn !!

Just set that Discourse global setting to less than 400 per 30 minutes and you should be good to go.

We run digests in a “standalone SMTP channel” based on some monkey-patch’n plugin I wrote:; but since you are running the standard “single SMTP channel” config; you may need to go lower, naturally.

1 Like

I did not risk it I set it to 75. This way, it sends 108,000 mails per month.

1 Like

Digests emails a month…,

This global setting only applies to digests.

:slight_smile:

1 Like

Hey @ozkn

OBTW, just to let you know.

I monkey patched the EnqueueDigestEmails Job on our main Discourse setup and set the digest Job interval to every 5 minutes versus the Discourse OOTB hardwired 30 minutes.

This meant, in our case, we could set the Global digest limiting var to 10 and send out 10 digests every 5 minutes versus 60 every 30 minutes. This gave me a very small number of, what I consider “advantages” doing it this way:

  • there is less load sending out 10 versus 60 at a time (or 50 versus 300, for example).
  • the admin email->sent log file is easier to read at a glance.
  • when we rebuild the container, the job always runs “on startup” so this lower number mitigated the initial job digest run to a much smaller number (since I could not figure out how to get the Discourse config to skip the initial running the job after the container rebuilds).

These are very small advantages, so I don’t recommend most people monkey patch the digest job for this small subjective advantage; but I prefer a 5 minute digest job interval over a 30 minute interval, and after testing for a few days, the mp works great and so, we are going to stay with the every 5 minutes interval.

Just to let you know, as some “small thing” to consider :slight_smile:

1 Like

@neounix Thanks for your suggestion. where exactly can I make this setting.

1 Like

Here you go @ozkn

https://github.com/unixneo/discourse-neo-email-digest-monkey-patch

1 Like

thank you so much @neounix

You are welcome @ozkn

If you need further help with this monkey patch, since changing the digest mailer queueing interval from 30 to 5 minutes is not supported by Discourse, please contact me in this topic:

I have not yet made this patch a “polished plugin” with a README file and site settings, but in the future, I might make the interval a plugin site setting so it is not hard-wired to 5 minutes.

1 Like