Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By cosyxu
#812629
Good morning,

I am using web entry form and ABE function for my process.

Since the ABE doesn't support to send attachments within one email, so I have to send another email with the attachments, please find the following code for sending the attachments.
Code: Select all
$caseID = @@APPLICATION;
$queryAttachment = "SELECT APP_DOC_UID, DOC_VERSION FROM APP_DOCUMENT where APP_UID='$caseID'";

$aFiles = executeQuery($queryAttachment);
if (is_array($aFiles) and count($aFiles) > 0) {
   $aAttached = array();

   foreach ($aFiles as $aFile) {
      $d = new AppDocument();
      $aDoc = $d->Load($aFile['APP_DOC_UID'], $aFile['DOC_VERSION']);
      $filename = $aDoc['APP_DOC_FILENAME'];
      $ext = pathinfo($filename, PATHINFO_EXTENSION);
      $g = new G();
      $filePath = PATH_DOCUMENT . $g->getPathFromUID($caseID) . PATH_SEP .
      $aFile['APP_DOC_UID'] .'_'. $aFile['DOC_VERSION'] .'.'. $ext;
	  
      $aAttached = PMFAddAttachmentToArray($aAttached, $filename, $filePath);
   }
   PMFSendMessage($caseID, 'forms@gmail.com', @=test, '', '',
      'Attachments', 'EmailNoticeForAttachment.html', array(), $aAttached);
}
So how could I get the URL of the files? Because I think maybe it is possible to add these URLs into the ABE email, therefore I don't need to send another email with the attachments. Is this possible??

Many thanks,
Y
User avatar
By amosbatto
#812630
You can use code like this:
Code: Select all
   if ($aFile['APP_DOC_TYPE'] == 'OUTPUT') {
      //you can look up the type of document (PDF or DOC) in the OUTPUT_DOCUMENT.OUT_DOC_GENERATE field
      //assume that generating PDF:
      @@fileUrl = "http://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}/sys" . @@SYS_SYS .
         "/neoclassic/en/cases/cases_ShowOutputDocument?a={$aFile['APP_DOC_UID']}&v={$aFile['DOC_VERSION']}&ext=pdf";
   }
   else { //if Input Document or attached file:
      @@fileUrl = "http://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}/sys" . @@SYS_SYS .
      "/neoclassic/en/cases/cases_ShowDocument?a={$aFile['APP_DOC_UID']}&v={$aFile['DOC_VERSION']}";
   } 
If you will have a variable number of files, then you can place the links in a single variable, separated by <br> (line breaks) and then place that variable in your email template file. The other way to do it is to put the links in a grid and put the grid in your template.
By cosyxu
#812633
amosbatto wrote:You can use code like this:
Code: Select all
   if ($aFile['APP_DOC_TYPE'] == 'OUTPUT') {
      //you can look up the type of document (PDF or DOC) in the OUTPUT_DOCUMENT.OUT_DOC_GENERATE field
      //assume that generating PDF:
      @@fileUrl = "http://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}/sys" . @@SYS_SYS .
         "/neoclassic/en/cases/cases_ShowOutputDocument?a={$aFile['APP_DOC_UID']}&v={$aFile['DOC_VERSION']}&ext=pdf";
   }
   else { //if Input Document or attached file:
      @@fileUrl = "http://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}/sys" . @@SYS_SYS .
      "/neoclassic/en/cases/cases_ShowDocument?a={$aFile['APP_DOC_UID']}&v={$aFile['DOC_VERSION']}";
   }
If you will have a variable number of files, then you can place the links in a single variable, separated by <br> (line breaks) and then place that variable in your email template file. The other way to do it is to put the links in a grid and put the grid in your template.

Hi Amosbatto,

Thank you for reply.

Yes it works.
Code: Select all
$appUid = @@APPLICATION;

$query = "SELECT D.*, C.CON_VALUE 
        FROM CONTENT C, APP_DOCUMENT D 
        WHERE D.APP_DOC_UID = C.CON_ID
         AND D.APP_UID = '".$appUid."'
        AND C.CON_CATEGORY =  'APP_DOC_FILENAME'
        AND C.CON_LANG = '".@@SYS_LANG."'";

