diff --git a/app/Constants.php b/app/Constants.php index 03c07fa58b..51e19f5451 100644 --- a/app/Constants.php +++ b/app/Constants.php @@ -158,6 +158,7 @@ if (! defined('APP_NAME')) { define('MAX_DOCUMENT_SIZE', env('MAX_DOCUMENT_SIZE', 10000)); // KB define('MAX_EMAIL_DOCUMENTS_SIZE', env('MAX_EMAIL_DOCUMENTS_SIZE', 10000)); // Total KB define('MAX_ZIP_DOCUMENTS_SIZE', env('MAX_EMAIL_DOCUMENTS_SIZE', 30000)); // Total KB (uncompressed) + define('MAX_EMAILS_SENT_PER_HOUR', 90); define('DOCUMENT_PREVIEW_SIZE', env('DOCUMENT_PREVIEW_SIZE', 300)); // pixels define('DEFAULT_FONT_SIZE', 9); define('DEFAULT_HEADER_FONT', 1); // Roboto diff --git a/app/Ninja/Mailers/ContactMailer.php b/app/Ninja/Mailers/ContactMailer.php index 79ac13650d..50dbb87279 100644 --- a/app/Ninja/Mailers/ContactMailer.php +++ b/app/Ninja/Mailers/ContactMailer.php @@ -379,7 +379,7 @@ class ContactMailer extends Mailer // http://stackoverflow.com/questions/1375501/how-do-i-throttle-my-sites-api-users $hour = 60 * 60; - $hour_limit = 50; // users are limited to 50 emails/hour + $hour_limit = MAX_EMAILS_SENT_PER_HOUR; $hour_throttle = Cache::get("email_hour_throttle:{$key}", null); $last_api_request = Cache::get("last_email_request:{$key}", 0); $last_api_diff = time() - $last_api_request;