You are here

public function EmailHandler::__construct in Easy Email 8

Same name and namespace in other branches
  1. 2.0.x src/Service/EmailHandler.php \Drupal\easy_email\Service\EmailHandler::__construct()

EmailHandler constructor.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager:

\Drupal\Core\Mail\MailManagerInterface $mailManager:

\Drupal\Core\Language\LanguageManagerInterface $languageManager:

\Drupal\Core\Render\RendererInterface $renderer:

\Drupal\Component\Datetime\TimeInterface $time:

\Drupal\easy_email\Service\EmailTokenEvaluatorInterface $tokenEvaluator:

\Drupal\easy_email\Service\EmailUserEvaluatorInterface $userEvaluator:

\Drupal\easy_email\Service\EmailAttachmentEvaluatorInterface $attachmentEvaluator:

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

src/Service/EmailHandler.php, line 106

Class

EmailHandler

Namespace

Drupal\easy_email\Service

Code

public function __construct(EntityTypeManagerInterface $entityTypeManager, MailManagerInterface $mailManager, LanguageManagerInterface $languageManager, RendererInterface $renderer, TimeInterface $time, EmailTokenEvaluatorInterface $tokenEvaluator, EmailUserEvaluatorInterface $userEvaluator, EmailAttachmentEvaluatorInterface $attachmentEvaluator, EventDispatcherInterface $eventDispatcher) {
  $this->languageManager = $languageManager;
  $this->mailManager = $mailManager;
  $this->renderer = $renderer;
  $this->entityTypeManager = $entityTypeManager;
  $this->emailStorage = $entityTypeManager
    ->getStorage('easy_email');
  $this->emailViewBuilder = $entityTypeManager
    ->getViewBuilder('easy_email');
  $this->emailTypeStorage = $entityTypeManager
    ->getStorage('easy_email_type');
  $this->time = $time;
  $this->tokenEvaluator = $tokenEvaluator;
  $this->userEvaluator = $userEvaluator;
  $this->attachmentEvaluator = $attachmentEvaluator;
  $this->renderedPreviews = [];
  $this->eventDispatcher = $eventDispatcher;
}