Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
sendercancelinvitation.php
1
<?php
2
3
4
namespace
Bitrix\Calendar\ICal\MailInvitation
;
5
6
7
use
Bitrix\Main\Loader
;
8
use
Bitrix\Main\Localization\Loc
;
9
use
Bitrix\Main\ObjectException
;
10
use
Bitrix\Main\Text\Encoding
;
11
12
class
SenderCancelInvitation
extends
SenderInvitation
13
{
14
public
const
METHOD
=
'cancel'
;
15
20
protected
function
getContent
(): array
21
{
22
$attachmentManager =
new
AttachmentCancelManager
($this->event);
23
$this->uid = $attachmentManager->getUid();
24
25
if
(!$this->uid)
26
{
27
return
[];
28
}
29
30
return
[[
31
'CONTENT'
=> Encoding::convertEncoding($attachmentManager->getContent(), SITE_CHARSET,
"utf-8"
),
32
'CONTENT_TYPE'
=>
self::CONTENT_TYPE
,
33
'METHOD'
=> mb_strtolower(self::METHOD),
34
'CHARSET'
=>
self::CHARSET
,
35
'NAME'
=>
self::ATTACHMENT_NAME
,
36
'ID'
=>
Helper::getUniqId
(),
37
]];
38
}
39
44
protected
function
getMailEventField
(): array
45
{
46
$this->
event
[
'SKIP_TIME'
] ??=
null
;
47
return
[
48
"=Reply-To"
=>
"{$this->context->getAddresser()->getFullName()} <{$this->context->getAddresser()->getEmail()}>"
,
49
"=From"
=>
"{$this->context->getAddresser()->getFullName()} <{$this->context->getAddresser()->getEmail()}>"
,
50
"=Message-Id"
=> $this->
getMessageId
(),
51
"=In-Reply-To"
=> $this->
getMessageReplyTo
(),
52
'EMAIL_FROM'
=> $this->context->getAddresser()->getEmail(),
53
'EMAIL_TO'
=> $this->context->getReceiver()->getEmail(),
54
'MESSAGE_SUBJECT'
=> $this->
getSubjectMessage
(),
55
'MESSAGE_PHP'
=> $this->
getBodyMessage
(),
56
'CONFIRM_CODE'
=>
'TRUE'
,
57
'NAME'
=> $this->
event
[
'NAME'
],
58
'METHOD'
=>
self::METHOD
,
59
'DATE_FROM'
=> $this->
event
[
'DATE_FROM'
],
60
'DATE_TO'
=> $this->
event
[
'DATE_TO'
],
61
'TZ_FROM'
=> $this->
event
[
'TZ_FROM'
],
62
'TZ_TO'
=> $this->
event
[
'TZ_TO'
],
63
'FULL_DAY'
=> $this->
event
[
'SKIP_TIME'
] ?
'Y'
:
'N'
,
64
];
65
}
66
70
protected
function
getMessageReplyTo
(): string
71
{
72
return
$this->
getMessageId
();
73
}
74
78
protected
function
getSubjectTitle
(): string
79
{
80
if
(Loader::includeModule(
'bitrix24'
) && \CBitrix24::isFreeLicense())
81
{
82
return
Loc::getMessage
(
"EC_CALENDAR_ICAL_MAIL_METHOD_CANCEL"
);
83
}
84
85
return
Loc::getMessage
(
"EC_CALENDAR_ICAL_MAIL_METHOD_CANCEL"
) .
": {$this->event['NAME']}"
;
86
}
87
91
public
function
executeAfterSuccessfulInvitation
()
92
{
93
}
94
}
Bitrix\Calendar\ICal\MailInvitation\AttachmentCancelManager
Definition
attachmentcancelmanager.php:19
Bitrix\Calendar\ICal\MailInvitation\Helper\getUniqId
static getUniqId()
Definition
helper.php:161
Bitrix\Calendar\ICal\MailInvitation\SenderCancelInvitation
Definition
sendercancelinvitation.php:13
Bitrix\Calendar\ICal\MailInvitation\SenderCancelInvitation\getMessageReplyTo
getMessageReplyTo()
Definition
sendercancelinvitation.php:70
Bitrix\Calendar\ICal\MailInvitation\SenderCancelInvitation\getContent
getContent()
Definition
sendercancelinvitation.php:20
Bitrix\Calendar\ICal\MailInvitation\SenderCancelInvitation\getSubjectTitle
getSubjectTitle()
Definition
sendercancelinvitation.php:78
Bitrix\Calendar\ICal\MailInvitation\SenderCancelInvitation\METHOD
const METHOD
Definition
sendercancelinvitation.php:14
Bitrix\Calendar\ICal\MailInvitation\SenderCancelInvitation\getMailEventField
getMailEventField()
Definition
sendercancelinvitation.php:44
Bitrix\Calendar\ICal\MailInvitation\SenderCancelInvitation\executeAfterSuccessfulInvitation
executeAfterSuccessfulInvitation()
Definition
sendercancelinvitation.php:91
Bitrix\Calendar\ICal\MailInvitation\SenderInvitation
Definition
senderinvitation.php:24
Bitrix\Calendar\ICal\MailInvitation\SenderInvitation\ATTACHMENT_NAME
const ATTACHMENT_NAME
Definition
senderinvitation.php:31
Bitrix\Calendar\ICal\MailInvitation\SenderInvitation\getSubjectMessage
getSubjectMessage()
Definition
senderinvitation.php:267
Bitrix\Calendar\ICal\MailInvitation\SenderInvitation\CHARSET
const CHARSET
Definition
senderinvitation.php:27
Bitrix\Calendar\ICal\MailInvitation\SenderInvitation\getMessageId
getMessageId()
Definition
senderinvitation.php:275
Bitrix\Calendar\ICal\MailInvitation\SenderInvitation\getBodyMessage
getBodyMessage()
Definition
senderinvitation.php:191
Bitrix\Calendar\ICal\MailInvitation\SenderInvitation\CONTENT_TYPE
const CONTENT_TYPE
Definition
senderinvitation.php:28
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ObjectException
Definition
exception.php:192
Bitrix\Main\Text\Encoding
Definition
encoding.php:8
Bitrix\Calendar\ICal\MailInvitation
Definition
attachmentcancelmanager.php:4
modules
calendar
lib
ical
mailinvitation
sendercancelinvitation.php
Создано системой
1.10.0