Fixes for pdf creation

This commit is contained in:
David Bomba 2021-07-07 16:55:11 +10:00
parent b15041f60b
commit b186603970
2 changed files with 4 additions and 3 deletions

View File

@ -86,7 +86,7 @@ class CreateEntityPdf implements ShouldQueue
$this->contact = $invitation->contact; $this->contact = $invitation->contact;
$this->disk = $disk; $this->disk = Ninja::isHosted() ? config('filesystems.default') : $disk;
// $this->disk = $disk ?? config('filesystems.default'); // $this->disk = $disk ?? config('filesystems.default');
} }

View File

@ -12,6 +12,7 @@
namespace App\Mail\Engine; namespace App\Mail\Engine;
use App\DataMapper\EmailTemplateDefaults; use App\DataMapper\EmailTemplateDefaults;
use App\Jobs\Entity\CreateEntityPdf;
use App\Models\Account; use App\Models\Account;
use App\Utils\HtmlEngine; use App\Utils\HtmlEngine;
use App\Utils\Ninja; use App\Utils\Ninja;
@ -111,13 +112,13 @@ class InvoiceEmailEngine extends BaseEmailEngine
if ($this->client->getSetting('pdf_email_attachment') !== false && $this->invoice->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) { if ($this->client->getSetting('pdf_email_attachment') !== false && $this->invoice->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) {
CreateEntityPdf::dispatchNow($invitation);
if(Ninja::isHosted()) if(Ninja::isHosted())
$this->setAttachments([$this->invoice->pdf_file_path($this->invitation, 'url', true)]); $this->setAttachments([$this->invoice->pdf_file_path($this->invitation, 'url', true)]);
else else
$this->setAttachments([$this->invoice->pdf_file_path($this->invitation)]); $this->setAttachments([$this->invoice->pdf_file_path($this->invitation)]);
// $this->setAttachments(['path' => $this->invoice->pdf_file_path(), 'name' => basename($this->invoice->pdf_file_path())]);
} }
//attach third party documents //attach third party documents