Add List-ID header to notification mails
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 29 Jun 2020 12:03:48 +0000 (14:03 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 29 Jun 2020 14:12:31 +0000 (16:12 +0200)
see #3379

wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php
wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php

index 001329003758fe99c3514d4ac11f073bf90f452e..aac7ac0c02b8a0b04a1389b7023643a1c838d410 100644 (file)
@@ -212,6 +212,7 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                        $email = new Email();
                        $email->setSubject($user->getLanguage()->getDynamicVariable('wcf.user.notification.mail.daily.subject', ['count' => count($notifications)]));
                        $email->addRecipient(new UserMailbox($user));
+                       $email->setListID('daily.notification');
                        
                        $html = new RecipientAwareTextMimePart('text/html', 'email_dailyNotification', 'wcf', ['notifications' => $notifications]);
                        $plainText = new RecipientAwareTextMimePart('text/plain', 'email_dailyNotification', 'wcf', ['notifications' => $notifications]);
index 7895753bfa058865d438d4a5f0cd514e4814c3da..f554090071948615f26360be6cf3f69f433a9b2f 100644 (file)
@@ -695,6 +695,8 @@ class UserNotificationHandler extends SingletonFactory {
                        'title' => $event->getEmailTitle()
                ]));
                $email->addRecipient(new UserMailbox($user));
+               $humanReadableListId = $user->getLanguage()->getDynamicVariable('wcf.user.notification.'.$event->objectType.'.'.$event->eventName);
+               $email->setListID($event->eventName.'.'.$event->objectType.'.instant.notification', $humanReadableListId);
                
                $message = $event->getEmailMessage('instant');
                if (is_array($message)) {