diff --git a/app/Jobs/User/UserEmailChanged.php b/app/Jobs/User/UserEmailChanged.php index 621287a492f9..de433a4c826f 100644 --- a/app/Jobs/User/UserEmailChanged.php +++ b/app/Jobs/User/UserEmailChanged.php @@ -80,9 +80,10 @@ class UserEmailChanged implements ShouldQueue NinjaMailerJob::dispatch($nmo); - $nmo->to_user = $this->new_user; - - NinjaMailerJob::dispatch($nmo); + // $nmo->to_user = $this->new_user; + // NinjaMailerJob::dispatch($nmo); + + $this->new_user->service()->invite($this->company); } diff --git a/app/Mail/Engine/CreditEmailEngine.php b/app/Mail/Engine/CreditEmailEngine.php index 835c9d47aefa..d6641ed6a83c 100644 --- a/app/Mail/Engine/CreditEmailEngine.php +++ b/app/Mail/Engine/CreditEmailEngine.php @@ -88,14 +88,14 @@ class CreditEmailEngine extends BaseEmailEngine ->setViewText(ctrans('texts.view_credit')) ->setInvitation($this->invitation); - if ($this->client->getSetting('pdf_email_attachment') !== false) { + if ($this->client->getSetting('pdf_email_attachment') !== false && $this->credit->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) { $this->setAttachments([$this->credit->pdf_file_path()]); // $this->setAttachments(['path' => $this->credit->pdf_file_path(), 'name' => basename($this->credit->pdf_file_path())]); } //attach third party documents - if($this->client->getSetting('document_email_attachment') !== false){ + if($this->client->getSetting('document_email_attachment') !== false && $this->credit->company->account->hasFeature(Account::FEATURE_DOCUMENTS)){ // Storage::url foreach($this->credit->documents as $document){ diff --git a/app/Mail/Engine/InvoiceEmailEngine.php b/app/Mail/Engine/InvoiceEmailEngine.php index 40cd3eee7211..e0907d2e7b35 100644 --- a/app/Mail/Engine/InvoiceEmailEngine.php +++ b/app/Mail/Engine/InvoiceEmailEngine.php @@ -12,6 +12,7 @@ namespace App\Mail\Engine; use App\DataMapper\EmailTemplateDefaults; +use App\Models\Account; use App\Utils\HtmlEngine; use App\Utils\Number; @@ -97,14 +98,14 @@ class InvoiceEmailEngine extends BaseEmailEngine ->setViewText(ctrans('texts.view_invoice')) ->setInvitation($this->invitation); - if ($this->client->getSetting('pdf_email_attachment') !== false) { + if ($this->client->getSetting('pdf_email_attachment') !== false && $this->invoice->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) { $this->setAttachments([$this->invoice->pdf_file_path()]); // $this->setAttachments(['path' => $this->invoice->pdf_file_path(), 'name' => basename($this->invoice->pdf_file_path())]); } //attach third party documents - if($this->client->getSetting('document_email_attachment') !== false){ + if($this->client->getSetting('document_email_attachment') !== false && $this->invoice->company->account->hasFeature(Account::FEATURE_DOCUMENTS)){ // Storage::url foreach($this->invoice->documents as $document){ diff --git a/app/Mail/Engine/QuoteEmailEngine.php b/app/Mail/Engine/QuoteEmailEngine.php index 5751cdf5acae..9d85d8b68dc3 100644 --- a/app/Mail/Engine/QuoteEmailEngine.php +++ b/app/Mail/Engine/QuoteEmailEngine.php @@ -89,14 +89,14 @@ class QuoteEmailEngine extends BaseEmailEngine ->setInvitation($this->invitation); - if ($this->client->getSetting('pdf_email_attachment') !== false) { + if ($this->client->getSetting('pdf_email_attachment') !== false && $this->quote->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) { $this->setAttachments([$this->quote->pdf_file_path()]); //$this->setAttachments(['path' => $this->quote->pdf_file_path(), 'name' => basename($this->quote->pdf_file_path())]); } //attach third party documents - if($this->client->getSetting('document_email_attachment') !== false){ + if($this->client->getSetting('document_email_attachment') !== false && $this->quote->company->account->hasFeature(Account::FEATURE_DOCUMENTS)){ // Storage::url foreach($this->quote->documents as $document){ diff --git a/app/Transformers/AccountTransformer.php b/app/Transformers/AccountTransformer.php index 742a4769576c..f8e93a45578d 100644 --- a/app/Transformers/AccountTransformer.php +++ b/app/Transformers/AccountTransformer.php @@ -78,6 +78,7 @@ class AccountTransformer extends EntityTransformer 'is_docker' => (bool) config('ninja.is_docker'), 'is_scheduler_running' => (bool) $account->is_scheduler_running, 'default_company_id' => (string) $this->encodePrimaryKey($account->default_company_id), + 'disable_auto_update' => (bool) config('ninja.disable_auto_update'), ]; } diff --git a/config/ninja.php b/config/ninja.php index b2ad25be674d..35808bb21c8f 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -143,4 +143,5 @@ return [ 'v4_migration_version' => '4.5.31', 'flutter_canvas_kit' => env('FLUTTER_CANVAS_KIT', false), 'webcron_secret' => env('WEBCRON_SECRET', false), + 'disable_auto_update' => env('DISABLE_AUTO_UPDATE', false), ];