Add from_address to the send_mail function for missed call emails.
This commit is contained in:
@@ -53,6 +53,11 @@
|
|||||||
local Database = require "resources.functions.database";
|
local Database = require "resources.functions.database";
|
||||||
local dbh = Database.new('system');
|
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
|
--get the templates
|
||||||
local sql = "SELECT * FROM v_email_templates ";
|
local sql = "SELECT * FROM v_email_templates ";
|
||||||
sql = sql .. "WHERE (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
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-Domain-Name"] = domain_name;
|
||||||
headers["X-FusionPBX-Call-UUID"] = uuid;
|
headers["X-FusionPBX-Call-UUID"] = uuid;
|
||||||
headers["X-FusionPBX-Email-Type"] = 'missed';
|
headers["X-FusionPBX-Email-Type"] = 'missed';
|
||||||
|
|
||||||
--remove quotes from caller id name and number
|
--remove quotes from caller id name and number
|
||||||
caller_id_name = caller_id_name:gsub("'", "'");
|
caller_id_name = caller_id_name:gsub("'", "'");
|
||||||
caller_id_name = caller_id_name:gsub([["]], """);
|
caller_id_name = caller_id_name:gsub([["]], """);
|
||||||
@@ -104,7 +109,7 @@
|
|||||||
|
|
||||||
--send the emails
|
--send the emails
|
||||||
send_mail(headers,
|
send_mail(headers,
|
||||||
missed_call_data,
|
from_address,
|
||||||
missed_call_data,
|
missed_call_data,
|
||||||
{subject, body}
|
{subject, body}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user