diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index ace685c78..15f413619 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -75,12 +75,6 @@ class Notifier implements INotifier { 'link' => $this->url->linkToRouteAbsolute('calendar.view.index') ] ]); - $placeholders = $replacements = []; - foreach ($notification->getRichSubjectParameters() as $placeholder => $parameter) { - $placeholders[] = '{' . $placeholder . '}'; - $replacements[] = $parameter[$placeholder]; - } - $notification->setParsedSubject(str_replace($placeholders, $replacements, $notification->getRichSubject())); $messageParameters = $notification->getMessageParameters(); $notification->setRichMessage($l->t('{display_name} ({email}) booked the appointment "{config_display_name}" on {date_time}.'), [ @@ -105,17 +99,11 @@ class Notifier implements INotifier { 'name' => $messageParameters['config_display_name'], ] ]); - foreach ($notification->getRichMessageParameters() as $placeholder => $parameter) { - $placeholders[] = '{' . $placeholder . '}'; - $replacements[] = $parameter[$placeholder]; - } - $notification->setParsedMessage(str_replace($placeholders, $replacements, $notification->getRichMessage())); break; default: throw new \InvalidArgumentException(); } - return $notification; } } diff --git a/tests/php/unit/Notification/NotifierTest.php b/tests/php/unit/Notification/NotifierTest.php index 07c141cd0..58b4b4728 100644 --- a/tests/php/unit/Notification/NotifierTest.php +++ b/tests/php/unit/Notification/NotifierTest.php @@ -179,20 +179,12 @@ class NotifierTest extends \PHPUnit\Framework\TestCase { $notification->expects($this->once()) ->method('setRichSubject') ->with('New booking {booking}', $booking); - $notification->expects($this->once()) - ->method('getRichSubjectParameters'); - $notification->expects(self::once()) - ->method('setParsedSubject'); $notification->expects(self::once()) ->method('getMessageParameters') ->willReturn($messageParameters); $notification->expects($this->once()) ->method('setRichMessage') ->with('{display_name} ({email}) booked the appointment "{config_display_name}" on {date_time}.', $messageRichData); - $notification->expects($this->once()) - ->method('getRichMessageParameters'); - $notification->expects(self::once()) - ->method('setParsedMessage'); $return = $this->notifier->prepare($notification, 'de'); $this->assertEquals($notification, $return);