Sends the notification to the given Android device.

@return $this
13709
protected function send()
    {
        try {
            $options = $this->getOptions();

            $message = sprintf(
                'Service: %2$s' . PHP_EOL .
                'Host: %3$s' . PHP_EOL .
                'State: %5$s' . PHP_EOL .
                'Message: %7$s',
                $options['type'],
                $options['service'],
                $options['host'],
                $options['address'],
                $options['state'],
                $options['time'],
                $options['output']
            );

            $priority = $this->determinePriority($options['state']);

            // verify API key
            $this->nmaClient->verify();

            // send notification
            $this->nmaClient->notify(
                self::SENDER,
                $options['type'],
                $message,
                $priority,
                'anag://open?updateonreceive=true'
            );

            $this->setMessage('Message was sent');
            $this->setCode(self::STATE_OK);
        } catch (Exception $e) {
            $this->setMessage(
                'Message could not be sent. Error from NMA client: ' .
                $e->getMessage()
            );
            $this->setCode(self::STATE_CRITICAL);
        }

        return $this;
    }
593836
public function sendMusic(){
        $music  = func_get_args();
        $openid = array_shift($music);
        return $this->messageCustomSend($openid, $music, self::MSG_TYPE_MUSIC);
    }
28583
public function Send()
	{
		$tscall = array("TriggeredSendDefinition" => $this->props , "Subscribers" => $this->subscribers);
		$response = new ET_Post($this->authStub, "TriggeredSend", $tscall);
		return $response;
	}
779531
public function send()
    {
        if ($this->sent()) {
            throw new Exceptions\HeadersAlreadySentException(
                "Headers already sent"
            );
        }

        $this->sent = true;

        foreach ($this as $header) {
            $header->send();
        }

        return $this;
    }
338667
public function startApproval() {
		$this->Status = 'Started';
		$this->log("Starting {$this->Title}...");
		// Determine if we should use delayed notification
		$recipientGroup = 'all';
		if($this->getConfigSetting('RecipientsDelay')) {
			$this->NotifiedGroup = $recipientGroup = 0;
		}
		// Send to selected group
		$this->sendMessage(self::ALERT_REQUEST, $recipientGroup);
		$this->write();
		return true;
	}
1069315
public function send()
    {
        $this->addHeaders();

        $this->meta = call_user_func($this->map, $this->options);

        return $this;
    }
447978
public function send()
    {
        if (empty($this->message)) {
            throw new RuntimeException('No message to send.');
        }

        $transformer = new Transformer();

        if ($this->message instanceof RawMessage) {
            $message = $this->message->get('content');
        } else {
            $content = $transformer->transform($this->message);

            $message = array_merge($this->to, ['agentid' => $this->agentId], ['safe' => $this->safe], $content);
        }

        return $this->broadcast->send($message);
    }
798100
public function sendNotification($notification)
    {
        $subscriberIds = $notification->subscriberIds->toArray();
        $query = $this->getService('repos:people.person')
                       ->getQuery(true)
                       ->id($subscriberIds);

        $people = $query->fetchSet();

        $settings = $this->getService('repos:notifications.setting')
                         ->getQuery(true, array('actor.id' => $notification->target->id))
                         ->fetchSet();

        $settings = AnHelperArray::indexBy($settings, 'person.id');

        $mails = $this->_renderMails(array(
                        'notification' => $notification,
                        'people' => $people,
                        'settings' => $settings
                    ));

        $this->mail($mails);
    }
780452
public function send()
  {
    // Set headers
    $this->setContentType('application/json');

    /** @var PhrestRequest $request */
    $request = $this->getDI()->get('request');

    // Set content
    if (!$request->isHead())
    {
      if (empty($this->messages))
      {
        $this->messages = null;
      }
      if (empty($this->data))
      {
        $this->data = null;
      }

      if ($request->isPretty())
      {
        $this->setContent(json_encode($this, JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK));
      }
      else
      {
        $this->setContent(json_encode($this, JSON_NUMERIC_CHECK));
      }
    }

    // Send content
    return parent::send();
  }
