Loading src/MassContact.php +9 −1 Changes for src/MassContact.php: 9 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -271,18 +271,26 @@ class MassContact implements MassContactInterface { foreach ($recipients as $recipient) { /** @var \Drupal\user\UserInterface $account */ $account = $this->entityTypeManager->getStorage('user')->load($recipient); if ($account) { $emails[] = $account->getEmail(); } } if (count($emails) > 0) { $params['headers']['Bcc'] = implode(',', array_unique($emails)); $this->mail->mail('mass_contact', 'mass_contact', $configuration['sender_mail'], \Drupal::languageManager()->getDefaultLanguage()->getId(), $params); $this->mail->mail('mass_contact', 'mass_contact', $configuration['sender_mail'], \Drupal::languageManager() ->getDefaultLanguage() ->getId(), $params); } } else { foreach ($recipients as $recipient) { /** @var \Drupal\user\UserInterface $account */ $account = $this->entityTypeManager->getStorage('user')->load($recipient); if ($account) { $this->mail->mail('mass_contact', 'mass_contact', $account->getEmail(), $account->getPreferredLangcode(), $params); } } } } } Loading
src/MassContact.php +9 −1 Changes for src/MassContact.php: 9 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -271,18 +271,26 @@ class MassContact implements MassContactInterface { foreach ($recipients as $recipient) { /** @var \Drupal\user\UserInterface $account */ $account = $this->entityTypeManager->getStorage('user')->load($recipient); if ($account) { $emails[] = $account->getEmail(); } } if (count($emails) > 0) { $params['headers']['Bcc'] = implode(',', array_unique($emails)); $this->mail->mail('mass_contact', 'mass_contact', $configuration['sender_mail'], \Drupal::languageManager()->getDefaultLanguage()->getId(), $params); $this->mail->mail('mass_contact', 'mass_contact', $configuration['sender_mail'], \Drupal::languageManager() ->getDefaultLanguage() ->getId(), $params); } } else { foreach ($recipients as $recipient) { /** @var \Drupal\user\UserInterface $account */ $account = $this->entityTypeManager->getStorage('user')->load($recipient); if ($account) { $this->mail->mail('mass_contact', 'mass_contact', $account->getEmail(), $account->getPreferredLangcode(), $params); } } } } }