1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
consentresponsemail.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Sender\Integration\Sender\Mail;
4
5
use Bitrix\Main\ArgumentException;
6
use Bitrix\Sender\Consent\AbstractConsentResponse;
7
use Bitrix\Sender\Consent\Consent;
8
use Bitrix\Sender\Consent\iConsentResponse;
9
use Bitrix\Sender\ContactTable;
10
use Bitrix\Sender\Internals\Model\Posting\RecipientTable;
11
use Bitrix\Sender\Recipient;
12
use Bitrix\Sender\Transport\iBase;
13
14
class
ConsentResponseMail
extends
AbstractConsentResponse
15
{
16
const
CODE
= iBase::CODE_MAIL;
17
private
$fields;
18
27
public
function
loadData
(
$data
):
iConsentResponse
28
{
29
if
(is_string(
$data
))
30
{
31
$this->fields = Consent::decodeTag(
$data
);
32
}
elseif
(is_array(
$data
))
33
{
34
$this->fields =
$data
;
35
}
else
36
{
37
throw
new
ArgumentException
(
""
);
38
}
39
return
$this;
40
}
41
42
protected
function
isContactUpdated
($apply)
43
{
44
$typeId =
Recipient\Type::detect
($this->fields[
'CODE'
]);
45
$code
=
Recipient\Normalizer::normalize
($this->fields[
'CODE'
], $typeId);
46
47
$contact =
ContactTable::getRow
([
48
'select'
=> [
'CODE'
,
'CONSENT_STATUS'
],
49
'filter'
=> [
50
'=ID'
=> $this->
getContactId
(),
51
'=TYPE_ID'
=> $typeId,
52
'=CODE'
=>
$code
,
53
]
54
]);
55
$currentStatus = ($apply ?
ContactTable::CONSENT_STATUS_ACCEPT
:
ContactTable::CONSENT_STATUS_DENY
);
56
57
return
(
58
isset($contact) &&
59
$contact[
'CODE'
] === $this->fields[
'CODE'
] &&
60
$contact[
'CONSENT_STATUS'
] !== $currentStatus
61
);
62
}
63
64
protected
function
getContactId
()
65
{
66
return
$this->fields[
'CONTACT'
];
67
}
68
69
protected
function
getConsentId
()
70
{
71
return
$this->fields[
'CONSENT'
];
72
}
73
74
protected
function
getPostingId
()
75
{
76
return
$this->fields[
'POSTING'
];
77
}
78
}
Bitrix\Main\ArgumentException
Определения
ArgumentException.php:9
Bitrix\Main\ORM\Data\DataManager\getRow
static getRow(array $parameters)
Определения
datamanager.php:398
Bitrix\Sender\Consent\AbstractConsentResponse
Определения
abstractconsentresponse.php:11
Bitrix\Sender\ContactTable\CONSENT_STATUS_DENY
const CONSENT_STATUS_DENY
Определения
contact.php:46
Bitrix\Sender\ContactTable\CONSENT_STATUS_ACCEPT
const CONSENT_STATUS_ACCEPT
Определения
contact.php:47
Bitrix\Sender\Integration\Sender\Mail\ConsentResponseMail
Определения
consentresponsemail.php:15
Bitrix\Sender\Integration\Sender\Mail\ConsentResponseMail\CODE
const CODE
Определения
consentresponsemail.php:16
Bitrix\Sender\Integration\Sender\Mail\ConsentResponseMail\loadData
loadData($data)
Определения
consentresponsemail.php:27
Bitrix\Sender\Integration\Sender\Mail\ConsentResponseMail\isContactUpdated
isContactUpdated($apply)
Определения
consentresponsemail.php:42
Bitrix\Sender\Integration\Sender\Mail\ConsentResponseMail\getConsentId
getConsentId()
Определения
consentresponsemail.php:69
Bitrix\Sender\Integration\Sender\Mail\ConsentResponseMail\getContactId
getContactId()
Определения
consentresponsemail.php:64
Bitrix\Sender\Integration\Sender\Mail\ConsentResponseMail\getPostingId
getPostingId()
Определения
consentresponsemail.php:74
Bitrix\Sender\Recipient\Normalizer\normalize
static normalize($code, $typeId=Type::EMAIL)
Определения
normalizer.php:28
Bitrix\Sender\Recipient\Type\detect
static detect($recipientCode, $isNormalized=false)
Определения
type.php:39
$data
$data['IS_AVAILABLE']
Определения
.description.php:13
Bitrix\Sender\Consent\iConsentResponse
Определения
iconsentresponse.php:6
$code
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения
options.php:195
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
bitrix
modules
sender
lib
integration
sender
mail
consentresponsemail.php
Создано системой
1.14.0