1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Fixes for email quotas

This commit is contained in:
David Bomba 2022-06-18 08:54:58 +10:00
parent 36c3c624e9
commit ef15933a0f
2 changed files with 11 additions and 2 deletions

View File

@ -88,8 +88,14 @@ class TemplateEmail extends Mailable
$this->from(config('mail.from.address'), $email_from_name);
if (strlen($settings->bcc_email) > 1)
$this->bcc(explode(",",str_replace(" ", "", $settings->bcc_email)));//remove whitespace if any has been inserted.
if (strlen($settings->bcc_email) > 1){
if(Ninja::isHosted())
$this->bcc(reset(explode(",",str_replace(" ", "", $settings->bcc_email))));//remove whitespace if any has been inserted.
else
$this->bcc(explode(",",str_replace(" ", "", $settings->bcc_email)));//remove whitespace if any has been inserted.
}
$this->subject($this->build_email->getSubject())
->text('email.template.text', [

View File

@ -374,6 +374,9 @@ class Account extends BaseModel
public function getDailyEmailLimit()
{
if(Carbon::createFromTimestamp($this->created_at)->diffInWeeks() == 0)
return 50;
if($this->isPaid()){
$limit = $this->paid_plan_email_quota;
$limit += Carbon::createFromTimestamp($this->created_at)->diffInMonths() * 100;