Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#815064
Hi

I got the following code to email the output document, but how do I attach the document name (CON_VALUE in "content" table) instead of attaching the 32 digit filename? Thanks
Code: Select all
if(@@approveInformation=='Approved'){

//Generate Letter
$outDocId = '6752319335b430af9290e98068848446';
PMFGenerateOutputDocument($outDocId);
$sqlScarta = "SELECT AD.APP_DOC_UID, C.CON_VALUE, AD.DOC_VERSION
FROM APP_DOCUMENT AD, CONTENT C 
WHERE AD.APP_UID = '".@@APPLICATION."' 
AND AD.DOC_UID = '".$outDocId."' 
AND AD.APP_DOC_UID = C.CON_ID 
AND C.CON_CATEGORY = 'APP_DOC_FILENAME' 
AND AD.DOC_VERSION = C.CON_PARENT
ORDER BY AD.DOC_VERSION DESC";
$result = executeQuery($sqlScarta);
$docId = $result[1]['APP_DOC_UID'];
$docVr = $result[1]['DOC_VERSION'];

//Split @@APPLICATION into 3 subdirectories to avoid the 32K file limits of Linux's ext3 file system e.g. /423/168/267/55cbb5e0751cd5037067960/ if the application id = 42316826755cbb5e0751cd5037067960
$dir1 = substr(@@APPLICATION, 0, 3);
$dir2 = substr(@@APPLICATION, 3, 3);
$dir3 = substr(@@APPLICATION, 6, 3);
$dir4 = substr(@@APPLICATION, 9, 23);
	
//Path to the PDF document
$Letter = PATH_DOCUMENT . $dir1."/".$dir2."/".$dir3."/".$dir4."/outdocs/". $docId . "_" . $docVr . ".pdf";

//Path to other attachments
$companyDetails = PATH_DATA_PUBLIC . @@PROCESS . PATH_SEP . 'something.pdf';
$capabilityStatement = PATH_DATA_PUBLIC . @@PROCESS . PATH_SEP . 'another.pdf';

//Array all the attachments
$aAttachFiles = array(
  $Letter,
  $companyDetails,
  $capabilityStatement
  );
  
  
//Send email to employee
$from = "accounts@freogroup.com.au";
$to = @@companyEmail;
$subject = "APPLICATION FOR A CREDIT ACCOUNT";
PMFSendMessage(@@APPLICATION, $from, $to, ' ', ' ', $subject, 'approved.html', array(), $aAttachFiles);

}

Hello. For rental housing, there are software solu[…]

Experience heightened pleasure with Cenforce 100 M[…]

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]