Queue notification and redirect.

@param  string  $to
@param  string|null  $message
@param  string  $type

@return \Illuminate\Http\RedirectResponse
492199
public function redirectWithMessage(
        string $to,
        ?string $message = null,
        string $type = 'success'
    ): RedirectResponse {
        return \redirect_with_message($to, $message, $type);
    }
626428
public function flashMessage($message, string $type = 'info'): stdClass
	{
		parent::flashMessage($message, $type);
		return $this->presenter->flashMessage($message, $type);
	}
482742
public function message($to, $body, $type = 'chat', $subject = null, $payload = null) {
	    if(is_null($type))
	    {
	        $type = 'chat';
	    }
	    
		$to	  = htmlspecialchars($to);
		$body	= htmlspecialchars($body);
		$subject = htmlspecialchars($subject);
		
		$out = "<message from=\"{$this->fulljid}\" to=\"$to\" type='$type'>";
		if($subject) $out .= "<subject>$subject</subject>";
		$out .= "<body>$body</body>";
		if($payload) $out .= $payload;
		$out .= "</message>";
		
		$this->send($out);
	}
26754
public function it($message, $closure = null, $timeout = null, $type = 'normal')
    {
        return $this->_block->it($message, $closure, $timeout, $type);
    }
648030
public function call($to, $message, array $params = [])
    {
        if (is_callable($message)) {
            $query = http_build_query([
                'Twiml' => $this->twiml($message),
            ]);

            $message = 'https://twimlets.com/echo?'.$query;
        }

        $params['url'] = $message;

        return $this->getTwilio()->calls->create(
            $to,
            $this->from,
            $params
        );
    }
986353
public function addNotification(string $type, string $message, string $title = '', array $options = []): self
    {
        $this->notifications[] = [
            'type'    => in_array($type, $this->allowedTypes, true) ? $type : self::WARNING,
            'title'   => $this->escapeSingleQuote($title),
            'message' => $this->escapeSingleQuote($message),
            'options' => json_encode($options),
        ];

        $this->session->flash(self::TOASTR_NOTIFICATIONS, $this->notifications);

        return $this;
    }
1039920
protected function sendSmsMessage(TwilioSmsMessage $message, $to)
    {
        $params = [
            'body' => trim($message->content),
        ];

        if ($messagingServiceSid = $this->getMessagingServiceSid($message)) {
            $params['messagingServiceSid'] = $messagingServiceSid;
        }

        if ($from = $this->getFrom($message)) {
            $params['from'] = $from;
        }

        if (! $from && ! $messagingServiceSid) {
            throw CouldNotSendNotification::missingFrom();
        }

        $this->fillOptionalParams($params, $message, [
            'statusCallback',
            'statusCallbackMethod',
            'applicationSid',
            'maxPrice',
            'provideFeedback',
            'validityPeriod',
        ]);

        if ($message instanceof TwilioMmsMessage) {
            $this->fillOptionalParams($params, $message, [
                'mediaUrl',
            ]);
        }

        return $this->twilioService->messages->create($to, $params);
    }
1371536
protected function _handleRedirect($type, $options) {
		if (isset($options[$type . 'RedirectUrl']) && $options[$type . 'RedirectUrl'] !== false) {
			$controller = $this->getController();
			$result = $controller->redirect($options[$type . 'RedirectUrl']);
			$this->_redirectResponse = $result;

			return $result;
		}

		$this->_redirectResponse = null;

		return false;
	}
1309244
public function addMessage($message, $type) {
		if (isset($_SESSION[$this->sessionKey]))
		{
			$messages = $_SESSION[$this->sessionKey];
		}
		
		$messages[] = [
			'message' => $message,
			'type' => $type,
		];
		
		$_SESSION[$this->sessionKey] = $messages;
	}
1006684
public function notify($to, $message)
    {
        $params = [
            'From' => $this->config['from'],
            'To'   => $to,
            'Body' => $message,
        ];

        return $this->send($this->buildUrlFromString('Accounts/'.$this->config['client'].'/SMS/Messages.json'), $params);
    }
1036590
public function showMessage(int $type, string $message): Promise
    {
        return $this->handler->notify('window/showMessage', ['type' => $type, 'message' => $message]);
    }
1075578
public function notification($string, $type = null)
    {
        if (is_null($type)) {
            $type = 'info';
        }

        Session::flash('notification', $string);
        Session::flash('notificationType', 'alert-'.$type);
    }
684722
protected function output($message, $type = self::OUTPUT_INFO)
    {
        $output = $this->getOutput();

        if ($output === null) {
            return;
        }

        // Chose color type of message
        switch ($type) {
            case self::OUTPUT_COMMENT:
                $logMethod = 'info';
                $prefix = '<comment>';
                $postfix = '</comment>';
                break;

            case self::OUTPUT_ERROR:
                $logMethod = 'critical';
                $prefix = '<error>';
                $postfix = '</error>';
                break;

            case self::OUTPUT_INFO:
            default:
                $logMethod = 'info';
                $prefix = '<info>';
                $postfix = '</info>';
                break;
        }

        $psrLogBase = self::PSR_LOG_BASE;
        $consoleBase = self::SYMFONY_CONSOLE_BASE;

        if ($output instanceof $psrLogBase) {
            $output->$logMethod($message);

        } else {
            if ($output instanceof $consoleBase) {
                $output->writeln($prefix . $message . $postfix);
            }
        }

    }
564352
public function message($type = null)
    {
        switch ($type) {
            case static::MESSAGE_HTML:
                return $this->_htmlMessage;
            case static::MESSAGE_TEXT:
                return $this->_textMessage;
        }

        return $this->_message;
    }
1252272
public function add($type, $message, $title = null)
    {
        $notifications = $this->getNotifications();

        $notifications[] = [
            'type'    => $type,
            'message' => $message,
            'title'   => $title
        ];

        $this->session->flash(self::SESSION_KEY, $notifications);
    }
727129
public function send($message, $type = self::TYPE_POST)
    {
        if ($message instanceof ProfileInterface) {
            return $this->sendProfile($message->toData(), $type);
        }

        if ($message instanceof UserInterface) {
            return $this->sendUserApi($message);
        }

        if ($message instanceof CodeInterface) {
            return $this->sendMessengerCode($message->toData());
        }

        return $this->sendMessage($message->toData());
    }
1290649
public function sendUserMessage($id, $message, $type = 'popup_chat')
    {
        if ($this->isEmptyId($id)) {
            throw new InvalidArgumentException;
        }

        if (!$message) {
            throw new InvalidArgumentException;
        }

        if (!in_array($type, ['popup_chat', 'popup_small', 'popup_big', 'email'])) {
            throw new InvalidArgumentException;
        }

        $params = [
            'body' => $message,
            'type' => $type
        ];
        $res = $this->call('users/' . $id . '/sendmessage', $params, 'post');

        if ($res) {
            return true;
        }

        return false;
    }