From cf02d33ab09fae2461f2a8431f9e95b0148cb4e1 Mon Sep 17 00:00:00 2001 From: kkhelifa Date: Mon, 5 Dec 2022 11:11:18 +0100 Subject: [PATCH] NEW: Replace event title by the email subject if option activated --- htdocs/core/actions_massactions.inc.php | 3 +++ htdocs/core/actions_sendmails.inc.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index dced78b6c3c..ec2ecabcf0d 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -592,6 +592,9 @@ if (!$error && $massaction == 'confirm_presend') { $objectobj2->actionmsg2 = $actionmsg2; // Short text $objectobj2->fk_element = $objid2; $objectobj2->elementtype = $objectobj2->element; + if (!empty($conf->global->MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT)) { + $objectobj2->actionmsg2 = $subjectreplaced; // Short text + } $triggername = strtoupper(get_class($objectobj2)).'_SENTBYMAIL'; if ($triggername == 'SOCIETE_SENTBYMAIL') { diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 772d2b7ed5d..4f7580bb8ca 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -382,6 +382,9 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO $object->actiontypecode = $actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) $object->actionmsg = $message; // Long text $object->actionmsg2 = $actionmsg2; // Short text ($langs->transnoentities('MailSentBy')...); + if (!empty($conf->global->MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT)) { + $object->actionmsg2 = $subject; // Short text + } $object->trackid = $trackid; $object->fk_element = $object->id;