Services/AzineNotifierService.php
public function addNotification($recipientId, $title, $content, $template, $templateVars, $importance, $sendImmediately)
    {
        $notification = new Notification();
        $notification->setRecipientId($recipientId);
        $notification->setTitle($title);
        $notification->setContent($content);
        $notification->setTemplate($template);
        $notification->setImportance($importance);
        $notification->setSendImmediately($sendImmediately);
        $notification->setVariables($templateVars);
        $this->managerRegistry->getManager()->persist($notification);
        $this->managerRegistry->getManager()->flush($notification);

        return $notification;
    }
public function addNotification($recipientId, $title, $content, $template, $templateVars, $importance, $sendImmediately)
    {
        $notification = new Notification();
        $notification->setRecipientId($recipientId);
        $notification->setTitle($title);
        $notification->setContent($content);
        $notification->setTemplate($template);
        $notification->setImportance($importance);
        $notification->setSendImmediately($sendImmediately);
        $notification->setVariables($templateVars);
        $this->managerRegistry->getManager()->persist($notification);
        $this->managerRegistry->getManager()->flush($notification);

        return $notification;
    }
public function addNotification ( $ recipientId , $ title , $ content , $ template , $ templateVars , $ importance , $ sendImmediately ) { $ notification = new Notification ( ) ; $ notification -> setRecipientId ( $ recipientId ) ; $ notification -> setTitle ( $ title ) ; $ notification -> setContent ( $ content ) ; $ notification -> setTemplate ( $ template ) ; $ notification -> setImportance ( $ importance ) ; $ notification -> setSendImmediately ( $ sendImmediately ) ; $ notification -> setVariables ( $ templateVars ) ; $ this -> managerRegistry -> getManager ( ) -> persist ( $ notification ) ; $ this -> managerRegistry -> getManager ( ) -> flush ( $ notification ) ; return $ notification ; }
Convenience-function to add and save a Notification-entity.

@param int    $recipientId     the ID of the recipient of this notification => see RecipientProvider.getRecipient($id)
@param string $title           the title of the notification. depending on the recipients settings, multiple notifications are sent in one email.
@param string $content         the content of the notification
@param string $template        the twig-template to render the notification with
@param array  $templateVars    the parameters used in the twig-template, 'notification' => Notification and 'recipient' => RecipientInterface will be added to this array when rendering the twig-template
@param int    $importance      important messages are at the top of the notification-emails, un-important at the bottom
@param bool   $sendImmediately whether or not to ignore the recipients mailing-preference and send the notification a.s.a.p.

@return Notification
Convenience - function to add and save a Notification - entity .