diff --git a/lib/Push.php b/lib/Push.php index ff12ccbaf..4e74d5968 100644 --- a/lib/Push.php +++ b/lib/Push.php @@ -299,13 +299,15 @@ public function pushToDevice(int $id, INotification $notification, ?OutputInterf $language = $this->l10nFactory->getUserLanguage($user); $this->printInfo('Language is set to ' . $language); - try { - $this->notificationManager->setPreparingPushNotification(true); - $notification = $this->notificationManager->prepare($notification, $language); - } catch (\InvalidArgumentException $e) { - return; - } finally { - $this->notificationManager->setPreparingPushNotification(false); + if (!$notification->isValidParsed()) { + try { + $this->notificationManager->setPreparingPushNotification(true); + $notification = $this->notificationManager->prepare($notification, $language); + } catch (\InvalidArgumentException $e) { + return; + } finally { + $this->notificationManager->setPreparingPushNotification(false); + } } $userKey = $this->keyManager->getKey($user);