You are here

public function PrivateMessageMailer::send in Open Social 8.9

Same name and namespace in other branches
  1. 8.2 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php \Drupal\social_private_message\Service\PrivateMessageMailer::send()
  2. 8.3 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php \Drupal\social_private_message\Service\PrivateMessageMailer::send()
  3. 8.4 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php \Drupal\social_private_message\Service\PrivateMessageMailer::send()
  4. 8.5 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php \Drupal\social_private_message\Service\PrivateMessageMailer::send()
  5. 8.6 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php \Drupal\social_private_message\Service\PrivateMessageMailer::send()
  6. 8.7 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php \Drupal\social_private_message\Service\PrivateMessageMailer::send()
  7. 8.8 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php \Drupal\social_private_message\Service\PrivateMessageMailer::send()
  8. 10.3.x modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php \Drupal\social_private_message\Service\PrivateMessageMailer::send()
  9. 10.0.x modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php \Drupal\social_private_message\Service\PrivateMessageMailer::send()
  10. 10.1.x modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php \Drupal\social_private_message\Service\PrivateMessageMailer::send()
  11. 10.2.x modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php \Drupal\social_private_message\Service\PrivateMessageMailer::send()

Send a private message notification email.

Parameters

\Drupal\private_message\Entity\PrivateMessageInterface $message: The message.

\Drupal\private_message\Entity\PrivateMessageThreadInterface $thread: The message thread.

\Drupal\user\UserInterface[] $members: The message members.

Overrides PrivateMessageMailer::send

File

modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php, line 18

Class

PrivateMessageMailer
A service class for sending notification emails for private messages.

Namespace

Drupal\social_private_message\Service

Code

public function send(PrivateMessageInterface $message, PrivateMessageThreadInterface $thread, array $members = []) {
  foreach ($members as $id => $member) {
    if (!$member instanceof UserInterface || !$member
      ->hasPermission('use private messaging system')) {
      unset($members[$id]);
    }
  }
  parent::send($message, $thread, $members);
}