diff --git a/app/Mail/Engine/CreditEmailEngine.php b/app/Mail/Engine/CreditEmailEngine.php index 0f2a6d2964a0..57b0ffb45c4c 100644 --- a/app/Mail/Engine/CreditEmailEngine.php +++ b/app/Mail/Engine/CreditEmailEngine.php @@ -91,6 +91,17 @@ class CreditEmailEngine extends BaseEmailEngine $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){ + + // Storage::url + foreach($this->credit->documents as $document){ + // $this->setAttachments(['path'=>$document->filePath(),'name'=>$document->name]); + $this->setAttachments([['path' => $document->filePath(), 'name' => $document->name, 'mime' => $document->type]]); + } + + } + return $this; } } diff --git a/app/Mail/Engine/QuoteEmailEngine.php b/app/Mail/Engine/QuoteEmailEngine.php index 06b9d913ca80..574ade2ea57a 100644 --- a/app/Mail/Engine/QuoteEmailEngine.php +++ b/app/Mail/Engine/QuoteEmailEngine.php @@ -93,6 +93,17 @@ class QuoteEmailEngine extends BaseEmailEngine } + //attach third party documents + if($this->client->getSetting('document_email_attachment') !== false){ + + // Storage::url + foreach($this->quote->documents as $document){ + // $this->setAttachments(['path'=>$document->filePath(),'name'=>$document->name]); + $this->setAttachments([['path' => $document->filePath(), 'name' => $document->name, 'mime' => $document->type]]); + } + + } + return $this; } }