- Thu Feb 09, 2017 1:14 pm
#789023
Hi,
I want to attach generated output document to email. I used wiki code for it and put mailBody variable in html. But it didn't work. I got email but didn't find output document. What should I change in code?
Code is here.
I want to attach generated output document to email. I used wiki code for it and put mailBody variable in html. But it didn't work. I got email but didn't find output document. What should I change in code?
Code is here.
Code: Select all
thanks & Regards$docId = '954109698491477e1986b43042252891'; //set to the Output Document's unique ID
PMFGenerateOutputDocument($docId);
//find the generated Output Document in the wf_&<WORKSPACE>.APP_DOCUMENT table
$query = "SELECT MAX(DOC_VERSION) AS MAX_VERSION, APP_DOC_UID FROM APP_DOCUMENT
WHERE APP_UID = '$caseId' AND DOC_UID='$docId'";
$result = executeQuery($query);
if (is_array($result) and count($result) > 0) {
$pathFilename = PATH_DOCUMENT . G::getPathFromUID(@@APPLICATION) . PATH_SEP . 'outdocs'. PATH_SEP .
$result[1]['APP_DOC_UID'] . '_' . $result[1]['MAX_VERSION'] . '.html';
$body = file_get_contents($pathFilename);
PMFSendMessage(@@APPLICATION, 'theboss@example.com', userInfo(@@USER_LOGGED)['mail'], '', '',
'Generated Output Document', 'outDocMail.html', array('mailBody' => $body));
}