1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
attachment.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Mail\Integration;
4
5
class
Attachment
6
{
7
public
static
function
downloadAttachmentsByMessageId
(
int
$messageId
): bool
8
{
9
$messageForDownload = \Bitrix\Mail\MailMessageTable::getList([
10
'runtime'
=> [
11
new
\
Bitrix
\
Main
\
Entity
\ReferenceField(
12
'MESSAGE_UID'
,
13
'Bitrix\Mail\MailMessageUidTable'
,
14
[
15
'=this.MAILBOX_ID'
=>
'ref.MAILBOX_ID'
,
16
'=this.ID'
=>
'ref.MESSAGE_ID'
,
17
],
18
[
19
'join_type'
=>
'INNER'
,
20
]
21
),
22
],
23
'select'
=> [
24
'*'
,
25
'MAILBOX_EMAIL'
=>
'MAILBOX.EMAIL'
,
26
'MAILBOX_NAME'
=>
'MAILBOX.NAME'
,
27
'MAILBOX_LOGIN'
=>
'MAILBOX.LOGIN'
,
28
'IS_SEEN'
=>
'MESSAGE_UID.IS_SEEN'
,
29
'MSG_HASH'
=>
'MESSAGE_UID.HEADER_MD5'
,
30
'DIR_MD5'
=>
'MESSAGE_UID.DIR_MD5'
,
31
'MSG_UID'
=>
'MESSAGE_UID.MSG_UID'
,
32
],
33
'filter'
=> [
34
'=ID'
=>
$messageId
,
35
],
36
'order'
=> [
37
'FIELD_DATE'
=>
'DESC'
,
38
'MESSAGE_UID.ID'
=>
'DESC'
,
39
'MESSAGE_UID.MSG_UID'
=>
'ASC'
,
40
],
41
'limit'
=> 1,
42
])->fetch();
43
44
if
($messageForDownload)
45
{
46
return
(
bool
)\Bitrix\Mail\Helper\Message::ensureAttachments($messageForDownload);
47
}
48
49
return
false
;
50
}
51
}
$messageId
if(! $messageFields||!isset($messageFields['message_id'])||!isset($messageFields['status'])||!CModule::IncludeModule("messageservice")) $messageId
Определения
callback_ismscenter.php:26
Bitrix\Mail\Integration\Attachment\downloadAttachmentsByMessageId
static downloadAttachmentsByMessageId(int $messageId)
Определения
attachment.php:7
Bitrix\Mail\Helper\Attachment
Определения
storage.php:3
Bitrix\Main\Entity
Определения
ufield.php:9
Bitrix\Main
Bitrix
bitrix
modules
mail
lib
integration
attachment.php
Создано системой
1.14.0