From 32b920b91762dfcc8e0b692ad2dd5d51c294b4d1 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 17 Mar 2022 11:57:00 -0600 Subject: [PATCH] Get session data for the email headers --- app/scripts/resources/scripts/email.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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,