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\Models\Account;
use App\Utils\Helpers;
use App\Utils\Ninja;
use App\Utils\Number;
use App\Utils\Traits\MakesDates;
@ -77,7 +78,10 @@ class PaymentEmailEngine extends BaseEmailEngine
$this->payment->invoices->each(function ($invoice){
$this->setAttachments([$invoice->pdf_file_path($invoice->invitations->first())]);
if(Ninja::isHosted())
$this->setAttachments([$invoice->pdf_file_path($invoice->invitations->first(), 'url', true)]);
else
$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)){
return Storage::disk(config('filesystems.default'))->{$type}($file_path);
}
elseif(Ninja::isHosted() && $portal){
elseif(Ninja::isHosted()){
$file_path = CreateEntityPdf::dispatchNow($invitation, config('filesystems.default'));
return Storage::disk(config('filesystems.default'))->{$type}($file_path);
}