mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Add from in a few more places.
This commit is contained in:
@@ -159,7 +159,7 @@ else
|
|||||||
local sendmail = require "sendmail"
|
local sendmail = require "sendmail"
|
||||||
local uuid = require "uuid"
|
local uuid = require "uuid"
|
||||||
|
|
||||||
function send_mail(headers, address, message, file)
|
function send_mail(headers, from, address, message, file)
|
||||||
local domain_uuid = headers["X-FusionPBX-Domain-UUID"]
|
local domain_uuid = headers["X-FusionPBX-Domain-UUID"]
|
||||||
local domain_name = headers["X-FusionPBX-Domain-Name"]
|
local domain_name = headers["X-FusionPBX-Domain-Name"]
|
||||||
local email_type = headers["X-FusionPBX-Email-Type"] or 'info'
|
local email_type = headers["X-FusionPBX-Email-Type"] or 'info'
|
||||||
@@ -229,7 +229,7 @@ else
|
|||||||
end
|
end
|
||||||
|
|
||||||
if freeswitch then
|
if freeswitch then
|
||||||
function send_mail(headers, address, message, file)
|
function send_mail(headers, from, address, message, file)
|
||||||
local domain_uuid = headers["X-FusionPBX-Domain-UUID"]
|
local domain_uuid = headers["X-FusionPBX-Domain-UUID"]
|
||||||
local domain_name = headers["X-FusionPBX-Domain-Name"]
|
local domain_name = headers["X-FusionPBX-Domain-Name"]
|
||||||
local email_type = headers["X-FusionPBX-Email-Type"] or 'info'
|
local email_type = headers["X-FusionPBX-Email-Type"] or 'info'
|
||||||
@@ -242,15 +242,22 @@ else
|
|||||||
end
|
end
|
||||||
xheaders = xheaders:sub(1,-2) .. '}'
|
xheaders = xheaders:sub(1,-2) .. '}'
|
||||||
|
|
||||||
local from = settings:get('email', 'smtp_from', 'text')
|
if (from == nil or from == "") then
|
||||||
local from_name = settings:get('email', 'smtp_from_name', 'text')
|
from = settings:get('email', 'smtp_from', 'text')
|
||||||
|
from_name = settings:get('email', 'smtp_from_name', 'text')
|
||||||
|
end
|
||||||
if from == nil or from == "" then
|
if from == nil or from == "" then
|
||||||
from = address
|
from = address
|
||||||
elseif from_name ~= nil and from_name ~= "" then
|
elseif from_name ~= nil and from_name ~= "" then
|
||||||
from = from_name .. "<" .. from .. ">"
|
from = from_name .. "<" .. from .. ">"
|
||||||
end
|
end
|
||||||
|
|
||||||
local subject = message[1]
|
local subject = message[1]
|
||||||
local body = message[2] or ''
|
local body = message[2] or ''
|
||||||
|
|
||||||
|
--debug info
|
||||||
|
--freeswitch.consoleLog("notice", "[voicemail] from: " .. from .. "\n");
|
||||||
|
--freeswitch.consoleLog("notice", "[voicemail] subject: " .. subject .. "\n");
|
||||||
|
|
||||||
local mail_headers =
|
local mail_headers =
|
||||||
"To: ".. address .. "\n" ..
|
"To: ".. address .. "\n" ..
|
||||||
|
|||||||
Reference in New Issue
Block a user