diff --git a/app/scripts/resources/scripts/email.lua b/app/scripts/resources/scripts/email.lua index 37c4403e0b..44111f57cf 100644 --- a/app/scripts/resources/scripts/email.lua +++ b/app/scripts/resources/scripts/email.lua @@ -1,6 +1,6 @@ -- email.lua -- Part of FusionPBX --- Copyright (C) 2010 - 291 Mark J Crane +-- Copyright (C) 2010 - 2022 Mark J Crane -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -59,6 +59,19 @@ --replace the " with double quote body = body:gsub(""", [["]]); +--get sessions info + if (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-Call-UUID"] = call_uuid; + } + end + --send the email if (file == nil) then send_mail(headers,