diff --git a/app/email_queue/resources/jobs/email_send.php b/app/email_queue/resources/jobs/email_send.php index 416589299e..91f29f5e18 100755 --- a/app/email_queue/resources/jobs/email_send.php +++ b/app/email_queue/resources/jobs/email_send.php @@ -171,7 +171,7 @@ //$voicemail_sms_to = $row["voicemail_sms_to "]; $voicemail_transcription_enabled = $row["voicemail_transcription_enabled"]; //$voicemail_attach_file = $row["voicemail_attach_file"]; - //$voicemail_file = $row["voicemail_file"]; + $voicemail_file = $row["voicemail_file"]; //$voicemail_local_after_email = $row["voicemail_local_after_email"]; //$voicemail_enabled = $row["voicemail_enabled"]; //$voicemail_description = $row["voicemail_description"]; @@ -338,7 +338,9 @@ $email->recipients = $email_to; $email->subject = $email_subject; $email->body = $email_body; - $email->attachments = $email_attachments; + if ($voicemail_file == 'attach') { + $email->attachments = $email_attachments; + } $email->debug_level = 3; $email->method = 'direct'; $email_status = $email->send(); diff --git a/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua b/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua index 8304b7e065..d73a61d53b 100644 --- a/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua +++ b/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua @@ -194,6 +194,7 @@ function send_email(id, uuid) else sql = sql .. "AND template_subcategory = 'default' " end + sql = sql .. "AND template_type = 'html' " sql = sql .. "AND template_enabled = true " sql = sql .. "ORDER BY domain_uuid DESC " local params = {domain_uuid = domain_uuid, template_language = default_language.."-"..default_dialect}; @@ -337,7 +338,7 @@ function send_email(id, uuid) smtp_from, voicemail_mail_to, {subject, body}, - (voicemail_file == "attach") and voicemail_path, + voicemail_path, voicemail_base64 );