Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
actionemail.php
1<?php
10
11class ActionEmail extends Action
12{
13 const EVENT_TYPE = 'EVENT_LOG_NOTIFICATION';
14
15 public function __construct($recipient, $text)
16 {
17 parent::__construct(Action::TYPE_EMAIL, $recipient, $text);
18 }
19
23 public function send(Notification $notification)
24 {
25 $site = \CSite::GetDefSite();
26
27 $fields = static::getNotificationFields($notification);
28 $fields["EMAIL"] = $this->getRecipient();
29 $fields["ADDITIONAL_TEXT"] = $this->getText();
30
31 \Bitrix\Main\Mail\Event::send([
32 'EVENT_NAME' => self::EVENT_TYPE,
33 'C_FIELDS' => $fields,
34 'LID' => $site,
35 ]);
36 }
37}
send(Notification $notification)