Voicemail: Email notification script updated to support multiple languages.

This commit is contained in:
Nate Jones
2015-02-24 09:40:45 +00:00
parent cbb39328f5
commit 9a1b836f6d
2 changed files with 25 additions and 3 deletions

View 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é";

View File

@@ -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(" ", "&nbsp;");
body = body:gsub("%s+", "");