Skip to content
Snippets Groups Projects
Commit bd6cce8a authored by Uma's avatar Uma
Browse files

Fixes #1209 File attachments in mail

parent db12aae4
No related branches found
No related tags found
1 merge request!490Fixes #1209 File attachments in mail
......@@ -180,9 +180,9 @@ class Emails_Record_Model extends Vtiger_Record_Model {
//Adding attachments to mail
if(is_array($attachments)) {
foreach($attachments as $attachment) {
$fileNameWithPath = $rootDirectory.$attachment['path'].$attachment['fileid']."_".$attachment['attachment'];
$fileNameWithPath = $rootDirectory.$attachment['path'].$attachment['fileid']."_".$attachment['storedname'];
if(is_file($fileNameWithPath)) {
$mailer->AddAttachment($fileNameWithPath, $attachment['attachment']);
$mailer->AddAttachment($fileNameWithPath, $attachment['storedname']);
}
}
}
......@@ -277,9 +277,10 @@ class Emails_Record_Model extends Vtiger_Record_Model {
for($i=0; $i<$numOfRows; $i++) {
$attachmentsList[$i]['fileid'] = $db->query_result($attachmentRes, $i, 'attachmentsid');
$attachmentsList[$i]['attachment'] = decode_html($db->query_result($attachmentRes, $i, 'name'));
$attachmentsList[$i]['storedname'] = decode_html($db->query_result($attachmentRes, $i, 'storedname'));
$path = $db->query_result($attachmentRes, $i, 'path');
$attachmentsList[$i]['path'] = $path;
$attachmentsList[$i]['size'] = filesize($path.$attachmentsList[$i]['fileid'].'_'.$attachmentsList[$i]['attachment']);
$attachmentsList[$i]['size'] = filesize($path.$attachmentsList[$i]['fileid'].'_'.$attachmentsList[$i]['storedname']);
$attachmentsList[$i]['type'] = $db->query_result($attachmentRes, $i, 'type');
$attachmentsList[$i]['cid'] = $db->query_result($attachmentRes, $i, 'cid');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment