From: Tim Düsterhus Date: Mon, 22 Jun 2020 13:43:44 +0000 (+0200) Subject: Make use of NotificationEmailDeliveryBackgroundJob X-Git-Tag: 5.3.0_Alpha_1~206^2^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4a7ceda16e54a533b40109699c1673fb98bad2b6;p=GitHub%2FWoltLab%2FWCF.git Make use of NotificationEmailDeliveryBackgroundJob Fixes #2885 --- diff --git a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php index 4672efdfa0..7895753bfa 100644 --- a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php @@ -9,6 +9,8 @@ use wcf\data\user\notification\UserNotificationAction; use wcf\data\user\User; use wcf\data\user\UserEditor; use wcf\data\user\UserProfile; +use wcf\system\background\job\NotificationEmailDeliveryBackgroundJob; +use wcf\system\background\BackgroundQueueHandler; use wcf\system\cache\builder\UserNotificationEventCacheBuilder; use wcf\system\cache\runtime\UserProfileRuntimeCache; use wcf\system\database\util\PreparedStatementConditionBuilder; @@ -726,7 +728,11 @@ class UserNotificationHandler extends SingletonFactory { ])); } - $email->send(); + $jobs = $email->getJobs(); + foreach ($jobs as $job) { + $wrappedJob = new NotificationEmailDeliveryBackgroundJob($job, $notification, $user); + BackgroundQueueHandler::getInstance()->enqueueIn($wrappedJob); + } } /**