mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-05 19:23:49 +00:00
Voicemail: Email notification script updated to support multiple languages.
This commit is contained in:
19
resources/install/scripts/app/voicemail/app_languages.lua
Normal file
19
resources/install/scripts/app/voicemail/app_languages.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
text = {};
|
||||
|
||||
text['label-download'] = {};
|
||||
text['label-download']['en-us'] = "Download";
|
||||
text['label-download']['es-cl'] = "Descargar";
|
||||
text['label-download']['pt-pt'] = "Baixar";
|
||||
text['label-download']['fr-fr'] = "Télécharger";
|
||||
|
||||
text['label-listen'] = {};
|
||||
text['label-listen']['en-us'] = "Listen";
|
||||
text['label-listen']['es-cl'] = "Escuchar";
|
||||
text['label-listen']['pt-pt'] = "Ouvir";
|
||||
text['label-listen']['fr-fr'] = "écouter";
|
||||
|
||||
text['label-attached'] = {};
|
||||
text['label-attached']['en-us'] = "Attached";
|
||||
text['label-attached']['es-cl'] = "Adjunto";
|
||||
text['label-attached']['pt-pt'] = "Ligado";
|
||||
text['label-attached']['fr-fr'] = "Attaché";
|
||||
@@ -51,6 +51,9 @@
|
||||
|
||||
--require the email address to send the email
|
||||
if (string.len(voicemail_mail_to) > 2) then
|
||||
--include languages file
|
||||
dofile(scripts_dir.."/app/voicemail/app_languages.lua");
|
||||
|
||||
--get voicemail message details
|
||||
sql = [[SELECT * FROM v_voicemail_messages
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
@@ -114,11 +117,11 @@
|
||||
body = body:gsub("${account}", id);
|
||||
body = body:gsub("${domain_name}", domain_name);
|
||||
if (voicemail_file == "attach") then
|
||||
body = body:gsub("${message}", "Attached");
|
||||
body = body:gsub("${message}", text['label-attached'][default_language.."-"..default_dialect]);
|
||||
elseif (voicemail_file == "link") then
|
||||
body = body:gsub("${message}", "<a href='https://"..domain_name.."/app/voicemails/voicemail_messages.php?action=download&type=vm&t=bin&id="..id.."&voicemail_uuid="..db_voicemail_uuid.."&uuid="..uuid.."&src=email'>Download</a>");
|
||||
body = body:gsub("${message}", "<a href='https://"..domain_name.."/app/voicemails/voicemail_messages.php?action=download&type=vm&t=bin&id="..id.."&voicemail_uuid="..db_voicemail_uuid.."&uuid="..uuid.."&src=email'>"..text['label-download'][default_language.."-"..default_dialect].."</a>");
|
||||
else
|
||||
body = body:gsub("${message}", "<a href='https://"..domain_name.."/app/voicemails/voicemail_messages.php?action=autoplay&id="..db_voicemail_uuid.."&uuid="..uuid.."'>Listen</a>");
|
||||
body = body:gsub("${message}", "<a href='https://"..domain_name.."/app/voicemails/voicemail_messages.php?action=autoplay&id="..db_voicemail_uuid.."&uuid="..uuid.."'>"..text['label-listen'][default_language.."-"..default_dialect].."</a>");
|
||||
end
|
||||
body = body:gsub(" ", " ");
|
||||
body = body:gsub("%s+", "");
|
||||
|
||||
Reference in New Issue
Block a user