54 MessageBase::CODE_ADS_FB => Retargeting\Service::TYPE_FACEBOOK,
55 MessageBase::CODE_ADS_VK => Retargeting\Service::TYPE_VKONTAKTE,
56 MessageBase::CODE_ADS_YA => Retargeting\Service::TYPE_YANDEX,
57 MessageBase::CODE_ADS_GA => Retargeting\Service::TYPE_GOOGLE,
58 MessageBase::CODE_ADS_LOOKALIKE_FB => Retargeting\Service::TYPE_FACEBOOK,
59 MessageBase::CODE_ADS_LOOKALIKE_VK => Retargeting\Service::TYPE_VKONTAKTE,
60 MessageBase::CODE_ADS_LOOKALIKE_YANDEX => Retargeting\Service::TYPE_YANDEX,
101 public static function send(\stdClass $config, array $contacts)
103 if (!static::canUse())
108 $audience = Retargeting\Service::getAudience($config->type);
109 $audience->setAccountId($config->accountId);
110 $audience->enableQueueMode();
112 if ($config->autoRemoveDayNumber)
114 $audience->enableQueueAutoRemove($config->autoRemoveDayNumber);
118 $audience->disableQueueAutoRemove();
121 $audienceImportResult = $audience->addContacts(
125 'type' => $config->contactType
129 return $audienceImportResult->isSuccess();