/** * {@inheritdoc} */ public function onSuccess() { foreach ($this->objects as $object) { /** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */ $notification = new SendCustomNotificationCommand(); $notification->setObject($object)->setComment($this->getElement('comment')->getValue())->setAuthor($this->request->getUser()->getUsername())->setForced($this->getElement('forced')->isChecked())->setBroadcast($this->getElement('broadcast')->isChecked()); $this->getTransport($this->request)->send($notification); } Notification::success($this->translatePlural('Sending custom notification..', 'Sending custom notifications..', count($this->objects))); return true; }