$result = executeQuery($query);
$dataGrid = array();
$i = 1;
foreach ($result as $row) {
   $ext = explode('.',$row['CON_VALUE']);
   
   $server = (G::is_https() ? 'https://':'http://') . $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'];
   
   $inputDocPath = $server . PATH_SEP . 'sys' . @@SYS_SYS . PATH_SEP . @@SYS_LANG . PATH_SEP . @@SYS_SKIN . PATH_SEP . 'cases' . PATH_SEP. 'cases_ShowDocument?a='. $row['APP_DOC_UID'];
   
   $aUser = userInfo($row['USR_UID']);
    $uploader = $aUser['firstname'] .' '. $aUser['lastname'] .' ('.
       $aUser['username'] . ')';

   $dataGrid[$i] = array(
      'fileName' => $row['CON_VALUE'],
      'fileLink' => $inputDocPath,
      'uploader' => $uploader,
      'date'     => $row['APP_DOC_CREATE_DATE'],
   );
   $i++;
}

if (is_array($dataGrid) && count($dataGrid) > 0) {
   @=FilesList = $dataGrid;
}
By putting this trigger before ABE, I can display the links of attachments in ABE email now.

Thanks,
Yuan
By cosyxu
#812634
However I was wondering is there any ways that we could do to update the uploaded files? (Delete uploaded field or update uploaded file).

For example, if the next user need to update or replace the existing file, is it possible to do that? Or workarounds?

Thanks,
Yuan
User avatar
By amosbatto
#812636
This code will only work correctly on a Linux server:
Code: Select all
$inputDocPath = $server . PATH_SEP . 'sys' . @@SYS_SYS . PATH_SEP . @@SYS_LANG . PATH_SEP . @@SYS_SKIN . PATH_SEP . 'cases' . PATH_SEP. 'cases_ShowDocument?a='. $row['APP_DOC_UID'];
You should use this code if you might one day use it on a Windows server:
Code: Select all
$inputDocPath = $server . '/sys' . @@SYS_SYS . '/' . @@SYS_LANG . '/' . @@SYS_SKIN . '/cases/cases_ShowDocument?a='. $row['APP_DOC_UID'];
By cosyxu
#812646
amosbatto wrote:This code will only work correctly on a Linux server:
Code: Select all
$inputDocPath = $server . PATH_SEP . 'sys' . @@SYS_SYS . PATH_SEP . @@SYS_LANG . PATH_SEP . @@SYS_SKIN . PATH_SEP . 'cases' . PATH_SEP. 'cases_ShowDocument?a='. $row['APP_DOC_UID'];
You should use this code if you might one day use it on a Windows server:
Code: Select all
$inputDocPath = $server . '/sys' . @@SYS_SYS . '/' . @@SYS_LANG . '/' . @@SYS_SKIN . '/cases/cases_ShowDocument?a='. $row['APP_DOC_UID'];
Doesn't this is to show the links of the document?

Sorry I feel a little bit confused.

I was wondering when it comes to the links being duplicated(one new file, one old file), how can I either disable the old versioning or grab the latest version of the file in the trigger and shown as link, that way only one link will be displayed.

Thanks,
Yuan
By cosyxu
#812703
Hi Amosbatto,

I was wondering if I save a word document called "test.doc"under the "Public files", am I able to use the above trigger the find the link of this file and show in the email template?

Thanks,
Yuan
User avatar
By amosbatto
#812705
cosyxu wrote:
amosbatto wrote:This code will only work correctly on a Linux server:
Code: Select all
$inputDocPath = $server . PATH_SEP . 'sys' . @@SYS_SYS . PATH_SEP . @@SYS_LANG . PATH_SEP . @@SYS_SKIN . PATH_SEP . 'cases' . PATH_SEP. 'cases_ShowDocument?a='. $row['APP_DOC_UID'];
You should use this code if you might one day use it on a Windows server:
Code: Select all
$inputDocPath = $server . '/sys' . @@SYS_SYS . '/' . @@SYS_LANG . '/' . @@SYS_SKIN . '/cases/cases_ShowDocument?a='. $row['APP_DOC_UID'];
Doesn't this is to show the links of the document?
Yes, this is to generate a web address. PATH_SEP is for generating file paths on the ProcessMaker server, so it is "/" on a Linux server and "\" on a Windows server. If you want to generate a web address, you should always use "/", not PATH_SEP.
cosyxu wrote: I was wondering when it comes to the links being duplicated(one new file, one old file), how can I either disable the old versioning or grab the latest version of the file in the trigger and shown as link, that way only one link will be displayed.

