fix: Skip email rate limiting for self-hosted instances (#13915)

Self-hosted installations were incorrectly hitting the daily email rate
limit of 100, seeded from `installation_config`. Since self-hosted users
control their own infrastructure, email rate limiting should only apply
to Chatwoot Cloud.

Closes #13913
This commit is contained in:
Vishnu Narayanan
2026-03-26 18:06:10 +05:30
committed by GitHub
parent d84ef4cfd6
commit 4c4b70da25
2 changed files with 24 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ module AccountEmailRateLimitable
end
def within_email_rate_limit?
return true unless ChatwootApp.chatwoot_cloud?
return true if emails_sent_today < email_rate_limit
Rails.logger.warn("Account #{id} reached daily email rate limit of #{email_rate_limit}. Sent: #{emails_sent_today}")