Send a link if the file is larger than 10 Megabytes

This commit is contained in:
FusionPBX
2025-07-31 13:45:06 -06:00
committed by GitHub
parent c8bafdb14b
commit cd8d4101f5

View File

@@ -455,6 +455,19 @@ if (!function_exists('fax_split_dtmf')) {
$template_subcategory = 'inbound';
}
//create a new variable for the full file path and name
if (!empty($pdf_file) && file_exists($pdf_file)) {
$attachment_file = $pdf_file;
}
else {
$attachment_file = $fax_file;
}
//send a link if the file is larger than 10 Megabytes
if (filesize($attachment_file) > 10 * 1024 * 1024) {
$fax_email_file = 'link';
}
//get the email template from the database
if (!empty($domain_uuid)) {
$sql = "select template_subject, template_body from v_email_templates ";
@@ -510,12 +523,11 @@ if (!function_exists('fax_split_dtmf')) {
$email_attachments[0]['type'] = 'file';
if (!empty($pdf_file) && file_exists($pdf_file)) {
$email_attachments[0]['name'] = $fax_file_name.'.pdf';
$email_attachments[0]['value'] = $pdf_file;
}
else {
$email_attachments[0]['name'] = $fax_file_name.'.tif';
$email_attachments[0]['value'] = $fax_file;
}
$email_attachments[0]['value'] = $attachment_file;
}
//send the email