mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Hosted email quotas
This commit is contained in:
parent
c663369d38
commit
c2c71ab69c
@ -227,6 +227,10 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
if(Ninja::isHosted() && strpos($this->nmo->to_user->email, '@example.com') !== false)
|
if(Ninja::isHosted() && strpos($this->nmo->to_user->email, '@example.com') !== false)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
/* GMail users are uncapped */
|
||||||
|
if(Ninja::isHosted() && $this->nmo->settings->email_sending_method == 'gmail')
|
||||||
|
return false;
|
||||||
|
|
||||||
/* On the hosted platform, if the user is over the email quotas, we do not send the email. */
|
/* On the hosted platform, if the user is over the email quotas, we do not send the email. */
|
||||||
if(Ninja::isHosted() && $this->company->account->emailQuotaExceeded())
|
if(Ninja::isHosted() && $this->company->account->emailQuotaExceeded())
|
||||||
return true;
|
return true;
|
||||||
|
@ -369,6 +369,7 @@ class Account extends BaseModel
|
|||||||
if(is_null(Cache::get($this->key)))
|
if(is_null(Cache::get($this->key)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
try {
|
||||||
if(Cache::get($this->key) > $this->getDailyEmailLimit()) {
|
if(Cache::get($this->key) > $this->getDailyEmailLimit()) {
|
||||||
|
|
||||||
if(is_null(Cache::get("throttle_notified:{$this->key}"))) {
|
if(is_null(Cache::get("throttle_notified:{$this->key}"))) {
|
||||||
@ -385,6 +386,10 @@ class Account extends BaseModel
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch(\Exception $e){
|
||||||
|
\Sentry\captureMessage("I encountered an error with email quotas - defaulting to SEND");
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user