Function GetAttachmentFiles

Function GetAttachmentFiles

Adds attachment files for an email

GetAttachmentFiles([TYPE],[CODE],[SUB_FOLDER],[SEARCH_WILDCARD],[INCLUDE_FILTER])

NOTE: This function will only pick up files from one folder, it will not recurse sub folders.

Parameters

#TypePassingDefaultNameDescription/Comments
1integerrequiredn/aTYPEFolder Type:
0The property folder
1The contact folder
2The master property folder
2stringrequiredn/aCODEThe key field to use to get the item folder which is usually a property or contact code.
The following show some examples:
PROPCODEThe property code
CLCODEThe contact code
CLCODE2The secondary contact code

NOTE:If TYPE=2 (Master Property Folder) and PROPCODE is passed then it will look for the master property i.e. PROPCODEMS of the PROPCODE

3stringoptionalnoneSUB_FOLDERAn optional sub folder name.
4stringoptional*.*SEARCH_WILDCARDA file wildcard to apply e.g. *.* or *.pdf or *.jpg or EmailAttachments*.jpg
5booleanoptionaltrueINCLUDE_FILTERWhether to include the attachment if using an additional filter (please see below).

Examples

{{GetAttachmentFiles(0,ALIAS.PROPCODE)}}
This will attach all files found in the property folder for the property code supplied.
{{GetAttachmentFiles(0,ALIAS.PROPCODE,"","Attachments*.pdf")}}
This will attach all files found in the property folder for the property code supplied where the file name starts with "Attachments" and the extension is "pdf".
{{GetAttachmentFiles(0,ALIAS.PROPCODE,"Docs","*prop*.pdf")}}
This will attach all files found in the property folder's sub-folder called "Docs" for the property code supplied where the file name contains "prop" and the extension is "pdf".
{{GetAttachmentFiles(1,ALIAS.CLCODE,"","*details.*",ALIAS.CLCLASS="T")}}
This will attach all files found in the contact folder for the contact code supplied where the file name contains "details" and can be any extension where the contact is a tenant type contact.
{{GetAttachmentFiles(1,ALIAS.CLCODE,"",Evaluate("Recharge_" + ALIAS.CLCODE + ".pdf"))}}
This will attach a file from the contact folder for the contact code supplied where the file name matches "Recharge_{{ALIAS.CLCODE}}.pdf". For example if the client code is "CLCODE_00001" then it will attach a file called "Recharge_CLCODE_00001.pdf".