Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
unsubscribers.php
1
<?php
9
namespace
Bitrix\Sender\Integration\Sender\Connectors
;
10
11
use \Bitrix\Main\Localization\Loc;
12
use
Bitrix\Sender\Connector\Base
as ConnectorBase;
13
use \Bitrix\Sender\MailingTable;
14
use \Bitrix\Sender\MailingSubscriptionTable;
15
16
Loc::loadMessages
(__FILE__);
17
18
class
UnSubscribers
extends
ConnectorBase
19
{
24
public
function
getName
()
25
{
26
return
Loc::getMessage
(
'sender_connector_unsubscribers_name1'
);
27
}
28
33
public
function
getCode
()
34
{
35
return
"sender_unsubscribers"
;
36
}
37
42
public
function
getData
()
43
{
44
$mailingId = $this->
getFieldValue
(
'MAILING_ID'
, 0);
45
$filter = array();
46
if
($mailingId)
47
{
48
$filter[
'=MAILING_ID'
] = $mailingId;
49
}
50
$mailingDb =
MailingSubscriptionTable::getUnSubscriptionList
(array(
51
'select'
=> array(
52
'SENDER_CONTACT_ID'
=>
'CONTACT.ID'
,
53
'EMAIL'
=>
'CONTACT.CODE'
54
),
55
'filter'
=> $filter,
56
'group'
=> array(
'CONTACT.CODE'
),
57
));
58
59
return
$mailingDb;
60
}
61
66
public
function
getForm
()
67
{
68
$mailingDb = MailingTable::getList(array(
69
'select'
=> array(
'ID'
,
'NAME'
,),
70
'order'
=> array(
'NAME'
=>
'ASC'
,
'ID'
=>
'DESC'
)
71
));
72
$mailingList = $mailingDb->fetchAll();
73
$mailingList = array_merge(
74
array(
75
array(
'ID'
=>
''
,
'NAME'
=>
Loc::getMessage
(
'sender_connector_unsubscribers_all'
))
76
),
77
$mailingList
78
);
79
80
$mailingInput =
'<select name="'
.$this->getFieldName(
'MAILING_ID'
).
'">'
;
81
foreach
($mailingList as $mailing)
82
{
83
$inputSelected = ($mailing[
'ID'
] == $this->
getFieldValue
(
'MAILING_ID'
) ?
'selected'
:
''
);
84
$mailingInput .=
'<option value="'
.$mailing[
'ID'
].
'" '
.$inputSelected.
'>'
;
85
$mailingInput .= htmlspecialcharsbx($mailing[
'NAME'
]);
86
$mailingInput .=
'</option>'
;
87
}
88
$mailingInput .=
'</select>'
;
89
90
return
'
91
<table>
92
<tr>
93
<td>'
.
Loc::getMessage
(
'sender_connector_unsubscribers_mailing'
) .
'</td>
94
<td>'
. $mailingInput .
'</td>
95
</tr>
96
</table>
97
'
;
98
}
99
}
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Sender\Connector\Base
Definition
base.php:13
Bitrix\Sender\Connector\Base\getFieldValue
getFieldValue($name, $defaultValue=null)
Definition
base.php:195
Bitrix\Sender\Integration\Sender\Connectors\UnSubscribers
Definition
unsubscribers.php:19
Bitrix\Sender\Integration\Sender\Connectors\UnSubscribers\getName
getName()
Definition
unsubscribers.php:24
Bitrix\Sender\Integration\Sender\Connectors\UnSubscribers\getForm
getForm()
Definition
unsubscribers.php:66
Bitrix\Sender\Integration\Sender\Connectors\UnSubscribers\getData
getData()
Definition
unsubscribers.php:42
Bitrix\Sender\Integration\Sender\Connectors\UnSubscribers\getCode
getCode()
Definition
unsubscribers.php:33
Bitrix\Sender\MailingSubscriptionTable\getUnSubscriptionList
static getUnSubscriptionList(array $parameters=array())
Definition
mailing.php:838
Bitrix\Sender\Integration\Sender\Connectors
Definition
blacklist.php:9
modules
sender
lib
integration
sender
connectors
unsubscribers.php
Создано системой
1.10.0