97 $tag = Consent::encodeTag(
$fields);
98 $dir = static::getLink($siteId);
102 $result = $dir .
'?' . static::buildQuery([
'consent' =>
'apply',
'type' => static::CODE,
'tag' => $tag]);
105 $result = $dir .
'?' . static::buildQuery([
'consent' =>
'reject',
'type' => static::CODE,
'tag' => $tag]);
108 throw new \InvalidArgumentException(
"Type is out of range");
118 protected static function getLink($siteId): ?string
121 if (static::checkUri($siteId))
127 && defined(
'BX24_HOST_NAME')
128 && !in_array(mb_substr(BX24_HOST_NAME, -7), [
'.com.br',
'.com.de'])
131 $domain = BX24_HOST_NAME;
132 if (!\CBitrix24::isCustomDomain())
134 $domain = preg_replace(
'/^([-\.\w]+)\.bitrix24\.([-\.\w]+)/',
'$2.$1', $domain);
135 $domain =
"mailinternetsub.com/" . $domain;
137 $uri =
"https://$domain$uri";