• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/posting/sender.php
  • Класс: BitrixSenderPostingSender
  • Вызов: Sender::changeStatusToPart
protected function changeStatusToPart()
{
	if (!$this->postingId)
	{
		return;
	}

	if ($this->status == PostingTable::STATUS_PART)
	{
		return;
	}

	if (
		($this->status !== PostingTable::STATUS_NEW)
		&& !$this->isTrigger
		&& !$this->isReiterate
	)
	{
		return;
	}
	$onBeforeStartResult = $this->message->onBeforeStart();
	if ($onBeforeStartResult->isSuccess())
	{
		$this->status = PostingTable::STATUS_PART;
		ModelPostingTable::update($this->postingId, ['STATUS' => $this->status]);
	}
	else
	{
		static::updateActualStatus($this->postingId, true);
	}

	$errorMessage = implode(', ', $onBeforeStartResult->getErrorMessages());
	if($errorMessage <> '')
	{
		ModelLetterTable::update($this->letterId, ['ERROR_MESSAGE' => $errorMessage]);
	}
}