• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/automaticaction/welcome.php
  • Класс: BitrixImOpenLinesAutomaticActionWelcome
  • Вызов: Welcome::sendMessage
public function sendMessage()
{
	$result = false;

	if (
		$this->config['WELCOME_MESSAGE'] == 'Y'
		&& isset($this->config['WELCOME_MESSAGE_TEXT'])
		&& $this->session['SOURCE'] != Connector::TYPE_NETWORK
		&& $this->sessionManager->isEnableSendSystemMessage()
	)
	{
		$result = Im::addAutomaticSystemMessage(
			$this->session['CHAT_ID'],
			$this->config['WELCOME_MESSAGE_TEXT']
		);

		if ($this->session['SOURCE'] === Connector::TYPE_LIVECHAT && $this->clientChat)
		{
			$this->clientChat->updateFieldData([Chat::FIELD_LIVECHAT => ['WELCOME_TEXT_SENT' => 'Y']]);
		}
	}

	if ($this->isWelcomeFormNeeded())
	{
		$this->sendWelcomeForm();
	}

	return $result;
}