Enhance - send_mail.lua (#2978)
use the to address when email:smtp_from:var is empty don't use email:smtp_from_name:var when empty
This commit is contained in:
parent
1c580ce7a1
commit
cdd7c2bd97
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
local Settings = require "resources.functions.lazy_settings"
|
||||
local Database = require "resources.functions.database"
|
||||
|
||||
|
|
@ -91,6 +90,12 @@ if freeswitch then
|
|||
xheaders = xheaders:sub(1,-2) .. '}'
|
||||
|
||||
local from = settings:get('email', 'smtp_from', 'var')
|
||||
local from_name = settings:get('email', 'smtp_from_name', 'var')
|
||||
if from == nil or from == "" then
|
||||
from = address
|
||||
elseif from_name ~= nil and from_name ~= "" then
|
||||
from = from_name .. "<" .. from .. ">"
|
||||
end
|
||||
local subject = message[1]
|
||||
local body = message[2] or ''
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue