From 6c8a4ec135a730b75852486a2e9066c68270c7d8 Mon Sep 17 00:00:00 2001 From: Andy-Seattle <56096200+Andy-Seattle@users.noreply.github.com> Date: Mon, 16 Nov 2020 20:12:45 -0800 Subject: [PATCH] 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. --- .../scripts/app/voicemail/resources/functions/send_email.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/scripts/resources/scripts/app/voicemail/resources/functions/send_email.lua b/app/scripts/resources/scripts/app/voicemail/resources/functions/send_email.lua index 421ed9540a..e009c018c5 100644 --- a/app/scripts/resources/scripts/app/voicemail/resources/functions/send_email.lua +++ b/app/scripts/resources/scripts/app/voicemail/resources/functions/send_email.lua @@ -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' "