From f290ad51eb259a5e1ee9d1a9a187fb720c44a1e8 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Thu, 17 Nov 2016 20:57:50 -0500 Subject: [PATCH] Fix 'from' on email header --- inc/mail_functions.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/inc/mail_functions.inc.php b/inc/mail_functions.inc.php index d63d49ec..94841ba5 100644 --- a/inc/mail_functions.inc.php +++ b/inc/mail_functions.inc.php @@ -3,7 +3,7 @@ function mfh_get_mail_headers_for_dropdown($user_id, $hesk_settings, $hesklang) { $deleted_user_text = hesk_dbEscape($hesklang['deleted_user_title_case']); $sql = "SELECT `mail`.`id` AS `id`, `mail`.`subject` AS `subject`, - COALESCE(`users`.`name`, '{$deleted_user_text}') AS `from`, `mail`.`dt` AS `date` + `users`.`name` AS `from`, `mail`.`dt` AS `date`, `mail`.`from` AS `from_id` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` AS `mail` LEFT JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` AS `users` ON `mail`.`from` = `users`.`id` @@ -15,6 +15,14 @@ function mfh_get_mail_headers_for_dropdown($user_id, $hesk_settings, $hesklang) $mails = array(); while ($row = hesk_dbFetchAssoc($rs)) { + if ($row['from'] == null) { + if ($row['from_id'] == 9999) { + $row['from'] = 'HESK.com'; + } else { + $row['from'] = $deleted_user_text; + } + } + $mails[] = $row; }