76 $manager = Sharing\Helper::getOwnerInfo($this->crmDealLink->getOwnerId());
79 'MANAGER_NAME' => Sharing\Helper::getPersonFullNameLoc($manager[
'name'], $manager[
'lastName']),
80 'DATE' => Sharing\Helper::formatDate($this->event->getStart()),
81 'EVENT_URL' => Sharing\Helper::getShortUrl($this->eventLink->getUrl()),
84 'DATE_SHORT' => Sharing\Helper::formatDateShort($this->event->getStart()),
87 return $this->
sendMessage($to, self::TEMPLATE_CRM_SHARING_AUTO_ACCEPTED, $placeholders);
96 protected function sendMessage(
string $phoneNumber,
string $templateCode, array $placeholders): bool
98 if (!self::includeNotificationsModule())
103 $parsedPhone = PhoneNumber\Parser::getInstance()->parse($phoneNumber);
104 $countryCode = mb_strtolower($parsedPhone->getCountry());
105 if (!$parsedPhone->isValid() || in_array($countryCode, self::ALLOWED_COUNTRY_CODES,
true))
111 return Notifications\Model\Message::create([
112 'PHONE_NUMBER' => $phoneNumberE164,
113 'TEMPLATE_CODE' => $templateCode,
114 'LANGUAGE_ID' => LANGUAGE_ID,
115 'PLACEHOLDERS' => $placeholders,
116 ])->enqueue()->isSuccess();
146 protected function getPlaceholders(
string $templateCode, array $owner, ?
string $calendarLink): array
148 $eventName = Sharing\SharingEventManager::getSharingEventNameByUserName($owner[
'NAME']);
150 $calendarOwner = $owner[
'NAME'];
151 $eventLink = Sharing\Helper::getShortUrl($this->eventLink->getUrl());
153 if ($templateCode === self::TEMPLATE_Q)
156 'EVENT_NAME' => $eventName,
157 'DATE' => $eventDateTime,
158 'NAME' => $calendarOwner,
163 if ($templateCode === self::TEMPLATE_Y)
166 'EVENT_NAME' => $eventName,
167 'DATE' => $eventDateTime,
168 'NAME' => $calendarOwner,
173 if ($templateCode === self::TEMPLATE_N)
176 'EVENT_NAME' => $eventName,
177 'DATE' => $eventDateTime,
178 'NAME' => $calendarOwner,
179 'URL' => $calendarLink,
183 if ($templateCode === self::TEMPLATE_N_NO_LINK)
186 'EVENT_NAME' => $eventName,
187 'DATE' => $eventDateTime,
188 'NAME' => $calendarOwner,