Skip to content

Commit

Permalink
email.lua fix execution from api (fusionpbx#6408)
Browse files Browse the repository at this point in the history
  • Loading branch information
greenbea authored Jun 13, 2022
1 parent af6b00b commit dfeda45
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/scripts/resources/scripts/email.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,18 @@
body = body:gsub(""", [["]]);

--get sessions info
if (session:ready()) then
if (session and session:ready()) then
domain_uuid = session:getVariable("domain_uuid");
domain_name = session:getVariable("domain_name");
call_uuid = session:getVariable("uuid");
headers = {
["X-FusionPBX-Domain-UUID"] = domain_uuid;
["X-FusionPBX-Domain-Name"] = domain_name;
["X-FusionPBX-Email-Type"] = 'voicemail';
["X-FusionPBX-Email-Type"] = 'app';
["X-FusionPBX-Call-UUID"] = call_uuid;
}
else
headers = {}
end

--send the email
Expand Down

0 comments on commit dfeda45

Please sign in to comment.