• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/mail/callback/controller.php
  • Класс: BitrixMainMailCallbackController
  • Вызов: Controller::processItem
public function processItem($item)
{
	$this->validateItem($item);

	$this->config->unpackId($item['id']);
	if (!$this->config->verifySignature($item['sign']))
	{
		throw new SystemException('Item parameter `sign` is invalid.');
	}

	if (!$this->config->getEntityId())
	{
		return false;
	}

	$email = $this->address->set($item['email'])->getEmail();
	if (!$email)
	{
		return false;
	}

	if (!empty($item['sender']) && self::isSmtpLimited($item['statusDescription']) )
	{
		$this->smtpLimited[] = $this->address->set($item['sender'])->getEmail();
	}

	$this->result
		->setModuleId($this->config->getModuleId())
		->setEntityType($this->config->getEntityType())
		->setEntityId($this->config->getEntityId())
		->setEmail($email)
		->setDateSent((int) $item['completedAt'])
		->setError(self::isStatusError($item['status']))
		->setPermanentError(self::isStatusPermanentError($item['status']))
		->setBlacklistable(self::isBlacklistable($item['statusDescription']))
		->setDescription($item['statusDescription'])
		->setMessage($item['message']);

	if ($this->result->isPermanentError() && $this->result->isBlacklistable())
	{
		$this->blacklist[] = $this->result->getEmail();
	}

	$this->result->sendEvent();

	return true;
}