• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sharing/notification/mail.php
  • Класс: BitrixCalendarSharingNotificationMail
  • Вызов: Mail::sendMessage
protected function sendMessage(string $to, array $arParams, string $subject, ?array $files = null): bool
{
	$from = '';
	if (CCalendar::IsBitrix24())
	{
		$from = Loc::getMessage('EC_CALENDAR_SHARING_MAIL_BITRIX24_FROM');
	}

	$cFields = [
		'EMAIL_FROM' => $from,
		'EMAIL_TO' => $to,
		'SUBJECT' => $subject,
	];
	$cFields = array_merge($cFields, $arParams);

	$mailEvent = [
		'EVENT_NAME' => 'CALENDAR_SHARING',
		'C_FIELDS' => $cFields,
		'LID' => SITE_ID,
		'DUPLICATE' => 'Y',
		'DATE_INSERT' => (new MainTypeDateTime())->format('Y-m-d H:i:s'),
		'FILE' => $files,
	];

	return MainMailEvent::sendImmediate($mailEvent) === 'Y';
}