From 58f6ef532496caf2497098a9553d9847f77d6407 Mon Sep 17 00:00:00 2001
From: "madhu.sr" <madhu.sr@vtigersolutions.com>
Date: Wed, 6 Mar 2024 07:16:29 +0530
Subject: [PATCH] #Fixes::158428588::madhusr::PDF attachment is not sending
 when we click on the 'send email as attachment'

---
 modules/Emails/views/MassSaveAjax.php | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/modules/Emails/views/MassSaveAjax.php b/modules/Emails/views/MassSaveAjax.php
index f2ec042ee..db74b8a1f 100644
--- a/modules/Emails/views/MassSaveAjax.php
+++ b/modules/Emails/views/MassSaveAjax.php
@@ -196,12 +196,8 @@ class Emails_MassSaveAjax_View extends Vtiger_Footer_View {
 					 * Ex: for PDF: if filename - abc_md5(abc).pdf then raw filename - abc.pdf
 					 * For Normal documents: rawFileName is not exist in the attachments info. So it fallback to normal filename
 					 */
-					$rawFileName = $existingAttachInfo['storedname'];
+					$rawFileName = $existingAttachInfo['attachment'];
 					$file_name = $existingAttachInfo['storedname'];
-					if(!$rawFileName) {
-						$rawFileName = $existingAttachInfo['attachment'];
-						$file_name = $existingAttachInfo['attachment'];
-					}
 					$path = $existingAttachInfo['path'];
 					$fileId = $existingAttachInfo['fileid'];
 
-- 
GitLab