This path:
$inputDocPath = $server . '/sys' . @@SYS_SYS . '/' . @@SYS_LANG . '/' . @@SYS_SKIN . '/cases/cases_ShowDocument?a='. $row['APP_DOC_UID'];
Will always return the latest valid version of a file. If you want specify a particular version of the file, then you can use this code:
$inputDocPath = $server . '/sys' . @@SYS_SYS . '/' . @@SYS_LANG . '/' . @@SYS_SKIN . '/cases/cases_ShowDocument?a='. $row['APP_DOC_UID'] . '&v=' . $row['DOC_VERSION'];
By cosyxu
#812706
amosbatto wrote:
cosyxu wrote:
amosbatto wrote:This code will only work correctly on a Linux server:
Code: Select all
$inputDocPath = $server . PATH_SEP . 'sys' . @@SYS_SYS . PATH_SEP . @@SYS_LANG . PATH_SEP . @@SYS_SKIN . PATH_SEP . 'cases' . PATH_SEP. 'cases_ShowDocument?a='. $row['APP_DOC_UID'];
You should use this code if you might one day use it on a Windows server:
Code: Select all
$inputDocPath = $server . '/sys' . @@SYS_SYS . '/' . @@SYS_LANG . '/' . @@SYS_SKIN . '/cases/cases_ShowDocument?a='. $row['APP_DOC_UID'];
Doesn't this is to show the links of the document?
Yes, this is to generate a web address. PATH_SEP is for generating file paths on the ProcessMaker server, so it is "/" on a Linux server and "\" on a Windows server. If you want to generate a web address, you should always use "/", not PATH_SEP.
cosyxu wrote: I was wondering when it comes to the links being duplicated(one new file, one old file), how can I either disable the old versioning or grab the latest version of the file in the trigger and shown as link, that way only one link will be displayed.

This path:
$inputDocPath = $server . '/sys' . @@SYS_SYS . '/' . @@SYS_LANG . '/' . @@SYS_SKIN . '/cases/cases_ShowDocument?a='. $row['APP_DOC_UID'];
Will always return the latest valid version of a file. If you want specify a particular version of the file, then you can use this code:
$inputDocPath = $server . '/sys' . @@SYS_SYS . '/' . @@SYS_LANG . '/' . @@SYS_SKIN . '/cases/cases_ShowDocument?a='. $row['APP_DOC_UID'] . '&v=' . $row['DOC_VERSION'];
Thanks Amo
By cosyxu
#812707
cosyxu wrote:Hi Amosbatto,

I was wondering if I save a word document called "test.doc"under the "Public files", am I able to use the above trigger the find the link of this file and show in the email template?

Thanks,
Yuan
I just released I don't need to generate the link, I could use "http://localhost/Files/test.doc" , because this file is under the public files.
By cosyxu
#812712
Hi Amo,

I was reading another thread, and I thought may be I could use the following code to delete upload files so the requester could re-upload new files.

//both remove the record for the file from APP_DOCUMENT table and delete the file from the server

$caseId = @@APPLICATION;
$query = "SELECT * FROM APP_DOCUMENT WHERE APP_UID='$caseId' AND APP_DOC_FIELDNAME='c_InstallerInvoice'";
$aDocs = executeQuery($query);
if (!is_array($aDocs)) {
throw new Exception("Error in query: $query");
}

$d = new AppDocument();

foreach ($aDocs as $aDoc) {
$aFileInfo = $d->Load($aDoc['APP_DOC_UID'], $aDoc['DOC_VERSION']);
//If Output Document file:
if ($aFileInfo['APP_DOC_TYPE'] == 'OUTPUT') {
$path = PATH_DOCUMENT . G::getPathFromUID($caseId) . PATH_SEP .'outdocs'. PATH_SEP .
$aDoc['APP_DOC_UID'] . '_' . $aDoc['DOC_VERSION'];
if (file_exists($path . '.doc'))
unlink($path . '.doc');
if (file_exists($path . '.pdf'))
unlink($path . '.pdf');
}
else { //if Input Document or attached file:
$ext = pathinfo($aFileInfo['APP_DOC_FILENAME'], PATHINFO_EXTENSION);
$path = PATH_DOCUMENT . G::getPathFromUID($caseId) . PATH_SEP .
$aDoc['APP_DOC_UID'] . '_' . $aDoc['DOC_VERSION'] . '.' .$ext;
unlink($path);
}
$query = "DELETE FROM APP_DOCUMENT WHERE APP_UID='$caseId' AND APP_DOC_FIELDNAME='c_InstallerInvoice'";
executeQuery($query);
}



