From 3aa5db7198528094b7fd6bca908d17ca671afb1d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 4 Dec 2022 17:37:31 +1100 Subject: [PATCH] Fixes for the way we attach documents/pdfs to puchase orders --- app/Mail/VendorTemplateEmail.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Mail/VendorTemplateEmail.php b/app/Mail/VendorTemplateEmail.php index ccf9ef069..1ed0ca78f 100644 --- a/app/Mail/VendorTemplateEmail.php +++ b/app/Mail/VendorTemplateEmail.php @@ -141,7 +141,13 @@ class VendorTemplateEmail extends Mailable // $this->attach($file['path'], ['as' => $file['name'], 'mime' => null]); // } - $this->attachData(base64_decode($file['file']), $file['name']); + // $this->attachData(base64_decode($file['file']), $file['name']); + + if(array_key_exists('file', $file)) + $this->attachData(base64_decode($file['file']), $file['name']); + else + $this->attach($file['path'], ['as' => $file['name'], 'mime' => null]); + }