(non-PHPdoc).

@see Azine\EmailBundle\Services.RecipientProviderInterface::getNewsletterRecipientIDs()
349369
public function getNewsletterRecipientIDs()
    {
        $qb = $this->managerRegistry->getManager()->createQueryBuilder()
            ->select('n.id')
            ->from($this->userClass, 'n')
            ->where('n.'.$this->newsletterField.' = true')
            ->andWhere('n.enabled = 1') // exclude inactive users
            ;
        $results = $qb->getQuery()->execute();
        $ids = array();
        foreach ($results as $next) {
            $ids[] = $next['id'];
        }

        return $ids;
    }
899818
protected function _prepareRecipientAddresses($email)
    {
        $to = $email->getTo();
        $cc = $email->getCc();
        $bcc = $email->getBcc();

        return array_merge(array_keys($to), array_keys($cc), array_keys($bcc));
    }
546251
protected function getCurrentNewsCategories()
    {
        if (!($alias = Input::getAutoItem('items', false, true))
            || null === ($news = NewsModel::findPublishedByParentAndIdOrAlias($alias, $this->news_archives))
        ) {
            return [];
        }

        $ids = Model::getRelatedValues('tl_news', 'categories', $news->id);
        $ids = \array_map('intval', \array_unique($ids));

        return $ids;
    }
162434
public void getScheduledNotificationRecipients(ScheduledNotification notification, Collection<Recipient> result) {
        List<String> lst = broker.callRPCList("RGCWXQ SCHRECIP", null, notification.getIen());
        result.clear();

        for (String data : lst) {
            result.add(new Recipient(data));
        }
    }
646703
public function getNewMessagesCount()
    {
        $cache = Podium::getInstance()->podiumCache->getElement('user.newmessages', $this->id);
        if ($cache === false) {
            $cache = (new Query())->from(MessageReceiver::tableName())->where([
                    'receiver_id' => $this->id,
                    'receiver_status' => Message::STATUS_NEW
                ])->count();
            Podium::getInstance()->podiumCache->setElement('user.newmessages', $this->id, $cache);
        }
        return $cache;
    }
1213613
public function getRecipients()
    {
        switch ($this->getSystemMessageType()) {
            case self::LETTER_TYPE_NORMAL:
                return $this->data['recipients'];
                break;

            case self::LETTER_TYPE_HYBRID:
                return $this->data['recipientsPrinted'];
                break;
        }

        return null;
    }
1006918
public function getRecipients($event)
    {
        $groupIds = $this->Groups()->column('ID');
        if (count($groupIds)) {
            $members = Member::get()->filter('Groups.ID', $groupIds);
            return $members;
        }
        return [];
    }
586033
protected function genericMessageToArray()
    {
        $message = [];
        $message['recipient'] = $this->recipient;
        $message['notification_type'] = $this->notificationType;
        $message['message']['attachment']['type'] = 'template';
        $message['message']['attachment']['payload']['template_type'] = 'generic';
        $message['message']['attachment']['payload']['elements'] = $this->cards;

        return $message;
    }
1313530
private static function _usersToRecipients($users)
    {
        $out = array();

        if (!is_array($users)) {
            $users = array($users);
        };

        foreach ($users as $id) {
            $user = grab('user_resolve', $id);
            if ($user !== false) {
                if ($user['name'] !== '') {
                    $out[] = '' . filter('clean_name', $user['name']) . ' <' . $user['email'] . '>';
                } else {
                    $out[] = $user['email'];
                };
            };
        };

        return (count($out) > 0) ? implode(', ', $out) : null;
    }
733733
protected static function formRecipients($inputRecipients, PDFfiller $provider, $signatureRequestId)
    {
        $recipients = [];

        foreach ($inputRecipients as $recipient) {
            $recipients[$recipient['id']] = new SignatureRequestRecipient($provider, $recipient, $signatureRequestId);
        }

        return $recipients;
    }
