Minor fixes for paths in hosted

This commit is contained in:
David Bomba 2021-06-17 11:22:11 +10:00
parent 119b07fe03
commit 183e8ac36f
2 changed files with 6 additions and 2 deletions

View File

@ -14,6 +14,7 @@ namespace App\Mail\Engine;
use App\DataMapper\EmailTemplateDefaults; use App\DataMapper\EmailTemplateDefaults;
use App\Models\Account; use App\Models\Account;
use App\Utils\Helpers; use App\Utils\Helpers;
use App\Utils\Ninja;
use App\Utils\Number; use App\Utils\Number;
use App\Utils\Traits\MakesDates; use App\Utils\Traits\MakesDates;
@ -77,6 +78,9 @@ class PaymentEmailEngine extends BaseEmailEngine
$this->payment->invoices->each(function ($invoice){ $this->payment->invoices->each(function ($invoice){
if(Ninja::isHosted())
$this->setAttachments([$invoice->pdf_file_path($invoice->invitations->first(), 'url', true)]);
else
$this->setAttachments([$invoice->pdf_file_path($invoice->invitations->first())]); $this->setAttachments([$invoice->pdf_file_path($invoice->invitations->first())]);
}); });

View File

@ -414,7 +414,7 @@ class Invoice extends BaseModel
if(Ninja::isHosted() && $portal && Storage::disk(config('filesystems.default'))->exists($file_path)){ if(Ninja::isHosted() && $portal && Storage::disk(config('filesystems.default'))->exists($file_path)){
return Storage::disk(config('filesystems.default'))->{$type}($file_path); return Storage::disk(config('filesystems.default'))->{$type}($file_path);
} }
elseif(Ninja::isHosted() && $portal){ elseif(Ninja::isHosted()){
$file_path = CreateEntityPdf::dispatchNow($invitation, config('filesystems.default')); $file_path = CreateEntityPdf::dispatchNow($invitation, config('filesystems.default'));
return Storage::disk(config('filesystems.default'))->{$type}($file_path); return Storage::disk(config('filesystems.default'))->{$type}($file_path);
} }