You are here

public function MassContact::__construct in Mass Contact 8

Constructs the Mass Contact helper.

Parameters

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler service.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory service.

\Drupal\Core\Queue\QueueFactory $queue: The queue factory.

\Drupal\Core\Mail\MailManagerInterface $mail_manager: The mail plugin manager.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager service.

\Drupal\mass_contact\OptOutInterface $opt_out: The mass contact opt-out service.

\Drupal\Core\Session\AccountInterface $current_user: The current user.

File

src/MassContact.php, line 110

Class

MassContact
The Mass Contact helper service.

Namespace

Drupal\mass_contact

Code

public function __construct(ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory, QueueFactory $queue, MailManagerInterface $mail_manager, EntityTypeManagerInterface $entity_type_manager, OptOutInterface $opt_out, AccountInterface $current_user) {
  $this->moduleHandler = $module_handler;
  $this->config = $config_factory
    ->get('mass_contact.settings');
  $this->optOut = $opt_out;
  $this->processingQueue = $queue
    ->get('mass_contact_queue_messages', TRUE);
  $this->sendingQueue = $queue
    ->get('mass_contact_send_message', TRUE);
  $this->mail = $mail_manager;
  $this->entityTypeManager = $entity_type_manager;
  $this->currentUser = $current_user;
}