1260247
public function getRecipientSpecificNewsletterSubject(array $generalContentItems, array $recipientContentItems, array $params, RecipientInterface $recipient, $locale)
    {
        return parent::getRecipientSpecificNewsletterSubject($generalContentItems, $recipientContentItems, $params, $recipient, $locale);
    }
1090040
protected function getRecipient()
    {
        $recipient = $this->form->data(self::RECIPIENT_FIELD);
        $allowed = $this->requireOption('allowed-recipients');

        if (!array_key_exists($recipient, $allowed)) {
            $this->fail(I18n::translate('uniform-email-error').' '.I18n::translate('uniform-email-select-error'), self::RECIPIENT_FIELD);
        }

        return $allowed[$recipient];
    }
391218
public function FilteredEmailRecipients($data = null, $form = null)
    {
        $recipients = ArrayList::create($this->EmailRecipients()->toArray());

        // Filter by rules
        $recipients = $recipients->filterByCallback(function ($recipient) use ($data, $form) {
            /** @var EmailRecipient $recipient */
            return $recipient->canSend($data, $form);
        });

        $this->extend('updateFilteredEmailRecipients', $recipients, $data, $form);

        return $recipients;
    }
1234415
public function getRecipientsFromPost(array $referenced_entity) {
    $recipients = [];

    $post = Post::load($referenced_entity['target_id']);
    $recipient_user = $post->get('field_recipient_user')->getValue();
    if (!empty($recipient_user)) {
      $recipients[] = [
        'target_type' => 'user',
        'target_id' => $recipient_user['0']['target_id'],
      ];
    }

    return $recipients;
  }
805647
public static function normalizeRecipients($recipients): array
    {
        $targetRecipients = [];
        if (is_string($recipients)) {
            $targetRecipients[] = new Address($recipients);
        } elseif ($recipients instanceof Address) {
            $targetRecipients[] = $recipients;
        } elseif (is_iterable($recipients)) {
            foreach ($recipients as $key => $recipient) {
                if ($recipient instanceof Address) {
                    $targetRecipients[] = $recipient;
                } elseif (is_int($key)) {
                    $targetRecipients[] = new Address($recipient);
                } else {
                    $targetRecipients[] = new Address($key, $recipient);
                }
            }
        } else {
            throw new InvalidArgumentException('Expected string/array/Address instance/array of Address instances.');
        }

        return $targetRecipients;
    }
866461
public function findByNewsletterId($NewsletterId) {
        $response = $this->mailjet->get(Resources::$Campaign, ['mj.nl' => $NewsletterId]);
        if (!$response->success()) {
            $this->throwError("CampaignService:findByNewsletterId() failed", $response);
        }

        return $response->getData();
    }
342189
protected function getRecipientIDs(NotificationEntity $notification)
    {
        $result = [];
        $notificationData = $notification->getNotificationData();
        $locale = $this->app->make(LocaleRepository::class)->findApproved($notificationData['localeID']);
        if ($locale === null) {
            throw new Exception(t('Unable to find the locale with ID %s', $notificationData['localeID']));
        }
        $uir = $this->app->make(UserInfoRepository::class);
        $applicantUser = $uir->getByID($notificationData['applicantUserID']);
        if ($applicantUser === null) {
            throw new Exception(t('Unable to find the user with ID %s', $notificationData['applicantUserID']));
        }
        /* @var UserInfo $applicantUser */
        if (!$applicantUser->getUserObject()->inGroup($this->getGroupsHelper()->getAspiringTranslators($locale))) {
            throw new Exception(t(
                'The user %1$s is no more in the aspiring translators of %2$s',
                sprintf('%s (%s)', $applicantUser->getUserName(), $applicantUser->getUserID()),
                $locale->getDisplayName()
            ));
        }
        $group = $this->getGroupsHelper()->getAdministrators($locale);
        $result = array_merge($result, $group->getGroupMemberIDs());
        $group = $this->getGroupsHelper()->getGlobalAdministrators();
        $result = array_merge($result, $group->getGroupMemberIDs());

        return $result;
    }