PrivateMessageMailer.php in Open Social 10.3.x
Same filename and directory in other branches
- 8.9 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php
- 8.2 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php
- 8.3 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php
- 8.4 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php
- 8.5 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php
- 8.6 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php
- 8.7 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php
- 8.8 modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php
- 10.0.x modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php
- 10.1.x modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php
- 10.2.x modules/social_features/social_private_message/src/Service/PrivateMessageMailer.php
Namespace
Drupal\social_private_message\ServiceFile
modules/social_features/social_private_message/src/Service/PrivateMessageMailer.phpView source
<?php
namespace Drupal\social_private_message\Service;
use Drupal\private_message\Entity\PrivateMessageInterface;
use Drupal\private_message\Entity\PrivateMessageThreadInterface;
use Drupal\private_message\Service\PrivateMessageMailer as PrivateMessageMailerBase;
use Drupal\user\UserInterface;
/**
* A service class for sending notification emails for private messages.
*/
class PrivateMessageMailer extends PrivateMessageMailerBase {
/**
* {@inheritdoc}
*/
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);
}
}
Classes
Name | Description |
---|---|
PrivateMessageMailer | A service class for sending notification emails for private messages. |