aboutsummaryrefslogtreecommitdiff
path: root/lib/messaging.inc.php
diff options
context:
space:
mode:
authorThomas Hackl <hackl@data-quest.de>2024-04-05 09:21:03 +0000
committerThomas Hackl <hackl@data-quest.de>2024-04-05 09:21:03 +0000
commit813b98c13dc5c44aff3132d7919c73b652b0a7da (patch)
tree02cc86756788fa8ddb80f63fbeee982006a8fd14 /lib/messaging.inc.php
parentce29a764567cfdd792e1fe7b5e0bfb06d2f278e3 (diff)
Resolve "Layout der HTML-Mails"
Closes #2350 Merge request studip/studip!2686
Diffstat (limited to 'lib/messaging.inc.php')
-rw-r--r--lib/messaging.inc.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/messaging.inc.php b/lib/messaging.inc.php
index 8f2b6ce..0fb7c3f 100644
--- a/lib/messaging.inc.php
+++ b/lib/messaging.inc.php
@@ -183,7 +183,7 @@ class messaging
if ($snd_user_id != "____%system%____") {
$sender = User::find($snd_user_id);
- $snd_fullname = $sender->getFullName();
+ $snd_fullname = $sender->getFullName() . ' (' . $sender->username . ')';
$reply_to = $sender->Email;
}
$attachments = [];
@@ -198,8 +198,8 @@ class messaging
$template->set_attribute('message', kill_format($message));
$template->set_attribute('rec_fullname', $rec_fullname);
$template->set_attribute('rec_email', $to);
+ $template->set_attribute('snd_email', $reply_to);
if (isset($snd_fullname)) {
- $template->set_attribute('snd_email', $reply_to);
$template->set_attribute('snd_fullname', $snd_fullname);
}
if ($attachments_as_links) {
@@ -211,9 +211,10 @@ class messaging
$template->set_attribute('lang', getUserLanguagePath($rec_user_id));
$template->set_attribute('message', $message);
$template->set_attribute('rec_fullname', $rec_fullname);
+ $template->set_attribute('rec_username', $receiver->username);
$template->set_attribute('rec_email', $to);
+ $template->set_attribute('snd_email', $reply_to);
if (isset($snd_fullname)) {
- $template->set_attribute('snd_email', $reply_to);
$template->set_attribute('snd_fullname', $snd_fullname);
}
if ($attachments_as_links) {
@@ -296,8 +297,6 @@ class messaging
// system-signatur
$snd_user_id = '____%system%____';
setTempLanguage();
- $message .= $this->sig_string;
- $message .= _('Diese Nachricht wurde automatisch vom Stud.IP-System generiert. Sie können darauf nicht antworten.');
restoreLanguage();
}
@@ -306,11 +305,19 @@ class messaging
$query = "INSERT INTO message (message_id, autor_id, subject, message, show_adressees, priority, mkdate)
VALUES (?, ?, ?, ?, ?, ?, UNIX_TIMESTAMP())";
$statement = DBManager::get()->prepare($query);
+
+ $internal_message = $message;
+
+ if ($snd_user_id === '____%system%____') {
+ $internal_message .= $this->sig_string . ' ' .
+ _('Diese Nachricht wurde automatisch vom Stud.IP-System generiert. Sie können darauf nicht antworten.');
+ }
+
$statement->execute([
$tmp_message_id,
$snd_user_id,
$subject,
- $message,
+ $internal_message,
(int) $show_adressees,
$priority,
]);