From 93fab3bb4fcac93d726f381cdfe2b20ae9897e83 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Mar 2025 19:34:24 +0100 Subject: [PATCH] Update actions_sendmails.inc.php --- htdocs/core/actions_sendmails.inc.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index fb754af26fd..efb5c651089 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -306,7 +306,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO $reg = array(); $fromtype = GETPOST('fromtype', 'alpha'); - $emailsendersignature = null; + $emailsendersignature = ''; if ($fromtype === 'robot') { $from = dol_string_nospecial($conf->global->MAIN_MAIL_EMAIL_FROM, ' ', array(",")).' <' . getDolGlobalString('MAIN_MAIL_EMAIL_FROM').'>'; } elseif ($fromtype === 'user') { @@ -326,7 +326,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO $obj = $db->fetch_object($resql); if ($obj) { $from = dol_string_nospecial($obj->label, ' ', array(",")).' <'.$obj->email.'>'; - $emailsendersignature = $obj->signature; + = $obj->signature; } } elseif (preg_match('/from_template_(\d+)/', $fromtype, $reg)) { $sql = 'SELECT rowid, email_from FROM '.MAIN_DB_PREFIX.'c_email_templates'; @@ -386,9 +386,8 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO // Make substitution in email content $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $object); - if (!empty($emailsendersignature)) { - $substitutionarray['__SENDEREMAIL_SIGNATURE__'] = $emailsendersignature; - } + + $substitutionarray['__SENDEREMAIL_SIGNATURE__'] = (empty($emailsendersignature) ? '' : $emailsendersignature); $substitutionarray['__EMAIL__'] = $sendto; $substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '' : '';