diff --git a/app/Jobs/Ninja/SendReminders.php b/app/Jobs/Ninja/SendReminders.php index ea01af1c2071..023869674ab8 100644 --- a/app/Jobs/Ninja/SendReminders.php +++ b/app/Jobs/Ninja/SendReminders.php @@ -16,6 +16,7 @@ use App\Events\Invoice\InvoiceWasEmailed; use App\Jobs\Entity\EmailEntity; use App\Jobs\Util\WebHookHandler; use App\Libraries\MultiDB; +use App\Models\Account; use App\Models\Invoice; use App\Models\Webhook; use App\Utils\Ninja; @@ -207,7 +208,7 @@ class SendReminders implements ShouldQueue $invoice->invitations->each(function ($invitation) use ($template, $invoice) { //only send if enable_reminder setting is toggled to yes - if ($this->checkSendSetting($invoice, $template)) { + if ($this->checkSendSetting($invoice, $template) && $invoice->company->account->hasFeature(Account::FEATURE_EMAIL_TEMPLATES_REMINDERS)) { nlog("firing email"); EmailEntity::dispatchNow($invitation, $invitation->company, $template); diff --git a/app/Utils/Traits/SavesDocuments.php b/app/Utils/Traits/SavesDocuments.php index 8ac249650b37..2451c89e6698 100644 --- a/app/Utils/Traits/SavesDocuments.php +++ b/app/Utils/Traits/SavesDocuments.php @@ -19,6 +19,7 @@ trait SavesDocuments { public function saveDocuments($document_array, $entity, $is_public = true) { + if ($entity instanceof Company) { $account = $entity->account; $company = $entity;