From fb4a9bfec17c83bcb94e2e867aca325eaf052e01 Mon Sep 17 00:00:00 2001 From: Madhu S R <madhu.sr@vtigersolutions.com> Date: Mon, 22 Apr 2024 09:57:45 +0530 Subject: [PATCH] Added the storedname key value to the attachment details of the inventory modules which we use to get the filedetails when sending the mail with pdf --- modules/Emails/views/MassSaveAjax.php | 4 ---- modules/Inventory/views/SendEmail.php | 6 ++++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/Emails/views/MassSaveAjax.php b/modules/Emails/views/MassSaveAjax.php index 39fa61962..db74b8a1f 100644 --- a/modules/Emails/views/MassSaveAjax.php +++ b/modules/Emails/views/MassSaveAjax.php @@ -198,10 +198,6 @@ class Emails_MassSaveAjax_View extends Vtiger_Footer_View { */ $rawFileName = $existingAttachInfo['attachment']; $file_name = $existingAttachInfo['storedname']; - // Checking becuase the pdf sent from sales order will not have the storedname - if(!$file_name) { - $file_name = $existingAttachInfo['attachment']; - } $path = $existingAttachInfo['path']; $fileId = $existingAttachInfo['fileid']; diff --git a/modules/Inventory/views/SendEmail.php b/modules/Inventory/views/SendEmail.php index d5eaae3f3..d5cfbd4a8 100644 --- a/modules/Inventory/views/SendEmail.php +++ b/modules/Inventory/views/SendEmail.php @@ -32,8 +32,10 @@ class Inventory_SendEmail_View extends Vtiger_ComposeEmail_View { 'attachment' =>$fileName, 'path' => implode('/',$fileComponents), 'size' => filesize($pdfFileName), - 'type' => 'pdf', - 'nondeletable' => true + 'type' => 'pdf', + 'nondeletable' => true, + // The stored name is needed to send the file with the email. + 'storedname' => $fileName )); $this->populateTo($request); -- GitLab