//If you just want to mark a file as deleted in the database, you can use this line:
$aFileInfo = $d->Remove($aDoc['APP_DOC_UID'], $aDoc['DOC_VERSION']);
Was this possible?

Thanks,
Yuan
By cosyxu
#812978
Hi Amo,

I am using the above method to get link of the attachments.
Code: Select all
$appUid = @@APPLICATION;

$query = "SELECT D.*, C.CON_VALUE 
        FROM CONTENT C, APP_DOCUMENT D 
        WHERE D.APP_DOC_UID = C.CON_ID
         AND D.APP_UID = '".$appUid."'
        AND C.CON_CATEGORY =  'APP_DOC_FILENAME'
        AND C.CON_LANG = '".@@SYS_LANG."'";

$result = executeQuery($query);
$dataGrid = array();
$i = 1;
foreach ($result as $row) {
   $ext = explode('.',$row['CON_VALUE']);
   
   $server = (G::is_https() ? 'https://':'http://') . $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'];
   
   $inputDocPath = $server . PATH_SEP . 'sys' . @@SYS_SYS . PATH_SEP . @@SYS_LANG . PATH_SEP . @@SYS_SKIN . PATH_SEP . 'cases' . PATH_SEP. 'cases_ShowDocument?a='. $row['APP_DOC_UID'];
   
   $aUser = userInfo($row['USR_UID']);
    $uploader = $aUser['firstname'] .' '. $aUser['lastname'] .' ('.
       $aUser['username'] . ')';

   $dataGrid[$i] = array(
      'fileName' => $row['CON_VALUE'],
      'fileLink' => $inputDocPath,
      'uploader' => $uploader,
      'date'     => $row['APP_DOC_CREATE_DATE'],
   );
   $i++;
}

if (is_array($dataGrid) && count($dataGrid) > 0) {
   @=FilesList = $dataGrid;
}
This works perfect after a web-entry form. But when I removed the upload file control in the web-entry form and add it after the ABE(Link to fill a form) task, I can't get the link of the attachments, any ideas why this happened?

Thanks,
Yuan
Attachments
2018-01-29_12-24-23.png
2018-01-29_12-24-23.png (6.41 KiB) Viewed 14016 times
By cosyxu
#812980
For example, if I have some tasks(ABE-link to fill a form) in the middle of the process, can I still use the above trigger to get the link of the attachments?

Thanks,
Yuan
User avatar
By amosbatto
#812981
The trigger cannot be fired immediately after the Dynaform containing a File control, because the record will not yet be added to the APP_DOCUMENT table. You have to move it to before the next step in the task or before assignment.
To debug what is happening, use this code:
Code: Select all
$appUid = @@APPLICATION;
$query = "SELECT * FROM APP_DOCUMENT WHERE APP_UID='$appUid'";
$result = executeQuery($query);
print "<pre>";
var_dump($result);
die;  
If you don't see the file in the APP_DOCUMENT table, then the file is not being correctly saved.
By cosyxu
#812983
amosbatto wrote:The trigger cannot be fired immediately after the Dynaform containing a File control, because the record will not yet be added to the APP_DOCUMENT table. You have to move it to before the next step in the task or before assignment.
To debug what is happening, use this code:
Code: Select all
$appUid = @@APPLICATION;
$query = "SELECT * FROM APP_DOCUMENT WHERE APP_UID='$appUid'";
$result = executeQuery($query);
print "<pre>";
var_dump($result);
die; 
If you don't see the file in the APP_DOCUMENT table, then the file is not being correctly saved.

Thanks for your feedback amo,

Since we have found the issue, please have a look at my process, where should I move my trigger to make sure the intermediate email event can have the links of attachments from the ABE(link to fill a form)?