474988
public function sendContent()
    {
        if (!$this->isSuccessful()) {
            return parent::sendContent();
        }

        if (0 === $this->maxlen) {
            return $this;
        }

        $out = fopen('php://output', 'wb');
        $file = fopen($this->file->getPathname(), 'rb');

        stream_copy_to_stream($file, $out, $this->maxlen, $this->offset);

        fclose($out);
        fclose($file);

        if ($this->deleteFileAfterSend && file_exists($this->file->getPathname())) {
            unlink($this->file->getPathname());
        }

        return $this;
    }
1059111
public function notify($notify_class = '')
    {
        $model = $this->recipient();
        $pool = $this->pool($model);

        $notify_class = (is_string($notify_class) && $notify_class) ? $notify_class : $pool->notification;

        if (method_exists($this->reference, 'getMentionNotification')) {
            $notify_class = $this->reference->getMentionNotification($model);
        }

        if (class_exists($notify_class)) {
            $model->notify(new $notify_class($this->reference));
        }

        return $this;
    }
561592
public function touch()
    {
        if ($this->storage->supportsTouching()) {
            $this->storage->touchKey($this->key);
            $this->timeModified = null;
        }

        return $this;
    }
324413
public function sendNotificationIfUpdatesAvailable()
    {
        $pluginsHavingUpdate = $this->getPluginsHavingUpdate();

        if (empty($pluginsHavingUpdate)) {
            return;
        }

        $pluginsToBeNotified = array();

        foreach ($pluginsHavingUpdate as $plugin) {
            if ($this->hasNotificationAlreadyReceived($plugin)) {
                continue;
            }

            $this->setHasLatestUpdateNotificationReceived($plugin);

            $pluginsToBeNotified[] = $plugin;
        }

        if (!empty($pluginsToBeNotified)) {
            $this->sendNotifications($pluginsToBeNotified);
        }
    }
906549
public function notify(NotifyRequest $notification): Response
    {
        if ($this->appID !== null) {
            $notification->setApplicationIdentification($this->appID);
        }

        $response = $this->sendRequest($notification);
        return $response;

    }
165569
public function send()
    {
    	if(!$this->getTemplate()->getIsActive())
    	{
    		return $this;
    	}
    	
        if(!$this->isRendered())
	    {
	      $this->render();
	    }
	    
    	$eventParams = array(
    			'mailer'    => $this->getMailer(),
    			'message'   => $this->getMessage(),
    			'template'  => $this->getTemplate()
    	);

    	$this->getMailer()->send($this->getMessage());
    	$this->sentMailer->createSentMail($this->getTemplate());
    
    	return $this;
    }
513098
public function send()
    {
        if (empty($this->firstDueDate)) {
            self::setFirstDueDate(\Carbon\Carbon::now()->addDays(3));
        }

        if (empty($this->numberOfPayments)) {
            self::setNumberOfPayments(1);
        }

        $this->validatePaymentSettings();

        $config = [
            'reference'         => $this->reference,
            'amount'            => $this->amount,
            'notificationURL'   => $this->notificationURL,
            'description'       => $this->description,
            'instructions'      => $this->instructions,
            'periodicity'       => 'monthly',
            'numberOfPayments'  => $this->numberOfPayments,
            'firstDueDate'      => $this->firstDueDate,
        ];

        $custumerArray = array_merge($this->custumer['customer'], ['address' => $this->custumer['address']]);

        $data = array_filter(array_merge($config, ['customer' => $custumerArray]));

        return $this->sendJsonTransaction($data, $this->url['boletos'], 'POST', ['Accept: application/json;charset=ISO-8859-1', 'Content-type: application/json;charset=ISO-8859-1']);
    }
264315
public function setToDevice(\Sopinet\ChatBundle\Entity\Device $toDevice = null)
    {
        $this->toDevice = $toDevice;

        return $this;
    }