You are here

protected function LanguageAwareSendMailQueueWorker::setActiveLanguage in Queue Mail 8

Restores back the negotiated language.

Parameters

array $message: Mail message.

string $langcode: The negotiated language code.

Overrides SendMailQueueWorker::setActiveLanguage

File

modules/queue_mail_language/src/Plugin/QueueWorker/LanguageAwareSendMailQueueWorker.php, line 86

Class

LanguageAwareSendMailQueueWorker
Sends emails from queue with language support.

Namespace

Drupal\queue_mail_language\Plugin\QueueWorker

Code

protected function setActiveLanguage(array $message, $langcode) {
  if ($message['langcode'] !== $langcode) {
    $this
      ->setNegotiatorLanguage($langcode);
  }
}