From e257755faf6d5c0df3b768135b7ee3ef1c0747c3 Mon Sep 17 00:00:00 2001
From: yogeshwar <yogeshwar.g@vtigersolutions.com>
Date: Thu, 25 Apr 2024 17:09:51 +0530
Subject: [PATCH] Fixes #1708:email attachement is missing

---
 modules/com_vtiger_workflow/tasks/VTEmailTask.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/com_vtiger_workflow/tasks/VTEmailTask.inc b/modules/com_vtiger_workflow/tasks/VTEmailTask.inc
index 51afbd674..c5b33fb9c 100644
--- a/modules/com_vtiger_workflow/tasks/VTEmailTask.inc
+++ b/modules/com_vtiger_workflow/tasks/VTEmailTask.inc
@@ -157,7 +157,7 @@ class VTEmailTask extends VTTask{
 				//There can be multiple attachments for a single comment
 				foreach($fileDetails as $fileDetail){
 					if(!empty($fileDetail)){
-						$path = $fileDetail['path'].$fileDetail['attachmentsid'].'_'.decode_html($fileDetail['storedname']);
+						$path = $fileDetail['path'].$fileDetail['attachmentsid'].'_'.decode_html(!empty($fileDetail['storedname']) ? $fileDetail['storedname'] : $fileDetail['name']);
 						$mailerInstance->AddAttachment($path);
 					}
 				}
-- 
GitLab