40 $ownerStatus = $this->
getOwner()[
'STATUS'];
42 return $ownerStatus ===
'N';
49 $subject = Loc::getMessage(
'EC_CALENDAR_SHARING_MAIL_SUBJECT_CREATED');
50 $ownerName = $this->
getOwner()[
'NAME'];
53 'STATUS' => self::MEETING_STATUS_CREATED,
71 if ($this->initiatorId === $this->eventLink->getHostId())
79 $ownerName = (string)($ownerInfo[
'NAME'] ??
'');
82 $initiatorName = (string)($initiatorInfo[
'NAME'] ??
'');
86 'STATUS' => self::MEETING_STATUS_CANCELLED,
88 'WHO_CANCELLED' => $initiatorName,
91 $mailParams = array_merge($mailParams, $baseMailParams);
95 return $this->
sendMessage($to, $mailParams, $subject);
100 $initiatorName = (string)($initiatorInfo[
'NAME'] ??
'');
101 $initiatorGender = (string)($initiatorInfo[
'GENDER'] ??
'');
103 if ($initiatorGender ===
'F')
105 return Loc::getMessage(
'EC_CALENDAR_SHARING_MAIL_SUBJECT_CANCELLED_F', [
'#NAME#' => $initiatorName]);
108 return Loc::getMessage(
'EC_CALENDAR_SHARING_MAIL_SUBJECT_CANCELLED_M', [
'#NAME#' => $initiatorName]);
113 if ($this->crmDealLink ===
null)
128 return Loc::getMessage(
'EC_CALENDAR_SHARING_MAIL_SUBJECT_INVITE_LINK');
137 'STATUS' => self::STATUS_INVITE_LINK,
138 'OWNER_AVATAR' => $owner[
'photo'] ??
'',
139 'OWNER_NAME' =>
"{$owner['name']} {$owner['lastName']}",
151 $ownerName = $this->
getOwner()[
'NAME'];
153 $gender = $this->
getOwner()[
'GENDER'];
155 $subject = Loc::getMessage(
'EC_CALENDAR_SHARING_MAIL_SUBJECT_CANCELLED', [
'#NAME#' => $ownerName]);
158 $subject = Loc::getMessage(
'EC_CALENDAR_SHARING_MAIL_SUBJECT_CANCELLED_M', [
'#NAME#' => $ownerName]);
160 else if ($gender ===
'F')
162 $subject = Loc::getMessage(
'EC_CALENDAR_SHARING_MAIL_SUBJECT_CANCELLED_F', [
'#NAME#' => $ownerName]);
166 'STATUS' => self::MEETING_STATUS_CANCELLED,
168 'WHO_EDITED' => $ownerName,
182 'SUBJECT' => $subject,
185 if (\CCalendar::IsBitrix24())
187 $fields[
'DEFAULT_EMAIL_FROM'] = Loc::getMessage(
'EC_CALENDAR_SHARING_MAIL_BITRIX24_FROM');
190 return \CEvent::SendImmediate(
204 'IS_FULL_DAY' => $this->
event->isFullDayEvent(),
205 'DATE_FROM' => $this->
event->getStart()->format(),
206 'DATE_TO' => $this->
event->getEnd()->format(),
207 'TZ_FROM' => $this->
event->getStartTimeZone()?->getTimeZone()->getName(),
208 'TZ_TO' => $this->
event->getEndTimeZone()?->getTimeZone()->getName(),
221 if (!is_null($parentLink))
223 foreach ($parentLink->getMembers() as $member)
225 $avatars[] = empty($member->getAvatar()) ?
'/bitrix/images/1.gif' : $member->getAvatar();
245 $timestamp = $this->eventLink->getCanceledTimestamp();
249 $timeFormat =
$culture->get(
'SHORT_TIME_FORMAT');
250 $formatLong =
"$dayMonthFormat $timeFormat";
259 protected function getIcsFileId(
string $organizerName,
string $eventName): ?int
263 $icsManager = IcsManager::getInstance();
264 $fileId = $icsManager->createIcsFile($this->event->setName($eventName), [
265 'eventUrl' =>
Sharing\Helper::getShortUrl($this->eventLink->getUrl()),
266 'conferenceUrl' =>
Sharing\Helper::getShortUrl($this->eventLink->getUrl() .
Sharing\Helper::ACTION_CONFERENCE),
268 'name' => $organizerName,
269 'email' => $this->getOrganizerEmail(),
271 'attendees' => $this->getAttendees(),
287 return 'no-reply@bitrix24.ru';
290 return 'no-reply@bitrix24.com';
297 if (!empty($sharingAttendee))
299 return [$sharingAttendee];
307 $attendeesCollection = $this->
event->getAttendeesCollection();
308 $attendeesCodes = $attendeesCollection?->getAttendeesCodes();
312 if (!empty($attendeesCodes))
314 $userIds = \CCalendar::GetDestinationUsers($attendeesCodes);
321 ->setSelect([
'PERSONAL_MAILBOX',
'EXTERNAL_AUTH_ID'])
322 ->whereIn(
'ID', array_map(
'intval', $userIds))
326 while (
$user = $usersResult->fetch())
330 if ($isSharingUser && !empty(
$user[
'PERSONAL_MAILBOX']))
343 $ownerId = $this->eventLink->getOwnerId();
344 $calendarLink = $this->
getCalendarLink() ?? $this->eventLink->getUrl();
static getOwnerInfo(int $id)
static getEmailAbuseLink(int $ownerId, string $calendarLink)
notifyAboutMeetingCancelled(string $to)
const MEETING_STATUS_CANCELLED
sendMessage(string $to, array $arParams, string $subject, ?array $files=null)
getIcsFileId(string $organizerName, string $eventName)
notifyAboutMeetingCreated(string $to)
getInviteLinkParams(Sharing\Link\CrmDealLink $crmDealLink)
sendInviteLink(string $to)
getAvatars(?Sharing\Link\Joint\JointLink $parentLink)
notifyAboutSharingEventEdit(string $to)
notifyAboutMeetingStatus(string $to)
getBaseMailParams(string $ownerName)
getCancelMeetingSubject(array $initiatorInfo)
const MEETING_STATUS_CREATED
static setCanceledTimeOnSharedLink(int $eventId)
static getSharingEventNameByUserName(?string $userName)
static reSaveEventWithoutAttendeesExceptHostAndSharingLinkOwner(Sharing\Link\EventLink $eventLink)
static convertFormatToPhp($format)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
FormatDate($format="", $timestamp=false, $now=false, ?string $languageId=null)