1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
builder.php
См. документацию.
1<?php
9
31
32Loc::loadMessages(__FILE__);
33
39{
41 protected $checkDuplicates = true;
42
44 protected $groupCount = array();
45
47 protected $postingId;
48
50 protected $postingData;
51
53 protected $typeId;
54
58 private $result;
59
63 private $groupQueueService;
64
68 private $messageConfiguration;
69
75 public static function create()
76 {
77 return new static();
78 }
79
83 public function isResult(): bool
84 {
85 return $this->result;
86 }
87
93 public function setResult(bool $result): Builder
94 {
95 $this->result = $result;
96
97 return $this;
98 }
99
100
107 public function __construct($postingId = null, $checkDuplicates = true)
108 {
109 $this->groupQueueService = new GroupQueueService();
110 if ($postingId)
111 {
112 $this->setResult($this->run($postingId, $checkDuplicates));
113 }
114 }
115
125 public function run($postingId, $checkDuplicates = true): bool
126 {
128 'select' => array(
129 '*',
130 'MESSAGE_TYPE' => 'MAILING_CHAIN.MESSAGE_CODE',
131 'WAITING_RECIPIENT' => 'MAILING_CHAIN.WAITING_RECIPIENT',
132 'MAILING_STATUS' => 'MAILING_CHAIN.STATUS',
133 'MESSAGE_ID' => 'MAILING_CHAIN.MESSAGE_ID'
134 ),
135 'filter' => array('ID' => $postingId),
136 'limit' => 1
137 ))->fetch();
138
139 if(!$postingData)
140 {
141 return true;
142 }
143
144 if ($postingData['MAILING_STATUS'] === Model\LetterTable::STATUS_END)
145 {
146 Model\LetterTable::update($postingData['MAILING_CHAIN_ID'], [
147 'WAITING_RECIPIENT' => 'N'
148 ]);
149
150 return true;
151 }
152
153 $entityProcessed = $this->groupQueueService->isEntityProcessed(
154 Model\GroupQueueTable::TYPE['POSTING'],
156 );
157
158 if (
159 $postingData['MAILING_STATUS'] === Model\LetterTable::STATUS_SEND
160 && $postingData['WAITING_RECIPIENT'] === 'N'
161 && !$entityProcessed
162 )
163 {
164 return true;
165 }
166
167 $this->postingData = $postingData;
168 $this->checkDuplicates = $checkDuplicates;
169 $this->postingId = $postingId;
170 $this->groupCount = array();
171
172 try
173 {
174 $this->messageConfiguration =
176 ->loadConfiguration($postingData['MESSAGE_ID'])
177 ;
178 }
179 catch (ArgumentException $e)
180 {
181 return true;
182 }
183
185 {
186 if($this->postingData['STATUS'] === PostingTable::STATUS_NEW)
187 {
189 $this->checkDuplicates = false;
190 }
191 }
192
193 $messageFields = Model\MessageFieldTable::getList(
194 ['filter' => ['=MESSAGE_ID' => $postingData['MESSAGE_ID']]]
195 )->fetchAll();
196
197 $personalizeFields = [];
198 foreach ($messageFields as $messageField)
199 {
200 if (!in_array(
201 $messageField['CODE'],
202 [
203 'MESSAGE_PERSONALIZE',
204 'SUBJECT_PERSONALIZE',
205 'TITLE_PERSONALIZE'
206 ]
207 ))
208 {
209 continue;
210 }
211
212 $personalizeFields[$messageField['CODE']] =
213 json_decode($messageField['VALUE'], true)[1];
214 }
215
216 try
217 {
218 if ($postingData['WAITING_RECIPIENT'] !== 'Y')
219 {
220 Model\LetterTable::update($postingData['MAILING_CHAIN_ID'], [
221 'WAITING_RECIPIENT' => 'Y'
222 ]);
223 }
224
225 $groups = $this->prepareGroups();
226 $message = Message\Adapter::create($this->postingData['MESSAGE_TYPE']);
227 foreach ($message->getSupportedRecipientTypes() as $typeId)
228 {
230 {
231 continue;
232 }
233
234 $this->typeId = $typeId;
235 $this->runForRecipientType($personalizeFields, $groups);
236 }
237 } catch (NotCompletedException $e)
238 {
239 return false;
240 }
241
242 Model\PostingTable::update(
244 array(
245 'COUNT_SEND_ALL' => PostingRecipientTable::getCount(array('POSTING_ID' => $postingId))
246 )
247 );
248
249 $usedGroups = [];
250 foreach ($groups as $group)
251 {
252 if ($group['GROUP_ID'] && !isset($usedGroups[$group['GROUP_ID']]))
253 {
255
256 $this->groupQueueService->releaseGroup(
257 Model\GroupQueueTable::TYPE['POSTING'],
258 $this->postingId,
259 $group['GROUP_ID']
260 );
261 $usedGroups[$group['GROUP_ID']] = $group['GROUP_ID'];
262 }
263 }
264
265 $this->postingData['WAITING_RECIPIENT'] = 'N';
266 Model\LetterTable::update($this->postingData['MAILING_CHAIN_ID'], [
267 'WAITING_RECIPIENT' => $this->postingData['WAITING_RECIPIENT']
268 ]);
269
270 return true;
271 }
272
273 protected function prepareGroups()
274 {
275 $groups = [];
276 $groups = array_merge($groups, $this->getLetterConnectors($this->postingData['MAILING_CHAIN_ID']));
277 $groups = array_merge($groups, $this->getSubscriptionConnectors($this->postingData['MAILING_ID']));
278
279 foreach ($groups as $group)
280 {
281 if ($group['GROUP_ID'] && !GroupTable::getById($group['GROUP_ID'])->fetch())
282 {
283 continue;
284 }
285
286 $rebuild = $this->needsRebuildGroup($group);
287 if ($group['GROUP_ID'])
288 {
289 $this->groupQueueService
290 ->addToDB(Model\GroupQueueTable::TYPE['POSTING'], $this->postingId, $group['GROUP_ID']);
291 }
292
293 if ($rebuild && $group['GROUP_ID'])
294 {
295 SegmentDataBuilder::actualize($group['GROUP_ID'], true);
297 }
298
299 if ($group['STATUS'] !== GroupTable::STATUS_READY_TO_USE)
300 {
303 }
304 }
305
306 // fetch all connectors for getting emails
307 array_walk($groups,
308 function(&$group)
309 {
310 $group['INCLUDE'] = (bool)$group['INCLUDE'];
311 }
312 );
313
314 // sort groups by include value
315 usort(
316 $groups,
317 function ($a, $b)
318 {
319 if ($a['INCLUDE'] == $b['INCLUDE'])
320 {
321 return 0;
322 }
323
324 return ($a['INCLUDE'] > $b['INCLUDE']) ? -1 : 1;
325 }
326 );
327
328 return $groups;
329 }
330
331 private function needsRebuildGroup($group)
332 {
333 $isNewOrDone = in_array($group['STATUS'], [GroupTable::STATUS_NEW, GroupTable::STATUS_DONE]);
334 $isReadyAndReleased =
335 isset($group['GROUP_ID'])
336 && $group['STATUS'] === GroupTable::STATUS_READY_TO_USE
337 && $this->groupQueueService->isReleased($group['GROUP_ID']);
338
339 return $isNewOrDone || $isReadyAndReleased;
340 }
341
342 protected function runForRecipientType($usedPersonalizeFields = [], $groups = [])
343 {
344 // import recipients
345 foreach($groups as $group)
346 {
347 if (is_array($group['ENDPOINT']) && !(isset($group['CONNECTOR']) && $group['CONNECTOR'] instanceof Connector\Base))
348 {
349 $group['CONNECTOR'] = Connector\Manager::getConnector($group['ENDPOINT']);
350 }
351
352 if(empty($group['CONNECTOR']))
353 {
354 continue;
355 }
356
357 $connector = $group['CONNECTOR'];
358 $connector->setDataTypeId($this->typeId);
359 if (is_array($group['ENDPOINT']['FIELDS']))
360 {
361 $connector->setCheckAccessRights(false);
362 $connector->setFieldValues($group['ENDPOINT']['FIELDS']);
363 }
364
365 $this->fill(
367 $group,
368 $usedPersonalizeFields
369 );
370 }
371 }
372
373 protected function stopRecipientListBuilding()
374 {
375 RecipientBuilderJob::removeAgentFromDB($this->postingData['ID']);
376 RecipientBuilderJob::addEventAgent($this->postingData['ID']);
377
378 Model\LetterTable::update($this->postingData['MAILING_CHAIN_ID'], [
379 'WAITING_RECIPIENT' => $this->postingData['MAILING_STATUS'] !== Model\LetterTable::STATUS_END ? 'Y' : 'N'
380 ]);
381
382 throw new NotCompletedException();
383 }
384 protected static function clean($postingId)
385 {
386 $primary = array('POSTING_ID' => $postingId);
388 Model\PostingTable::update(
390 array(
391 'COUNT_SEND_ALL' => 0,
392 'COUNT_SEND_NONE' => 0,
393 'COUNT_SEND_ERROR' => 0,
394 'COUNT_SEND_SUCCESS' => 0,
395 )
396 );
397 }
398
399 protected function getTypeCode()
400 {
401 return Recipient\Type::getCode($this->typeId);
402 }
403
404 protected function getSubscriptionConnectors($campaignId)
405 {
406 $groups = array();
407 $groups[] = array(
408 'INCLUDE' => true,
409 'ENDPOINT' => array('FIELDS' => array('MAILING_ID' => $campaignId)),
410 'GROUP_ID' => null,
412 'FILTER_ID' => null,
413 'CONNECTOR' => new Integration\Sender\Connectors\Subscriber
414 );
415 $groups[] = array(
416 'INCLUDE' => false,
417 'ENDPOINT' => array('FIELDS' => array('MAILING_ID' => $campaignId)),
418 'GROUP_ID' => null,
420 'FILTER_ID' => null,
421 'CONNECTOR' => new Integration\Sender\Connectors\UnSubscribers
422 );
423
424 return $groups;
425 }
426
432 public function isCorrectData(array $data, ?string $typeCode): bool
433 {
434 return (!isset($data[$typeCode]) || !$data[$typeCode])
435 && !(
436 isset($data['FIELDS'])
437 && (
438 (int)$data['FIELDS']['CRM_ENTITY_TYPE_ID'] === \CCrmOwnerType::Lead
439 || ($data['FIELDS']['CRM_ENTITY_TYPE'] === \CCrmOwnerType::LeadName)
440 )
441 && !empty($data['FIELDS']['CRM_ENTITY_ID'])
442 && ((int)$this->typeId === \Bitrix\Sender\Recipient\Type::CRM_LEAD_ID)
443 );
444 }
445
446 protected function getCampaignGroups($campaignId)
447 {
448 $groups = array();
449 $groupConnectorDb = MailingGroupTable::getList(array(
450 'select' => array(
451 'INCLUDE',
452 'CONNECTOR_ENDPOINT' => 'GROUP.GROUP_CONNECTOR.ENDPOINT',
453 'GROUP_ID'
454 ),
455 'filter' => array(
456 '=MAILING_ID' => $campaignId,
457 ),
458 'order' => array('INCLUDE' => 'DESC', 'GROUP_ID' => 'ASC')
459 ));
460 while($group = $groupConnectorDb->fetch())
461 {
462 $groups[] = array(
463 'INCLUDE' => $group['INCLUDE'],
464 'ENDPOINT' => $group['CONNECTOR_ENDPOINT'],
465 'GROUP_ID' => $group['GROUP_ID'],
466 'CONNECTOR' => null
467 );
468 }
469
470 return $groups;
471 }
472
473 protected function getLetterConnectors($letterId)
474 {
475 $groups = array();
476 $groupConnectors = Model\LetterSegmentTable::getList(array(
477 'select' => array(
478 'INCLUDE',
479 'STATUS' => 'SEGMENT.STATUS',
480 'FILTER_ID' => 'SEGMENT.GROUP_CONNECTOR.FILTER_ID',
481 'CONNECTOR_ENDPOINT' => 'SEGMENT.GROUP_CONNECTOR.ENDPOINT',
482 'SEGMENT_ID'
483 ),
484 'filter' => array(
485 '=LETTER_ID' => $letterId,
486 ),
487 'order' => array('INCLUDE' => 'DESC', 'LETTER_ID' => 'ASC')
488 ));
489 while($group = $groupConnectors->fetch())
490 {
491 $groups[] = array(
492 'INCLUDE' => $group['INCLUDE'],
493 'ENDPOINT' => $group['CONNECTOR_ENDPOINT'],
494 'GROUP_ID' => $group['SEGMENT_ID'],
495 'FILTER_ID' => $group['FILTER_ID'],
496 'STATUS' => $group['STATUS'],
497 'CONNECTOR' => null
498 );
499 }
500
501 return $groups;
502 }
503
504 private function isExcluded(bool $include, $row): bool
505 {
506 return $include
507 && (
508 $row['BLACKLISTED'] === 'Y' ||
509 $row['IS_UNSUB'] === 'Y' ||
510 $row['IS_MAILING_UNSUB'] === 'Y' ||
511 (
512 $this->messageConfiguration->get('APPROVE_CONFIRMATION', 'N') === 'Y' &&
513 Consent::isUnsub(
514 $row['CONSENT_STATUS'],
515 $row['CONSENT_REQUEST'],
516 $this->postingData['MESSAGE_TYPE']
517 )
518 )
519 );
520 }
521
522 protected function setRecipientIdentificators(array &$dataList, bool $include = true)
523 {
524 if (count($dataList) === 0)
525 {
526 return;
527 }
528
529 $codes = array_keys($dataList);
530 $tableName = ContactTable::getTableName();
532
533 $existed = [];
534 $contactCodeFilter = [];
535
536 $connection = Application::getConnection();
537 $primariesString = SqlBatch::getInString($codes);
538
539 $recipientDb = $connection->query(
540 "select
541 c.ID,
542 c.NAME,
543 c.CODE,
544 c.BLACKLISTED,
545 c.CONSENT_STATUS,
546 c.CONSENT_REQUEST,
547 c.IS_UNSUB,
548 s.IS_UNSUB as IS_MAILING_UNSUB " .
549 "from $tableName c " .
550 "left join $subsTableName s on " .
551 "c.ID = s.CONTACT_ID " .
552 "and s.MAILING_ID=" . (int) $this->postingData['MAILING_ID'] . " " .
553 "where c.TYPE_ID = " . (int) $this->typeId . " and c.CODE in ($primariesString)"
554 );
555 while ($row = $recipientDb->fetch())
556 {
557 $existed[] = $row['CODE'];
558 $dataList[$row['CODE']]['CONTACT_ID'] = $row['ID'];
559 $dataList[$row['CODE']]['EXCLUDED'] = $this->isExcluded($include, $row);
560
561 $name = $dataList[$row['CODE']]['NAME'] ?? null;
562 if ($name && $name !== $row['NAME'])
563 {
564 $contactCodeFilter[] = $row['CODE'];
565 }
566 }
567
568 // update existed contact names
569 $this->updateContacts($dataList, $contactCodeFilter);
570
571 // exit if no new contacts
572 if (count($existed) === count($codes))
573 {
574 return;
575 }
576
577 // add new contacts
578 $list = array_diff($codes, $existed);
579 $batch = [];
580 $insertDate = new DateTime();
581 $updateFieldsOnDuplicate = ['DATE_UPDATE'];
582 foreach ($list as $code)
583 {
584 $batchItem = [
585 'TYPE_ID' => $this->typeId,
586 'CODE' => $code,
587 'DATE_INSERT' => $insertDate,
588 'DATE_UPDATE' => $insertDate,
589 ];
590
591 $key = 'NAME';
592 if (isset($dataList[$key]) && $dataList[$key])
593 {
594 $batchItem[$key] = $dataList[$key];
595 if (!in_array($key, $updateFieldsOnDuplicate))
596 {
597 $updateFieldsOnDuplicate[] = $key;
598 }
599 }
600
601 $batch[] = $batchItem;
602 }
603
604
605 SqlBatch::insert($tableName, $batch, $updateFieldsOnDuplicate, ContactTable::getConflictFields());
606
607
608 $recipientDb = $connection->query(
609 "select ID, CODE " .
610 "from $tableName " .
611 "where TYPE_ID = " . (int) $this->typeId . " and CODE in ($primariesString)"
612 );
613 while ($row = $recipientDb->fetch())
614 {
615 $dataList[$row['CODE']]['CONTACT_ID'] = $row['ID'];
616 }
617 }
618
619 protected function checkUsedFields($entityType, $ids, $usedPersonalizeFields, &$dataList)
620 {
621 $usedFields = [];
622 foreach ($usedPersonalizeFields as $personalizeField)
623 {
624 foreach ($personalizeField as $usedField)
625 {
626 $usedFieldExploded = explode('.', $usedField);
627 if (
628 $entityType == $usedFieldExploded[0] &&
629 isset
630 (
631 $usedFieldExploded[1]
632 ))
633 {
634 unset($usedFieldExploded[0]);
635 $usedFields[$usedField] = implode('.', $usedFieldExploded);
636 }
637 }
638 }
640 $entityType, $ids, $usedFields
641 );
642
643 foreach ($fields as &$entity)
644 {
645 foreach ($entity as $key => $field)
646 {
647 $entity[$entityType.'.'.$key] = $field;
648 unset($entity[$key]);
649 }
650 }
651
652 foreach($dataList as &$data)
653 {
654 if(
655 isset($fields[(int)$data['FIELDS']['CRM_ENTITY_ID']])
656 && $data['FIELDS']['CRM_ENTITY_TYPE'] === $entityType
657 )
658 {
659 $data['FIELDS'] = array_merge(
660 $data['FIELDS'],
661 $fields[$data['FIELDS']['CRM_ENTITY_ID']]
662 );
663 }
664 }
665
666 return $usedFields;
667 }
668
669 protected function fill(Connector\Base $connector, $group, $usedPersonalizeFields = [])
670 {
671 $count = 0;
672
673 $typeCode = $this->getTypeCode();
674
675 $isIncrementally = $connector instanceof Connector\IncrementallyConnector && $group['FILTER_ID'];
676 if ($isIncrementally)
677 {
678 $segmentBuilder = new SegmentDataBuilder($group['GROUP_ID'], $group['FILTER_ID'], $group['ENDPOINT']);
679
680 if (!$segmentBuilder->isBuildingCompleted())
681 {
682 throw new NotCompletedException();
683 }
684 }
685
686 $result = $isIncrementally
687 ? $segmentBuilder->getPreparedData()
688 : $connector->getResult();
689
690 while (true)
691 {
692 $dataList = array();
693 $maxPart = 500;
694
695 while ($data = $result->fetch())
696 {
697 if ($this->isCorrectData($data, $typeCode))
698 {
699 continue;
700 }
701
702 if (!isset($data[$typeCode]) && ((int)$this->typeId === Recipient\Type::CRM_LEAD_ID))
703 {
704 $data[$typeCode] = $data['FIELDS']['CRM_ENTITY_ID'];
705 }
706
707 $primary = Recipient\Normalizer::normalize($data[$typeCode], $this->typeId);
708 if ($primary == '')
709 {
710 continue;
711 }
712 $dataList[$primary] = $data;
713
714 $count++;
715
716 $maxPart--;
717 if ($maxPart == 0)
718 {
719 break;
720 }
721 }
722
723 if (count($dataList) === 0)
724 {
725 break;
726 }
727 $this->setRecipientIdentificators($dataList, $group['INCLUDE']);
728
729 if ($group['INCLUDE'])
730 {
731 // add address if not exists
732 if ($this->checkDuplicates)
733 {
734 $primariesString = SqlBatch::getInString(array_keys($dataList));
735 $connection = Application::getConnection();
736 $rowDb = $connection->query(
737 "select r.CODE " .
738 "from b_sender_posting_recipient pr, b_sender_contact r " .
739 "where pr.CONTACT_ID = r.ID " .
740 "and pr.POSTING_ID = " . (int) $this->postingId . " " .
741 "and r.TYPE_ID = " . (int) $this->typeId . " " .
742 "and r.CODE in ($primariesString)"
743 );
744 while ($row = $rowDb->fetch())
745 {
746 unset($dataList[$row['CODE']]);
747 }
748 }
749
750 if (empty($dataList))
751 {
752 continue;
753 }
754
755 if(
756 count($usedPersonalizeFields) > 0
757 )
758 {
759 $preparedFields = [];
760
761 foreach($dataList as $data)
762 {
763 if(!isset($data['FIELDS']))
764 {
765 continue;
766 }
767
768 $field = $data['FIELDS'];
769 if(!isset($preparedFields[$field['CRM_ENTITY_TYPE']]))
770 {
771 $preparedFields[$field['CRM_ENTITY_TYPE']] = [];
772 }
773 $preparedFields[$field['CRM_ENTITY_TYPE']][] = $field['CRM_ENTITY_ID'];
774 }
775
776 foreach ($preparedFields as $entityType => $ids)
777 {
778 $this->checkUsedFields(
779 $entityType, $ids, $usedPersonalizeFields, $dataList
780 );
781 }
782 }
783
784 $this->addPostingRecipients($dataList);
785 }
786 else
787 {
788 $this->removePostingRecipients($dataList);
789 }
790 }
791
792 if (!$group['GROUP_ID'])
793 {
794 return;
795 }
796
797 $this->incGroupCounters($group['GROUP_ID'], $count);
798 }
799
800 protected function removePostingRecipients(array &$list)
801 {
802 $primaries = array();
803 foreach($list as $code => $data)
804 {
805 if (!isset($data['CONTACT_ID']) || !$data['CONTACT_ID'])
806 {
807 continue;
808 }
809 $primaries[] = (int) $data['CONTACT_ID'];
810 }
811
812 if (count($primaries) === 0)
813 {
814 return;
815 }
816
817 $connection = Application::getConnection();
818 $primariesString = implode(',', $primaries);
819 $connection->query(
820 "delete " .
821 "from b_sender_posting_recipient " .
822 "where POSTING_ID = " . (int) $this->postingId . " " .
823 "and CONTACT_ID in (" . $primariesString . ")"
824 );
825 }
826
827 protected function updateContacts(array &$list, array $codeFilter)
828 {
829 $fields = [];
830 foreach ($codeFilter as $code)
831 {
832 if (!isset($list[$code]))
833 {
834 continue;
835 }
836
837 $item = $list[$code];
838 $fields[] = ['ID' => $item['CONTACT_ID'], 'NAME' => $item['NAME']];
839 }
840
841 SqlBatch::update(ContactTable::getTableName(), $fields);
842 }
843
844 protected function addPostingRecipients(array &$list)
845 {
846 $dataList = array();
847 foreach($list as $code => $data)
848 {
849 if (isset($data['EXCLUDED']) && $data['EXCLUDED'])
850 {
851 continue;
852 }
853
854 $recipientInsert = array(
855 'CONTACT_ID' => (int) $data['CONTACT_ID'],
857 'POSTING_ID' => (int) $this->postingId,
858 'USER_ID' => null,
859 'FIELDS' => null
860 );
861
862 if (array_key_exists('USER_ID', $data) && intval($data['USER_ID']) > 0)
863 {
864 $recipientInsert['USER_ID'] = intval($data['USER_ID']);
865 }
866
867 if (array_key_exists('FIELDS', $data) && count($data['FIELDS']) > 0)
868 {
869 $recipientInsert['FIELDS'] = serialize($data['FIELDS']);
870 }
871
872 $dataList[] = $recipientInsert;
873 }
874
875 if(count($dataList) == 0)
876 {
877 return;
878 }
879
880 SqlBatch::insert(
882 $dataList,
883 ['USER_ID', 'FIELDS'],
885 );
886 }
887
888 protected function incGroupCounters($groupId = null, $count = 0)
889 {
890 if (!$groupId)
891 {
892 return;
893 }
894
895 if (array_key_exists($groupId, $this->groupCount))
896 {
897 $this->groupCount[$groupId] += $count;
898 }
899 else
900 {
901 $this->groupCount[$groupId] = $count;
902 }
903
904 }
905}
$connection
Определения actionsdefinitions.php:38
$count
Определения admin_tab.php:4
$messageFields
Определения callback_ednaru.php:22
getCode()
Определения error.php:54
Определения group.php:32
static getById($id)
Определения datamanager.php:364
static getList(array $parameters=array())
Определения datamanager.php:431
static getCount($filter=array(), array $cache=array())
Определения datamanager.php:516
static getConnector(array $endpoint)
Определения manager.php:191
static getConflictFields()
Определения contact.php:618
static getTableName()
Определения contact.php:53
const STATUS_DONE
Определения group.php:26
const STATUS_NEW
Определения group.php:23
const STATUS_READY_TO_USE
Определения group.php:25
static getData($entityType, $entityIds, $fields=[' *'])
Определения helper.php:143
static getTableName()
Определения mailing.php:783
static getInstance($code)
Определения adapter.php:78
static create($code)
Определения adapter.php:90
setRecipientIdentificators(array &$dataList, bool $include=true)
Определения builder.php:522
fill(Connector\Base $connector, $group, $usedPersonalizeFields=[])
Определения builder.php:669
static clean($postingId)
Определения builder.php:384
static create()
Определения builder.php:75
__construct($postingId=null, $checkDuplicates=true)
Определения builder.php:107
getCampaignGroups($campaignId)
Определения builder.php:446
isCorrectData(array $data, ?string $typeCode)
Определения builder.php:432
incGroupCounters($groupId=null, $count=0)
Определения builder.php:888
updateContacts(array &$list, array $codeFilter)
Определения builder.php:827
setResult(bool $result)
Определения builder.php:93
getSubscriptionConnectors($campaignId)
Определения builder.php:404
removePostingRecipients(array &$list)
Определения builder.php:800
addPostingRecipients(array &$list)
Определения builder.php:844
stopRecipientListBuilding()
Определения builder.php:373
run($postingId, $checkDuplicates=true)
Определения builder.php:125
getLetterConnectors($letterId)
Определения builder.php:473
checkUsedFields($entityType, $ids, $usedPersonalizeFields, &$dataList)
Определения builder.php:619
runForRecipientType($usedPersonalizeFields=[], $groups=[])
Определения builder.php:342
static actualize(int $groupId, bool $rebuild=false)
Определения segmentdatabuilder.php:946
static checkIsSegmentPrepared(int $groupId)
Определения segmentdatabuilder.php:262
static getConflictFields()
Определения posting.php:861
static deleteList(array $filter)
Определения posting.php:839
const SEND_RESULT_NONE
Определения posting.php:670
static getTableName()
Определения posting.php:681
const STATUS_NEW
Определения posting.php:21
static normalize($code, $typeId=Type::EMAIL)
Определения normalizer.php:28
const CRM_LEAD_ID
Определения type.php:26
static removeAgentFromDB(int $postingId)
Определения recipientbuilderjob.php:42
static addEventAgent(int $postingId)
Определения recipientbuilderjob.php:26
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$entity
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
$groups
Определения options.php:30
$name
Определения menu_edit.php:35
Определения base.php:8
Определения ad.php:8
Определения adapter.php:9
Определения builder.php:8
Определения agent.php:8
$message
Определения payment.php:8
if(empty($signedUserToken)) $key
Определения quickway.php:257
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936
else $a
Определения template.php:137
$fields
Определения yandex_run.php:501