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,9 +88,15 @@ class TemplateEmail extends Mailable
$this->from(config('mail.from.address'), $email_from_name); $this->from(config('mail.from.address'), $email_from_name);
if (strlen($settings->bcc_email) > 1) 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->bcc(explode(",",str_replace(" ", "", $settings->bcc_email)));//remove whitespace if any has been inserted.
}
$this->subject($this->build_email->getSubject()) $this->subject($this->build_email->getSubject())
->text('email.template.text', [ ->text('email.template.text', [
'text_body' => $this->build_email->getTextBody(), 'text_body' => $this->build_email->getTextBody(),

View File

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