From b7316255a965a83541aec3c873c524eed51e9eac Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 15 Dec 2022 08:41:06 +1100 Subject: [PATCH] Quote attachments as data --- app/Mail/Engine/QuoteEmailEngine.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/Mail/Engine/QuoteEmailEngine.php b/app/Mail/Engine/QuoteEmailEngine.php index 63271c0600ba..bf38f35b6fc3 100644 --- a/app/Mail/Engine/QuoteEmailEngine.php +++ b/app/Mail/Engine/QuoteEmailEngine.php @@ -117,11 +117,6 @@ class QuoteEmailEngine extends BaseEmailEngine ->setTextBody($text_body); if ($this->client->getSetting('pdf_email_attachment') !== false && $this->quote->company->account->hasFeature(Account::FEATURE_PDF_ATTACHMENT)) { - // if (Ninja::isHosted()) { - // $this->setAttachments([$this->quote->pdf_file_path($this->invitation, 'url', true)]); - // } else { - // $this->setAttachments([$this->quote->pdf_file_path($this->invitation)]); - // } $pdf = ((new CreateRawPdf($this->invitation, $this->invitation->company->db))->handle()); @@ -133,11 +128,11 @@ class QuoteEmailEngine extends BaseEmailEngine // Storage::url foreach ($this->quote->documents as $document) { - $this->setAttachments([['path' => $document->filePath(), 'name' => $document->name, 'mime' => NULL, ]]); + $this->setAttachments([['file' => base64_encode($document->getFile()), 'path' => $document->filePath(), 'name' => $document->name, 'mime' => NULL, ]]); } foreach ($this->quote->company->documents as $document) { - $this->setAttachments([['path' => $document->filePath(), 'name' => $document->name, 'mime' => NULL, ]]); + $this->setAttachments([['file' => base64_encode($document->getFile()), 'path' => $document->filePath(), 'name' => $document->name, 'mime' => NULL, ]]); } }