From 7295dc44b76daa59d3d97afed4b9b3653d8a6f88 Mon Sep 17 00:00:00 2001
From: Marcel Werk
Date: Sat, 22 Dec 2018 23:25:18 +0100
Subject: [PATCH] Improved email subject of notification mails
Closes #123
---
...ersationMessageUserNotificationEvent.class.php | 15 +++++++++++++++
.../ConversationUserNotificationEvent.class.php | 11 +++++++++++
language/de.xml | 2 ++
language/en.xml | 2 ++
4 files changed, 30 insertions(+)
diff --git a/files/lib/system/user/notification/event/ConversationMessageUserNotificationEvent.class.php b/files/lib/system/user/notification/event/ConversationMessageUserNotificationEvent.class.php
index b7b682b..7eeaea7 100644
--- a/files/lib/system/user/notification/event/ConversationMessageUserNotificationEvent.class.php
+++ b/files/lib/system/user/notification/event/ConversationMessageUserNotificationEvent.class.php
@@ -74,6 +74,21 @@ class ConversationMessageUserNotificationEvent extends AbstractUserNotificationE
];
}
+ /**
+ * @inheritDoc
+ * @since 3.2
+ */
+ public function getEmailTitle() {
+ if (count($this->getAuthors()) > 1) {
+ return parent::getEmailTitle();
+ }
+
+ return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.message.mail.title', [
+ 'author' => $this->author,
+ 'message' => $this->userNotificationObject
+ ]);
+ }
+
/**
* @inheritDoc
*/
diff --git a/files/lib/system/user/notification/event/ConversationUserNotificationEvent.class.php b/files/lib/system/user/notification/event/ConversationUserNotificationEvent.class.php
index 8245a30..f4bdac3 100644
--- a/files/lib/system/user/notification/event/ConversationUserNotificationEvent.class.php
+++ b/files/lib/system/user/notification/event/ConversationUserNotificationEvent.class.php
@@ -47,6 +47,17 @@ class ConversationUserNotificationEvent extends AbstractUserNotificationEvent im
];
}
+ /**
+ * @inheritDoc
+ * @since 3.2
+ */
+ public function getEmailTitle() {
+ return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.mail.title', [
+ 'author' => $this->author,
+ 'conversation' => $this->userNotificationObject
+ ]);
+ }
+
/**
* @inheritDoc
*/
diff --git a/language/de.xml b/language/de.xml
index 476f0a6..548179f 100644
--- a/language/de.xml
+++ b/language/de.xml
@@ -189,10 +189,12 @@
- getUserNotificationObject()->getConversation()->subject}â [URL:{link controller='Conversation' object=$event->getUserNotificationObject()->getConversation() isEmail=true}{/link}] geantwortet{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]>
- {@$authorList} {if $count == 1 && !$guestTimesTriggered}hat{else}haben{/if} auf die Konversation {$event->getUserNotificationObject()->getConversation()->subject} geantwortet:
]]>
+ - username}" hat auf die Konversation "{$message->getConversation()->subject}" geantwortet]]>
- getAnchorTag()} hat die Konversation {$conversation->subject} gestartet.]]>
- getAuthor()->username} [URL:{link controller='User' object=$event->getAuthor() isEmail=true}{/link}] hat die Konversation â{@$event->getUserNotificationObject()->subject}â [URL:{link controller='Conversation' object=$event->getUserNotificationObject() isEmail=true}{/link}] gestartet:]]>
- {$event->getAuthor()->username} hat die Konversation {$event->getUserNotificationObject()->subject} gestartet:]]>
+ - username}"]]>
diff --git a/language/en.xml b/language/en.xml
index b3d7404..af2c2c9 100644
--- a/language/en.xml
+++ b/language/en.xml
@@ -190,10 +190,12 @@
- getUserNotificationObject()->getConversation()->subject}â [URL:{link controller='Conversation' object=$event->getUserNotificationObject()->getConversation() isEmail=true}{/link}]{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]>
- {@$authorList} replied to the conversation {$event->getUserNotificationObject()->getConversation()->subject}:]]>
+ - username}" replied to the conversation "{$message->getConversation()->subject}"]]>
- getAnchorTag()} started the conversation {$conversation->subject}.]]>
- getAuthor()->username} [URL:{link controller='User' object=$event->getAuthor() isEmail=true}{/link}] started the conversation â{@$event->getUserNotificationObject()->subject}â [URL:{link controller='Conversation' object=$event->getUserNotificationObject() isEmail=true}{/link}]:]]>
- {$event->getAuthor()->username} started the conversation {$event->getUserNotificationObject()->subject}:]]>
+ - username}"]]>
--
2.20.1