Thanks,
Yuan
Attachments
2018-01-29_16-16-28.png
2018-01-29_16-16-28.png (86.45 KiB) Viewed 13989 times
User avatar
By amosbatto
#812984
Where you currently have your trigger in the script task should work if the ABE is in the previous task. At that point record(s) for the uploaded file(s) from the ABE form should be in the APP_DOCUMENT table. Are you seeing any problems when the trigger is there?
By cosyxu
#812985
amosbatto wrote:Where you currently have your trigger in the script task should work if the ABE is in the previous task. At that point record(s) for the uploaded file(s) from the ABE form should be in the APP_DOCUMENT table. Are you seeing any problems when the trigger is there?
Everything goes well, but in my trigger I have this:
Code: Select all
if (is_array($dataGrid) && count($dataGrid) > 0) {
   @=FilesList = $dataGrid;
}

@@Attachment_Table = '
   <table style="border-collapse: collapse; border-spacing: 0px; border-color: #999999; border-style: solid; width: 100%;">
      <tbody>
         <tr>  
            <th style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: bold; padding: 10px 5px; border-style: solid; border-width: 0px; overflow: hidden; word-break: normal; border-color: #999; color: #fff; background-color: #1596ca; text-align: center;">File Name</th>
            <th style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; font-weight: bold; padding: 10px 5px; border-style: solid; border-width: 0px; overflow: hidden; word-break: normal; border-color: #999; color: #fff; background-color: #1596ca; text-align: center;">File Link</th>
         </tr>';

   foreach ( @=FilesList as $aRow) {
      
         @@Attachment_Table .= '<tr>
            <td style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; padding: 10px 5px; border-style: solid; border-width: 0px; overflow: hidden; word-break: normal; border-color: #999; color: #444; background-color: #f7fdfa; text-align: center;">'.$aRow['fileName'].'</td>
            <td style="font-family: Helvetica, Arial, sans-serif; font-size: 16px; padding: 10px 5px; border-style: solid; border-width: 0px; overflow: hidden; word-break: normal; border-color: #999; color: #444; background-color: #f7fdfa; text-align: center;"><a href="'.$aRow['fileLink'].'">Download File</a></td>
            </tr>';
      
   }

@@Attachment_Table .= '</tbody></table>';  
And then the @@attachment_table I got is empty for the second row in the intermediate email event like this:
File Name File Link

where there should be file name and link.

Regards
Yuan
By cosyxu
#812986
As you can see I have a trigger after the web-entry form,

it contains:
Code: Select all
$msSQL = "11232323232328013231332323268"; //external db
$query = "SELECT email FROM table'";

$res = executeQuery($query, $msSQL);
if (isset($res)) {
	@@emailAddressForReview = $res[1]['venue_email'];
}
Do I have to use executeQuery($query, $msSQL) to point to the specific DB each time? Maybe this is the reason that I got empty attachment?

All the attachments have been store properly as I can see them in the documents.

Thanks,
Yuan
By cosyxu
#812990
amosbatto wrote:Get rid of the single quotation mark in your query. Change from:
$query = "SELECT email FROM table'";
To:
$query = "SELECT email FROM table";

Sorry that's my typing error.

I still got empty link and name.... any workarounds?
By cosyxu
#813001
amosbatto wrote:Where you currently have your trigger in the script task should work if the ABE is in the previous task. At that point record(s) for the uploaded file(s) from the ABE form should be in the APP_DOCUMENT table. Are you seeing any problems when the trigger is there?
Good morning Amo,

It seems that I have found the issue, please find the attached image for my process.

The Venue Review Task(ABE) is where the file control in a grid, after that, it goes to a empty User Task instead of the Script Task, then I set the trigger run before the User task in "Steps", and finally I could get the link of attachment in the intermediate email event.

It works, that's good, but I have to login PM to click "continue" for User Task, is there any workaround to get this work? For example, change the user task to be a empty task for setting the trigger but when the workflow goes there, I don't need to provide any responds because it should goes to the email events itself.

Thanks,
Yuan
Attachments
2018-01-31_10-53-33.png
2018-01-31_10-53-33.png (78.81 KiB) Viewed 13965 times
By cosyxu
#813015
amosbatto wrote:If the purpose of "User task" is just to send an email, you could change it to a script task and use PMFSendMessage() to send out the email in the trigger.
Hi Amo,

I have tried the following code for send emails, but it didn't work. Please have a look my code. This script task is after the ABE Task.
Code: Select all
$caseID = @@APPLICATION;
$queryAttachment = "SELECT APP_DOC_UID, DOC_VERSION FROM APP_DOCUMENT where APP_UID='$caseID'";

