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:
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
local Settings = require "resources.functions.lazy_settings"
|
local Settings = require "resources.functions.lazy_settings"
|
||||||
local Database = require "resources.functions.database"
|
local Database = require "resources.functions.database"
|
||||||
|
|
||||||
@@ -91,6 +90,12 @@ if freeswitch then
|
|||||||
xheaders = xheaders:sub(1,-2) .. '}'
|
xheaders = xheaders:sub(1,-2) .. '}'
|
||||||
|
|
||||||
local from = settings:get('email', 'smtp_from', 'var')
|
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 subject = message[1]
|
||||||
local body = message[2] or ''
|
local body = message[2] or ''
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user