You are here

private function PrivateMessageThreadManager::getMailRecipients in Private Message 8

The users to receive email notifications.

Return value

\Drupal\Core\Session\AccountInterface[] An array of Account objects of the thread memebers who are to receive the email notification.

1 call to PrivateMessageThreadManager::getMailRecipients()
PrivateMessageThreadManager::sendMail in src/Service/PrivateMessageThreadManager.php
Send the notification email.

File

src/Service/PrivateMessageThreadManager.php, line 131

Class

PrivateMessageThreadManager
The Private Message generator class.

Namespace

Drupal\private_message\Service

Code

private function getMailRecipients() {
  if (empty($this->excludeFromMail)) {
    return $this->recipients;
  }
  return array_filter($this->recipients, function (AccountInterface $account) {

    // If this user is in the excluded list, filter them from the recipients
    // list so they do not receive the email.
    return !in_array($account, $this->excludeFromMail);
  });
}