Send a private message to a player (specified in
Notification::$receiverName).
@param Notification $n
@deprecated since version 3.1.0
2704
function postPrivateNotification(Notification $n)
	{
		return $this->manialinkPublisher->postPrivateNotification($n->message, $n->receiverName, $n->link);
	}
279675
public function sendMessage( $message )
	{
		if( !$this->receiver )
			throw new RuntimeException( 'No Receiver set.' );
		$this->sendMessageTo( $message, $this->receiver->get() );
	}
333285
public function send($notifiable, Notification $notification)
    {
        $this->events->fire(new BroadcastNotificationCreated(
            $notifiable, $notification, $this->getData($notifiable, $notification)
        ));
    }
582590
private function sendMessage($receiver, $message)
    {
        $id = null;

        switch ($message->type)
        {
            case 'text':
                $id = $this->broadcast
                        ? $this->gateway()->sendBroadcastMessage($receiver, $message->message)
                        : $this->gateway()->sendMessage($receiver, $message->message);
                break;
            case 'image':
                $id = $this->broadcast
                        ? $this->gateway()->sendBroadcastImage($receiver, $message->file, false, $message->filesize, $message->hash, $message->caption)
                        : $this->gateway()->sendMessageImage($receiver, $message->file, false, $message->filesize, $message->hash, $message->caption);
                break;
            case 'audio':
                $id = $this->broadcast
                        ? $this->gateway()->sendBroadcastAudio($receiver, $message->file, false, $message->filesize, $message->hash)
                        : $this->gateway()->sendMessageAudio($receiver, $message->file, false, $message->filesize, $message->hash);
                break;
            case 'video':
                $id = $this->broadcast
                        ? $this->gateway()->sendBroadcastVideo($receiver, $message->file, false, $message->filesize, $message->hash, $message->caption)
                        : $this->gateway()->sendMessageVideo($receiver, $message->file, false, $message->filesize, $message->hash, $message->caption);
                break;
            case 'location':
                $id = $this->broadcast 
                        ? $this->gateway()->sendBroadcastLocation($receiver, $message->longitude, $message->latitude, $message->caption, $message->url)
                        : $this->gateway()->sendMessageLocation($receiver, $message->longitude, $message->latitude, $message->caption, $message->url);
                break;
            case 'vcard':
                $id = $this->broadcast 
                        ? $this->gateway()->sendBroadcastVcard($receiver, $message->name, $message->vcard->show())
                        : $this->gateway()->sendVcard($receiver, $message->name, $message->vcard->show());
                break;
            default:
                            
            break;
        }

        while ($this->gateway()->pollMessage());

        return $id;
    }
983741
public static function notRegistered(Client $player, Game $game, $message = null)
    {
        $defaultMessage = sprintf('%s is not registered to game: "%s"', $player, $game);
        $message = is_null($message) ? $defaultMessage : $message;

        return new static($message);
    }
1070522
@Override
    public void sendNotification(NotificationContext notificationContext) {
        SystemAssert.requireArgument(notificationContext != null, "Notification context cannot be null.");

        Map<String, String> additionalFields = new HashMap<>();

        additionalFields.put("Notification status", "Notification created.");
        _createAnnotation(notificationContext, additionalFields);
        sendAdditionalNotification(notificationContext);
        _dispose();
    }
19897
public function sendMessageTo( $message, $receiver )
	{
		if( is_string( $receiver ) )
			$receiver	= new Net_XMPP_JID( $receiver );
		if( !$this->xmpp )
			throw new RuntimeException( 'Not connected to Server.' );
		$this->xmpp->message( $receiver->get(), $message );
	}
581895
public function setReceiver(Receiver $receiver) {
        $this->pk = $receiver->getPrimaryKey();
        $this->class = get_class($receiver);
    }
1150923
public function sendNow($notifiables, $notification)
    {
        if (! $notifiables instanceof Collection && ! is_array($notifiables)) {
            $notifiables = [$notifiables];
        }

        $original = clone $notification;

        foreach ($notifiables as $notifiable) {
            $notification = clone $original;

            $notification->id = (string) Uuid::uuid4();

            $channels = $notification->via($notifiable);

            if (empty($channels)) {
                continue;
            }

            foreach ($channels as $channel) {
                if (! $this->shouldSendNotification($notifiable, $notification, $channel)) {
                    continue;
                }

                $response = $this->driver($channel)->send($notifiable, $notification);

                $this->app->make('events')->fire(
                    new Events\NotificationSent($notifiable, $notification, $channel, $response)
                );
            }
        }
    }
1178725
public function send($notifiable, Notification $notification)
    {
        if (! $url = $notifiable->routeNotificationFor('Webhook')) {
            return;
        }

        $webhookData = $notification->toWebhook($notifiable)->toArray();

        $response = $this->client->post($url, [
            'body' => json_encode(Arr::get($webhookData, 'data')),
            'verify' => false,
            'headers' => Arr::get($webhookData, 'headers'),
        ]);

        if ($response->getStatusCode() >= 300 || $response->getStatusCode() < 200) {
            throw CouldNotSendNotification::serviceRespondedWithAnError($response);
        }
    }
