handlers as $renderer) { if ($renderer->supports($notification, $options)) { return $renderer; } } throw new NotificationHandlerNotFound(); } public function getTemplate(Notification $notification, array $options = []): string { return $this->getHandler($notification, $options)->getTemplate($notification, $options); } public function getTemplateData(Notification $notification, array $options = []): array { return $this->getHandler($notification, $options)->getTemplateData($notification, $options); } }