Add from_address to the send_mail function for missed call emails.

This commit is contained in:
FusionPBX
2022-01-12 12:04:56 -07:00
committed by GitHub
parent 650f50a6ce
commit daf9694c7c

View File

@@ -53,6 +53,11 @@
local Database = require "resources.functions.database";
local dbh = Database.new('system');
--prepare to get the settings
local Settings = require "resources.functions.lazy_settings"
local settings = Settings.new(dbh, domain_name, domain_uuid)
local from_address = settings:get('email', 'smtp_from', 'text');
--get the templates
local sql = "SELECT * FROM v_email_templates ";
sql = sql .. "WHERE (domain_uuid = :domain_uuid or domain_uuid is null) ";
@@ -75,7 +80,7 @@
headers["X-FusionPBX-Domain-Name"] = domain_name;
headers["X-FusionPBX-Call-UUID"] = uuid;
headers["X-FusionPBX-Email-Type"] = 'missed';
--remove quotes from caller id name and number
caller_id_name = caller_id_name:gsub("'", "'");
caller_id_name = caller_id_name:gsub([["]], """);
@@ -104,7 +109,7 @@
--send the emails
send_mail(headers,
missed_call_data,
from_address,
missed_call_data,
{subject, body}
);