258823
def send_private_message(self):
        
        message_info = docs.MESSAGE_FILE
        with self.term.open_editor(message_info) as text:
            if not text:
                self.term.show_notification('Canceled')
                return

            parts = text.split('\n', 2)
            if len(parts) == 1:
                self.term.show_notification('Missing message subject')
                return
            elif len(parts) == 2:
                self.term.show_notification('Missing message body')
                return

            recipient, subject, message = parts
            recipient = recipient.strip()
            subject = subject.strip()
            message = message.rstrip()

            if not recipient:
                self.term.show_notification('Missing recipient')
                return
            elif not subject:
                self.term.show_notification('Missing message subject')
                return
            elif not message:
                self.term.show_notification('Missing message body')
                return

            with self.term.loader('Sending message', delay=0):
                self.reddit.send_message(
                    recipient, subject, message, raise_captcha_exception=True)
                # Give reddit time to process the message
                time.sleep(2.0)

            if self.term.loader.exception:
                raise TemporaryFileError()
            else:
                self.term.show_notification('Message sent!')
                self.selected_page = self.open_inbox_page('sent')
382932
public function send($notifiable, Notification $notification)
    {
        $message = $notification->toSlack();

        $this->http->post($notifiable, $this->buildJsonPayload($message));
    }
311954
private function _sendNotification($aDiff, &$oRemoteApp, $aNewHistory)
        {

            // parse template
            $sHtml = $this->getContainer()->get('templating')->render('SlashworksAppBundle:Email:cron_notification.html.twig', array(
                'diff'       => $aDiff,
                'log'        => $aNewHistory['Log'],
                'remote_app' => $oRemoteApp,
                'controlurl' => $this->_getSiteURL()
            ));

            // get recipients
            $sRecipient = $oRemoteApp->getNotificationRecipient();
            // get sender
            $sSender = $oRemoteApp->getNotificationSender();

            // set subject and body of mail
            $sMessage = \Swift_Message::newInstance()->setSubject($this->getContainer()->get('translator')->trans('system.email.change.subject'))->setFrom($sSender)->setTo($sRecipient)->setContentType('text/html')->setBody($sHtml, 'text/html')->addPart($sHtml, 'text/html');

            // send email
            $this->getContainer()->get('mailer')->send($sMessage);
        }
800837
def send_notify(self, playingsong, content=''):
        ''''''
        title = playingsong['title'].decode('utf-8')
        content = content.decode('utf-8')
        if title == self.title:
            if self.has_cover:
                send_notification(self.title, content, self.cover_file.name)
            else:
                send_notification(self.title, content)
        else:
            self.init_notification(playingsong)
            self.title = title
502398
public function sendNotificationInOne( $subscriber, $contentObject, $commentList = null, $tpl = null )
    {
         if ( is_null( $tpl ) )
         {
             $tpl = eZTemplate::factory();
         }
         $tpl->setVariable( 'subscriber', $subscriber );
         $tpl->setVariable( 'contentobject', $contentObject );
         if ( !is_null( $commentList ) )
         {
            $tpl->setVariable( 'comment_list', $commentList );
         }
         $subject = $tpl->fetch( $this->multiSubjectTemplatePath );
         $body = $tpl->fetch( $this->multiBodyTemplatePath );
         $this->executeSending( $subject, $body, $subscriber );
    }
935381
public function sendToUser($notification, $context, $user, $data)
    {
        if (!($user instanceof Member)) {
            // don't send to non-member user object types
            return;
        }
        $subject = $notification->format($notification->Title, $context, $user, $data);

        $content = $notification->NotificationContent();

        if (!Config::inst()->get(SystemNotification::class, 'html_notifications')) {
            $content = strip_tags($content);
        }

        $message = $notification->format(
            $content,
            $context,
            $user,
            $data
        );

        if ($template = $notification->getTemplate()) {
            $templateData = $notification->getTemplateData($context, $user, $data);
            $templateData->setField('Body', $message);
            try {
                $body = $templateData->renderWith($template);
            } catch (Exception $e) {
                $body = $message;
            }
        } else {
            $body = $message;
        }

        $notice = InternalNotification::create([
            'Title' => $subject,
            'Message' => $body,
            'ToID'      => $user->ID,
            'FromID'    => Member::currentUserID(),
            'SentOn'    => date('Y-m-d H:i:s'),
            'Context' => [
                'ClassName' => get_class($context),
                'ID' => $context->ID,
                'Link' => $context->hasMethod('Link') ? $context->Link() : ''
            ]
        ]);

        $notice->write();
    }
1304451
public function send($notifiable, Notification $notification)
    {
        $client = new SmsClient($this->endPoint, $this->token);
        $payload = $notification->toMMSms($notifiable);
        
        $client->send($payload);
    }