From f97f73aa2ac971216eca6757524ea136d59ea580 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Jan 2026 16:34:39 +0100 Subject: [PATCH] Debug v23 --- htdocs/blockedlog/class/blockedlog.class.php | 7 +++++++ htdocs/compta/facture/class/facture.class.php | 1 + htdocs/core/actions_sendmails.inc.php | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index cff09c089aa..b42253b1ef7 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -762,6 +762,13 @@ class BlockedLog if (!empty($object->newref)) { $this->object_data->ref = $object->newref; } + + // Information on email + $this->object_data->action_email_sent = array( + "email_from" => $object->context['email_from'], + "email_to" => $object->context['email_to'], + "email_msgid" => $object->context['email_msgid'] + ); } elseif ($this->element == 'invoice_supplier') { '@phan-var-force FactureFournisseur $object'; foreach ($object as $key => $value) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 6391ffdcb05..0785c0da166 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -6444,6 +6444,7 @@ class Facture extends CommonInvoice $actioncomm->userownerid = $user->id; // Owner of action // Fields when action is an email (content should be added into note) $actioncomm->email_msgid = $cMailFile->msgid; + $actioncomm->email_subject = $sendTopic; $actioncomm->email_from = $from; $actioncomm->email_sender = ''; $actioncomm->email_to = $to; diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 907c3ae0ac8..5ef8c75f6a6 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -446,6 +446,14 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO $object->sendtouserid = $sendtouserid; } + // TODO Fix this: Such properties does not exists on all objects + $object->context['email_msgid'] = $mailfile->msgid; + $object->context['email_from'] = $from; + $object->context['email_subject'] = $subject; + $object->context['email_to'] = $sendto; + $object->context['email_tocc'] = $sendtocc; + $object->context['email_tobcc'] = $sendtobcc; + $object->email_msgid = $mailfile->msgid; // @todo Set msgid into $mailfile after sending $object->email_from = $from; $object->email_subject = $subject;