- Mon Feb 20, 2017 1:35 pm
#789247
Hello,
After final approver approved case then participated user will get email with attached output document. Email is sent with attached output document but it is ATT000001.Bin file instead of pdf file. If user download this file with pdf extension then it shows correct output document but I want this file with pdf extension. See image 3.png. I used this code
Here is my process and table schema. Downloads.zip
viewtopic.php?f=41&t=710032
Server specification
64 bit machine Windows Server 2008 R2
I have installed community edition 3.1 32 bit
I have changed in output document as well
Report Generator from HTML2PDF to TCPDF
Output Document to generate from Both to Pdf.
Thanks & Regards
After final approver approved case then participated user will get email with attached output document. Email is sent with attached output document but it is ATT000001.Bin file instead of pdf file. If user download this file with pdf extension then it shows correct output document but I want this file with pdf extension. See image 3.png. I used this code
Code: Select all
When I used same code with this process(Email_Attachment _Example-2) then it works fine i.e. in email document user got pdf file.$docId = '96578979458995b9f6afb04041036087';
$subject = @@Title;
$caseId = @@APPLICATION;
PMFGenerateOutputDocument($docId);
$sql = "SELECT 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 . $fileId . '_' . $aDocInfo['DOC_VERSION'] . $ext;
$filename = $aDocInfo['APP_DOC_FILENAME'] . $ext;
$aAttachments = array(
$filename => $pathToFile
);
$c = new Cases();
$aUsers = $c->getUsersParticipatedInCase(@@APPLICATION);
$to = '';
foreach ($aUsers['array'] as $userUID => $userInfo) {
$to .= (empty($to) ? '' : ', ') . $userInfo['USR_EMAIL'];
}
@@msg = PMFSendMessage(@@APPLICATION, 'eworkflow@sbicaps.com', $to, '', '',
$subject, 'Attachedmail.html', array(), $aAttachments);
}
Here is my process and table schema. Downloads.zip
viewtopic.php?f=41&t=710032
Server specification
64 bit machine Windows Server 2008 R2
I have installed community edition 3.1 32 bit
I have changed in output document as well
Report Generator from HTML2PDF to TCPDF
Output Document to generate from Both to Pdf.
Thanks & Regards
Attachments
(31.49 KiB) Downloaded 987 times
3.png (37.63 KiB) Viewed 36892 times