- Модуль: calendar
- Путь к файлу: ~/bitrix/modules/calendar/lib/sharing/notification/notificationservice.php
- Класс: BitrixCalendarSharingNotificationNotificationService
- Вызов: NotificationService::sendMessage
protected function sendMessage(string $phoneNumber, string $templateCode, array $placeholders): bool
{
if (!self::includeNotificationsModule())
{
return false;
}
$parsedPhone = PhoneNumberParser::getInstance()->parse($phoneNumber);
$countryCode = mb_strtolower($parsedPhone->getCountry());
if (!$parsedPhone->isValid() || in_array($countryCode, self::ALLOWED_COUNTRY_CODES, true))
{
return false;
}
$phoneNumberE164 = $parsedPhone->format(PhoneNumberFormat::E164);
return NotificationsModelMessage::create([
'PHONE_NUMBER' => $phoneNumberE164,
'TEMPLATE_CODE' => $templateCode,
'LANGUAGE_ID' => LANGUAGE_ID,
'PLACEHOLDERS' => $placeholders,
])->enqueue()->isSuccess();
}