BugFix-Add PROJECT_PATH for lua (#1740)

added project_path for lua to use where it needs to build urls
This commit is contained in:
Mafoo
2016-07-08 20:12:37 +01:00
committed by FusionPBX
parent a52e9c3626
commit 9bc0fded96
4 changed files with 21 additions and 3 deletions

View File

@@ -87,6 +87,9 @@
moderator_pin = string.lower(row["moderator_pin"]);
end);
--get the link_address
link_address = http_protocol.."://"..domain_name..project_path;
--prepare the headers
headers = '{"X-FusionPBX-Domain-UUID":"'..domain_uuid..'",';
headers = headers..'"X-FusionPBX-Domain-Name":"'..domain_name..'",';
@@ -101,6 +104,7 @@
subject = subject:gsub("${conference_date_end}", conference_date_end);
--subject = subject:gsub("${conference_duration}", message_length_formatted);
subject = subject:gsub("${domain_name}", domain_name);
subject = subject:gsub("${link_address}", link_address);
subject = trim(subject);
subject = '=?utf-8?B?'..base64.enc(subject)..'?=';
@@ -113,6 +117,7 @@
body = body:gsub("${conference_uuid}", conference_session_uuid);
--body = body:gsub("${conference_duration}", message_length_formatted);
body = body:gsub("${domain_name}", domain_name);
body = body:gsub("${link_address}", link_address);
body = body:gsub(" ", " ");
body = body:gsub("%s+", "");
body = body:gsub(" ", " ");

View File

@@ -1,6 +1,6 @@
<font face="arial">
<p>The conference moderator pin is ${moderator_pin} and it ended on ${conference_date_end}.</p>
<p>You can download your conference recording by clicking <a href='http://${domain_name}/app/conference_centers/conference_session_details.php?uuid=${conference_uuid}'>here</a>.</p>
<p>You can download your conference recording by clicking <a href='${link_address}/app/conference_centers/conference_session_details.php?uuid=${conference_uuid}'>here</a>.</p>
<hr noshade="noshade" size="1"/>
Moderator PIN: ${moderator_pin}
Ended: ${conference_date_end}<br/>

View File

@@ -105,6 +105,9 @@
file_body = scripts_dir.."/app/voicemail/resources/templates/en/us/email_body.tpl";
end
--get the link_address
link_address = http_protocol.."://"..domain_name..project_path;
--prepare the headers
local headers = {
["X-FusionPBX-Domain-UUID"] = domain_uuid;
@@ -141,9 +144,9 @@
if (voicemail_file == "attach") then
body = body:gsub("${message}", text['label-attached']);
elseif (voicemail_file == "link") then
body = body:gsub("${message}", "<a href='https://"..domain_name.."/app/voicemails/voicemail_messages.php?action=download&type=vm&t=bin&id="..id.."&voicemail_uuid="..db_voicemail_uuid.."&uuid="..uuid.."&src=email'>"..text['label-download'].."</a>");
body = body:gsub("${message}", "<a href='"..link_address.."/app/voicemails/voicemail_messages.php?action=download&type=vm&t=bin&id="..id.."&voicemail_uuid="..db_voicemail_uuid.."&uuid="..uuid.."&src=email'>"..text['label-download'].."</a>");
else
body = body:gsub("${message}", "<a href='https://"..domain_name.."/app/voicemails/voicemail_messages.php?action=autoplay&id="..db_voicemail_uuid.."&uuid="..uuid.."'>"..text['label-listen'].."</a>");
body = body:gsub("${message}", "<a href='"..link_address.."/app/voicemails/voicemail_messages.php?action=autoplay&id="..db_voicemail_uuid.."&uuid="..uuid.."'>"..text['label-listen'].."</a>");
end
body = body:gsub(" ", "&nbsp;");
body = body:gsub("%s+", "");