protected function UserMailQueueProcessor::sendMail in Open Social 8.9
Same name and namespace in other branches
- 8.8 modules/social_features/social_user/src/Plugin/QueueWorker/UserMailQueueProcessor.php \Drupal\social_user\Plugin\QueueWorker\UserMailQueueProcessor::sendMail()
- 10.3.x modules/social_features/social_user/src/Plugin/QueueWorker/UserMailQueueProcessor.php \Drupal\social_user\Plugin\QueueWorker\UserMailQueueProcessor::sendMail()
- 10.0.x modules/social_features/social_user/src/Plugin/QueueWorker/UserMailQueueProcessor.php \Drupal\social_user\Plugin\QueueWorker\UserMailQueueProcessor::sendMail()
- 10.1.x modules/social_features/social_user/src/Plugin/QueueWorker/UserMailQueueProcessor.php \Drupal\social_user\Plugin\QueueWorker\UserMailQueueProcessor::sendMail()
- 10.2.x modules/social_features/social_user/src/Plugin/QueueWorker/UserMailQueueProcessor.php \Drupal\social_user\Plugin\QueueWorker\UserMailQueueProcessor::sendMail()
Send the email.
Parameters
string $user_mail: The recipient email address.
string $langcode: The recipient language.
\Drupal\social_queue_storage\Entity\QueueStorageEntity $mail_params: The email content from the storage entity.
string $display_name: In case of anonymous users a display name will be given.
1 call to UserMailQueueProcessor::sendMail()
- UserMailQueueProcessor::processItem in modules/
social_features/ social_user/ src/ Plugin/ QueueWorker/ UserMailQueueProcessor.php - Works on a single queue item.
File
- modules/
social_features/ social_user/ src/ Plugin/ QueueWorker/ UserMailQueueProcessor.php, line 163
Class
- UserMailQueueProcessor
- Queue worker to process email to users.
Namespace
Drupal\social_user\Plugin\QueueWorkerCode
protected function sendMail(string $user_mail, string $langcode, QueueStorageEntity $mail_params, $display_name = NULL) {
$context = [
'subject' => $mail_params
->get('field_subject')->value,
'message' => $mail_params
->get('field_message')->value,
];
if ($display_name) {
$context['display_name'] = $display_name;
}
// Attempt sending mail.
$this->mailManager
->mail('system', 'action_send_email', $user_mail, $langcode, [
'context' => $context,
], $mail_params
->get('field_reply_to')->value);
}