$aFiles = executeQuery($queryAttachment);
if (is_array($aFiles) and count($aFiles) > 0) {
   $aAttached = array();

   foreach ($aFiles as $aFile) {
      $d = new AppDocument();
      $aDoc = $d->Load($aFile['APP_DOC_UID'], $aFile['DOC_VERSION']);
      $filename = $aDoc['APP_DOC_FILENAME'];
      $ext = pathinfo($filename, PATHINFO_EXTENSION);
      $g = new G();
      $filePath = PATH_DOCUMENT . $g->getPathFromUID($caseID) . PATH_SEP .
      $aFile['APP_DOC_UID'] .'_'. $aFile['DOC_VERSION'] .'.'. $ext;
     
      $aAttached = PMFAddAttachmentToArray($aAttached, $filename, $filePath);
   }
   PMFSendMessage($caseID, 'forms@gmail.com', @=test, '', '',
      'Attachments', 'EmailNoticeForAttachment.html', array(), $aAttached);
}
Thanks,
Yuan
User avatar
By amosbatto
#813016
Is forms@gmail.com the same email address as you have configured under Admin > Email Settings ?
If not, Gmail, Yahoo mail and many other email providers won't send the email.

Check whether the email was created in the APP_MESSAGES table in the database.
You can debug by using die() statements like:
Code: Select all
$caseID = @@APPLICATION;
$queryAttachment = "SELECT APP_DOC_UID, DOC_VERSION FROM APP_DOCUMENT WHERE APP_UID='$caseID'";
$aFiles = executeQuery($queryAttachment);

if (!is_array($aFiles) or count($aFiles) == 0) {
  die("Unable to find any files for this case in the APP_DOCUMENT table.");
}
else {
   $aAttached = array();

   foreach ($aFiles as $aFile) {
      $d = new AppDocument();
      $aDoc = $d->Load($aFile['APP_DOC_UID'], $aFile['DOC_VERSION']);
      $filename = $aDoc['APP_DOC_FILENAME'];
      $ext = pathinfo($filename, PATHINFO_EXTENSION);
      $g = new G();
      $filePath = PATH_DOCUMENT . $g->getPathFromUID($caseID) . PATH_SEP .
          $aFile['APP_DOC_UID'] .'_'. $aFile['DOC_VERSION'] .'.'. $ext;
     
      $aAttached = PMFAddAttachmentToArray($aAttached, $filename, $filePath);
   }
   PMFSendMessage($caseID, 'forms@gmail.com', @=test, '', '',
      'Attachments', 'EmailNoticeForAttachment.html', array(), $aAttached);
}
By cosyxu
#813026
amosbatto wrote:Is forms@gmail.com the same email address as you have configured under Admin > Email Settings ?
If not, Gmail, Yahoo mail and many other email providers won't send the email.

Check whether the email was created in the APP_MESSAGES table in the database.
You can debug by using die() statements like:
Code: Select all
$caseID = @@APPLICATION;
$queryAttachment = "SELECT APP_DOC_UID, DOC_VERSION FROM APP_DOCUMENT WHERE APP_UID='$caseID'";
$aFiles = executeQuery($queryAttachment);

if (!is_array($aFiles) or count($aFiles) == 0) {
  die("Unable to find any files for this case in the APP_DOCUMENT table.");
}
else {
   $aAttached = array();

   foreach ($aFiles as $aFile) {
      $d = new AppDocument();
      $aDoc = $d->Load($aFile['APP_DOC_UID'], $aFile['DOC_VERSION']);
      $filename = $aDoc['APP_DOC_FILENAME'];
      $ext = pathinfo($filename, PATHINFO_EXTENSION);
      $g = new G();
      $filePath = PATH_DOCUMENT . $g->getPathFromUID($caseID) . PATH_SEP .
          $aFile['APP_DOC_UID'] .'_'. $aFile['DOC_VERSION'] .'.'. $ext;
     
      $aAttached = PMFAddAttachmentToArray($aAttached, $filename, $filePath);
   }
   PMFSendMessage($caseID, 'forms@gmail.com', @=test, '', '',
      'Attachments', 'EmailNoticeForAttachment.html', array(), $aAttached);
}
 
Thanks Amo,

I think the both the code and email config are correct, but because this script task is after the ABE directly, so it won't work.

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[…]

Betvisa clone scripts are pre-built software solut[…]