Improved email subject of notification mails
authorMarcel Werk <burntime@woltlab.com>
Sat, 22 Dec 2018 22:25:18 +0000 (23:25 +0100)
committerMarcel Werk <burntime@woltlab.com>
Sat, 22 Dec 2018 22:25:18 +0000 (23:25 +0100)
Closes #123

files/lib/system/user/notification/event/ConversationMessageUserNotificationEvent.class.php
files/lib/system/user/notification/event/ConversationUserNotificationEvent.class.php
language/de.xml
language/en.xml

index b7b682bace182991ccb0afbb154e623eb828b97f..7eeaea7c3efa47c88e37260c1e7aab92949b845a 100644 (file)
@@ -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
         */
index 8245a30c4a8e7fe080bb752d49e70909cd657b28..f4bdac31c91a95c02a22b57e35d2e16b9fc9ba51 100644 (file)
@@ -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
         */
index 476f0a6036a14b0e74b057ce3161b77e9daad087..548179f076f9375640fad70f07b5b9f8e317c82d 100644 (file)
                <item name="wcf.user.notification.conversation.message.title.stacked"><![CDATA[{#$count} Teilnehmer haben auf eine Konversation geantwortet]]></item>
                <item name="wcf.user.notification.conversation.message.mail.plaintext"><![CDATA[{@$authorList} {if $count == 1 && !$guestTimesTriggered}hat{else}haben{/if} auf die Konversation „{$event->getUserNotificationObject()->getConversation()->subject}“ [URL:{link controller='Conversation' object=$event->getUserNotificationObject()->getConversation() isEmail=true}{/link}] geantwortet{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]></item>
                <item name="wcf.user.notification.conversation.message.mail.html"><![CDATA[<p>{@$authorList} {if $count == 1 && !$guestTimesTriggered}hat{else}haben{/if} auf die Konversation <a href="{link controller='Conversation' object=$event->getUserNotificationObject()->getConversation() isEmail=true}{/link}">{$event->getUserNotificationObject()->getConversation()->subject}</a> geantwortet:</p>]]></item>
+               <item name="wcf.user.notification.conversation.message.mail.title"><![CDATA["{@$author->username}" hat auf die Konversation "{$message->getConversation()->subject}" geantwortet]]></item>
                <item name="wcf.user.notification.conversation.message"><![CDATA[{@$author->getAnchorTag()} hat die Konversation <a href="{link controller='Conversation' object=$conversation}{/link}">{$conversation->subject}</a> gestartet.]]></item>
                <item name="wcf.user.notification.conversation.title"><![CDATA[Neue Konversation]]></item>
                <item name="wcf.user.notification.conversation.mail.plaintext"><![CDATA[{@$event->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:]]></item>
                <item name="wcf.user.notification.conversation.mail.html"><![CDATA[<p><a href="{link controller='User' object=$event->getAuthor() isEmail=true}{/link}">{$event->getAuthor()->username}</a> hat die Konversation <a href="{link controller='Conversation' object=$event->getUserNotificationObject() isEmail=true}{/link}">{$event->getUserNotificationObject()->subject}</a> gestartet:</p>]]></item>
+               <item name="wcf.user.notification.conversation.mail.title"><![CDATA[Neue Konversation von "{@$author->username}"]]></item>
                <item name="wcf.user.notification.com.woltlab.wcf.conversation"><![CDATA[Konversationen]]></item>
                <item name="wcf.user.notification.com.woltlab.wcf.conversation.notification.conversation"><![CDATA[Neue Konversation]]></item>
                <item name="wcf.user.notification.com.woltlab.wcf.conversation.message.notification.conversationMessage"><![CDATA[Antwort auf bestehende Konversation]]></item>
index b3d7404fa074b5c1195fdeadf77fcbd74430cf92..af2c2c93d785e3b4f0f864be4d4ee83e5cfdba41 100644 (file)
                <item name="wcf.user.notification.conversation.message.title.stacked"><![CDATA[{#$count} participants replied to a conversation]]></item>
                <item name="wcf.user.notification.conversation.message.mail.plaintext"><![CDATA[{@$authorList} replied to the conversation “{$event->getUserNotificationObject()->getConversation()->subject}” [URL:{link controller='Conversation' object=$event->getUserNotificationObject()->getConversation() isEmail=true}{/link}]{if $count == 1 && !$guestTimesTriggered}:{else}.{/if}]]></item>
                <item name="wcf.user.notification.conversation.message.mail.html"><![CDATA[<p>{@$authorList} replied to the conversation <a href="{link controller='Conversation' object=$event->getUserNotificationObject()->getConversation() isEmail=true}{/link}">{$event->getUserNotificationObject()->getConversation()->subject}</a>:</p>]]></item>
+               <item name="wcf.user.notification.conversation.message.mail.title"><![CDATA["{@$author->username}" replied to the conversation "{$message->getConversation()->subject}"]]></item>
                <item name="wcf.user.notification.conversation.message"><![CDATA[{@$author->getAnchorTag()} started the conversation <a href="{link controller='Conversation' object=$conversation}{/link}">{$conversation->subject}</a>.]]></item>
                <item name="wcf.user.notification.conversation.title"><![CDATA[New Conversation]]></item>
                <item name="wcf.user.notification.conversation.mail.plaintext"><![CDATA[{@$event->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}]:]]></item>
                <item name="wcf.user.notification.conversation.mail.html"><![CDATA[<p><a href="{link controller='User' object=$event->getAuthor() isEmail=true}{/link}">{$event->getAuthor()->username}</a> started the conversation <a href="{link controller='Conversation' object=$event->getUserNotificationObject() isEmail=true}{/link}">{$event->getUserNotificationObject()->subject}</a>:</p>]]></item>
+               <item name="wcf.user.notification.conversation.mail.title"><![CDATA[New Conversation from "{@$author->username}"]]></item>
                <item name="wcf.user.notification.com.woltlab.wcf.conversation"><![CDATA[Conversations]]></item>
                <item name="wcf.user.notification.com.woltlab.wcf.conversation.notification.conversation"><![CDATA[Notify me of new conversations]]></item>
                <item name="wcf.user.notification.com.woltlab.wcf.conversation.message.notification.conversationMessage"><![CDATA[Notify me of new replies in conversations]]></item>