Update send_email.lua

To handle scenarios where transcribe_enabled is true BUT voicemail_transcription_enabled is not true for specific voicemail boxes. Need to be able to switch between the email templates.
This commit is contained in:
Andy-Seattle
2020-11-16 20:12:45 -08:00
committed by GitHub
parent aa87250196
commit 6c8a4ec135

View File

@@ -48,6 +48,7 @@
--voicemail_password = row["voicemail_password"];
--greeting_id = row["greeting_id"];
voicemail_mail_to = row["voicemail_mail_to"];
voicemail_transcription_enabled = row["voicemail_transcription_enabled"];
voicemail_file = row["voicemail_file"];
voicemail_local_after_email = row["voicemail_local_after_email"];
voicemail_description = row["voicemail_description"];
@@ -135,7 +136,7 @@
sql = sql .. "WHERE (domain_uuid = :domain_uuid or domain_uuid is null) ";
sql = sql .. "AND template_language = :template_language ";
sql = sql .. "AND template_category = 'voicemail' "
if (transcribe_enabled == 'true') then
if (transcribe_enabled == 'true' and voicemail_transcription_enabled == 'true') then
sql = sql .. "AND template_subcategory = 'transcription' "
else
sql = sql .. "AND template_subcategory = 'default' "