Fax Server: Pull in language file for email template replacements.

This commit is contained in:
fusionate 2024-08-22 17:20:36 -06:00
parent 5a456b9b86
commit ac94e22a1d
No known key found for this signature in database
2 changed files with 62 additions and 7 deletions

View File

@ -5174,7 +5174,6 @@ $text['label-email_fax_file']['zh-cn'] = "传真文件";
$text['label-email_fax_file']['ja-jp'] = "ファックスファイル";
$text['label-email_fax_file']['ko-kr'] = "팩스 파일";
$text['description-email_fax_file']['en-us'] = "Select a fax file option.";
$text['description-email_fax_file']['en-gb'] = "Select a fax file option.";
$text['description-email_fax_file']['ar-eg'] = "حدد خيار ملف الفاكس.";
@ -5201,4 +5200,56 @@ $text['description-email_fax_file']['zh-cn'] = "选择传真文件选项。";
$text['description-email_fax_file']['ja-jp'] = "FAX ファイル オプションを選択します。";
$text['description-email_fax_file']['ko-kr'] = "팩스 파일 옵션을 선택하세요.";
$text['label-fax_attached']['en-us'] = "Fax Attached";
$text['label-fax_attached']['en-gb'] = "Fax Attached";
$text['label-fax_attached']['ar-eg'] = "الفاكس المرفق";
$text['label-fax_attached']['de-at'] = "Fax angehängt";
$text['label-fax_attached']['de-ch'] = "Fax angehängt";
$text['label-fax_attached']['de-de'] = "Fax angehängt";
$text['label-fax_attached']['el-gr'] = "Fax angehängt";
$text['label-fax_attached']['es-cl'] = "Fax adjunto";
$text['label-fax_attached']['es-mx'] = "Fax adjunto";
$text['label-fax_attached']['fr-ca'] = "Fax ci-joint";
$text['label-fax_attached']['fr-fr'] = "Fax ci-joint";
$text['label-fax_attached']['he-il'] = "מצורף פקס";
$text['label-fax_attached']['it-it'] = "Fax allegato";
$text['label-fax_attached']['nl-nl'] = "Fax bijgevoegd";
$text['label-fax_attached']['pl-pl'] = "Faks dołączony";
$text['label-fax_attached']['pt-br'] = "Fax anexado";
$text['label-fax_attached']['pt-pt'] = "Fax anexado";
$text['label-fax_attached']['ro-ro'] = "Fax atasat";
$text['label-fax_attached']['ru-ru'] = "Факс прилагается";
$text['label-fax_attached']['sv-se'] = "Fax bifogat";
$text['label-fax_attached']['uk-ua'] = "Факс додається";
$text['label-fax_attached']['tr-tr'] = "Faks Ekli";
$text['label-fax_attached']['zh-cn'] = "附有传真";
$text['label-fax_attached']['ja-jp'] = "FAX添付";
$text['label-fax_attached']['ko-kr'] = "팩스 첨부";
$text['label-fax_download']['en-us'] = "Download Fax";
$text['label-fax_download']['en-gb'] = "Download Fax";
$text['label-fax_download']['ar-eg'] = "تنزيل الفاكس";
$text['label-fax_download']['de-at'] = "Fax herunterladen";
$text['label-fax_download']['de-ch'] = "Fax herunterladen";
$text['label-fax_download']['de-de'] = "Fax herunterladen";
$text['label-fax_download']['el-gr'] = "Λήψη φαξ";
$text['label-fax_download']['es-cl'] = "Descargar Fax";
$text['label-fax_download']['es-mx'] = "Descargar Fax";
$text['label-fax_download']['fr-ca'] = "Télécharger le fax";
$text['label-fax_download']['fr-fr'] = "Télécharger le fax";
$text['label-fax_download']['he-il'] = "הורד פקס";
$text['label-fax_download']['it-it'] = "Scarica Fax";
$text['label-fax_download']['nl-nl'] = "Fax downloaden";
$text['label-fax_download']['pl-pl'] = "Pobierz faks";
$text['label-fax_download']['pt-br'] = "Baixar Fax";
$text['label-fax_download']['pt-pt'] = "Baixar fax";
$text['label-fax_download']['ro-ro'] = "Descărcați Fax";
$text['label-fax_download']['ru-ru'] = "Скачать факс";
$text['label-fax_download']['sv-se'] = "Ladda ner fax";
$text['label-fax_download']['uk-ua'] = "Завантажити факс";
$text['label-fax_download']['tr-tr'] = "Faks İndir";
$text['label-fax_download']['zh-cn'] = "下载传真";
$text['label-fax_download']['ja-jp'] = "ファックスをダウンロード";
$text['label-fax_download']['ko-kr'] = "팩스 다운로드";
?>

View File

@ -334,6 +334,13 @@ if (!function_exists('fax_split_dtmf')) {
//now that we have the domain_name and uuid, create a settings object for the domain
$settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid]);
//get the language code
$language_code = $settings->get('domain', 'language', 'en-us');
//add multi-lingual support
$language = new text;
$text = $language->get($language_code, 'app/fax');
//prepare smtp server settings
$email_from_address = $settings->get('fax','smtp_from', $settings->get('email', 'smtp_from', ''));
$email_from_name = $settings->get('fax', 'smtp_from_name', $settings->get('email', 'smtp_from_name', $email_from_address));
@ -441,9 +448,6 @@ if (!function_exists('fax_split_dtmf')) {
//send the email
if (!empty($fax_email) && file_exists($fax_file)) {
//get the language code
$language_code = $settings->get('domain', 'language', 'en-us');
//get the template subcategory
if (!empty($fax_relay) && $fax_relay == 'true') {
$template_subcategory = 'relay';
@ -489,10 +493,10 @@ if (!function_exists('fax_split_dtmf')) {
$email_body = str_replace('${fax_file_warning}', $fax_file_warning, $email_body);
$email_body = str_replace('${fax_subject_tag}', $fax_email_inbound_subject_tag, $email_body);
if ($fax_email_file == 'link') {
$email_body = str_replace('${fax_file_message}', "<a href='https://".$domain_name.PROJECT_PATH.'/app/fax/fax_files.php?id='.$fax_uuid.'&fax_file_uuid='.$fax_file_uuid.'&a=download_link&type=fax_inbox&box=inbox&ext='.$fax_extension.'&filename='.urlencode($fax_file_name).(!empty($pdf_file) && file_exists($pdf_file) ? '.pdf' : '.tif')."'>".($text['label-fax_download'] ?? 'Download Fax')."</a>", $email_body);
$email_body = str_replace('${fax_file_message}', "<a href='https://".$domain_name.PROJECT_PATH.'/app/fax/fax_files.php?id='.$fax_uuid.'&fax_file_uuid='.$fax_file_uuid.'&a=download_link&type=fax_inbox&box=inbox&ext='.$fax_extension.'&filename='.urlencode($fax_file_name).(!empty($pdf_file) && file_exists($pdf_file) ? '.pdf' : '.tif')."'>".$text['label-fax_download']."</a>", $email_body);
}
else {
$email_body = str_replace('${fax_file_message}', ($text['label-fax_attached'] ?? 'Fax Attached'), $email_body);
$email_body = str_replace('${fax_file_message}', $text['label-fax_attached'], $email_body);
}
//debug info