Hi joni.campos
You can use the below query to get the folder structure of a file store in attachment attribute. And then we can create the full path where it is stored.
select
cdfd.PATH_NAME,
mig.data_to_b_imp folder_id
,mig.code folder_code
,mig.name folder_name
,cast(flv.id as VARCHAR(30)) file_version_id
,substring(cast(flv.id as VARCHAR(30)),2,3) path_one
,'00'+ substring(cast(flv.id as VARCHAR(30)),1,1) path_two
,fl.name file_name
,fl.mime_type
from
<table_name> mig --table where attachment attribute is created
left outer join CLB_DMS_FILES FL on FL.PARENT_FOLDER_ID = mig.data_to_b_imp
left outer join CLB_DMS_VERSIONS FLV on FLV.FILE_ID = FL.ID
left outer join CLB_DMS_FOLDERS CDFD on (FL.PARENT_FOLDER_ID = CDFD.id)
where
mig.code = 'riskmigration' --code
<!-- Set the Folder Path for File -->
<core:set value="\" var="FS"/>
--Create path where file is stored.
<core:set value="${FinLoadDtlRow.path_one}" var="path1"/>
<core:set value="${FinLoadDtlRow.path_two}" var="path2"/>
<core:set value="${FinLoadDtlRow.file_name}" var="thisDocumentName"/>
<core:set value="${FinLoadDtlRow.file_version_id}" var="thisDocumentId"/>
<core:set value="${thisClarityConfig.getProperties().getSearchServer().getFilestoreDir()}" var="Filese"/>
<core:set var="thisDocumentRoot">${Filese}${FS}clarity${FS}Files${FS}${path1}${FS}${path2}</core:set>
<core:set var="FullFilePath">${thisDocumentRoot}${FS}${thisDocumentId}</core:set>
From the above we can use the ${FullFilePath} variable to pass in the <email:email> tag.
<email:email to="user@example.com"
from="username@mailserver.com"
subject="File Attached."
server="${mailServer}"
attach="">
File Attached.
</email:email>
Hopefully this can help you to achieve your requirement.