- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/lib/mail/sender.php
- Класс: BitrixMainMailSender
- Вызов: Sender::removeEmailLimit
static function removeEmailLimit(string $email): bool
{
$address = new BitrixMainMailAddress($email);
if (!$address->validate())
{
return false;
}
$email = $address->getEmail();
$cache = new CPHPCache();
$cache->clean($email, '/main/mail/limit');
$res = InternalSenderTable::getList(array(
'filter' => array(
'IS_CONFIRMED' => true,
'=EMAIL' => $email,
),
'order' => array(
'ID' => 'DESC',
),
));
while ($item = $res->fetch())
{
if (isset($item['OPTIONS']['smtp']['limit']))
{
unset($item['OPTIONS']['smtp']['limit']);
InternalSenderTable::update($item['ID'], ['OPTIONS' => $item['OPTIONS']]);
}
}
return true;
}