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.
#829557
Hello,

I am currently having trouble displaying the title of the project on the output document when receiving it as a pdf. The data also does not appear inside the pdf. I am uncertain if it's an issue with the database or if the trigger is wrong. Has anyone encountered this issue?

The trigger for sending an email with the output document

$docId = '315355263615cb11e95f7e9005773565'; //set to the Output Document's unique ID
$caseId = @@APPLICATION;
PMFGenerateOutputDocument($docId);
$sql = "SELECT DISTINCT APP_DOC_UID FROM APP_DOCUMENT WHERE APP_UID='$caseId' AND DOC_UID='$docId'";
$aNewDoc = executeQuery($sql);

if (empty($aNewDoc)) {
throw new Exception("Error: Unable to generate Output Document with ID '$docId'.");
}
else {
$fileId = $aNewDoc[1]['APP_DOC_UID'];
$oDoc = new AppDocument();
$aDocInfo = $oDoc->load($fileId);
$ext = '.pdf'; //set to '.doc' if sending a DOC file
$g = new G();
$pathToFile = PATH_DOCUMENT . $g->getPathFromUID(@@APPLICATION) . PATH_SEP . 'outdocs' .
PATH_SEP . @@Placa .
PATH_SEP . $fileId . '_' . $aDocInfo['DOC_VERSION'] . $ext;
$filename = $aDocInfo['APP_DOC_FILENAME'] . $ext;
$aAttachments = array(
$filename => $pathToFile
);

$to = ' admin@processmaker.com'

@@msg = PMFSendMessage(@@APPLICATION, ' student@gmail.com', $to, '', '',
'Testing Subject', 'email_Info.html', array(), $aAttachments);
}

Thank you
Attachments
Title does not appear.PNG
Title does not appear.PNG (4.14 KiB) Viewed 5372 times
phpMyAdmin not displaying the output document title.PNG
phpMyAdmin not displaying the output document title.PNG (26.02 KiB) Viewed 5372 times
Output Document Title.PNG
Output Document Title.PNG (26.03 KiB) Viewed 5372 times
#829558
Hello, I don't know how to help. Some how can you try to follow the ProcessMaker document in below to see if able to fix your issues. As your code is slightly different from the official doc. So worthy to try:

doc link: https://wiki.processmaker.com/3.2/ProcessMaker_Functions/Email_Functions
also see attached screenshot:

Also note that:
1/ you got $filename = $aDocInfo['APP_DOC_FILENAME'] . $ext; //.pdf only > meant $aDocInfo['APP_DOC_FILENAME'] not work
2/ Try to use the SELECT statement from the official doc or see my attached

Anyway, good luck..
Attachments
PM364_email-generated-output-doc.png
PM364_email-generated-output-doc.png (77.45 KiB) Viewed 5353 times

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]