From e8699b37c9e75704e55a47ee9e0c8af19b092986 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 5 Jan 2024 16:51:56 -0700 Subject: [PATCH] Use voicemail from and from name When category voicemail from and from name are provided use them. If not provided then use category email from and from name. --- .../voicemail/resources/functions/send_email.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 0779535f69..43da44c224 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 @@ -283,9 +283,22 @@ body = body .. ''; end + --get the smtp from address and name + smtp_from = settings:get('voicemail', 'smtp_from', 'text'); + smtp_from_name = settings:get('voicemail', 'smtp_from_name', 'text'); + if (smtp_from == nil) then + smtp_from = settings:get('email', 'smtp_from', 'text'); + end + if (smtp_from_name == nil) then + smtp_from_name = settings:get('email', 'smtp_from_name', 'text'); + end + if (smtp_from_name ~= nil) then + smtp_from = smtp_from_name.."<"..smtp_from..">"; + end + --send the email send_mail(headers, - nil, + smtp_from, voicemail_mail_to, {subject, body}, (voicemail_file == "attach") and file