Drupal 8  8.0.2
MailHandler Class Reference
Inheritance diagram for MailHandler:

Public Member Functions

 __construct (MailManagerInterface $mail_manager, LanguageManagerInterface $language_manager, LoggerInterface $logger, TranslationInterface $string_translation, EntityManagerInterface $entity_manager)
 
 sendMailMessages (MessageInterface $message, AccountInterface $sender)
 

Protected Attributes

 $languageManager
 
 $logger
 
 $mailManager
 
 $userStorage
 

Detailed Description

Provides a class for handling assembly and dispatch of contact mail messages.

Constructor & Destructor Documentation

__construct ( MailManagerInterface  $mail_manager,
LanguageManagerInterface  $language_manager,
LoggerInterface  $logger,
TranslationInterface  $string_translation,
EntityManagerInterface  $entity_manager 
)

Constructs a new object.

Parameters
\Drupal\Core\Mail\MailManagerInterface$mail_managerMail manager service.
\Drupal\Core\Language\LanguageManagerInterface$language_managerLanguage manager service.
\Psr\Log\LoggerInterface$loggerA logger instance.
\Drupal\Core\StringTranslation\TranslationInterface$string_translationString translation service.
\Drupal\Core\Entity\EntityManagerInterface$entity_managerEntity manager service.

References EntityTypeManagerInterface\getStorage(), Drupal\languageManager(), and Drupal\logger().

Here is the call graph for this function:

Member Function Documentation

sendMailMessages ( MessageInterface  $message,
AccountInterface  $sender 
)

{Sends mail messages as appropriate for a given Message form submission.Can potentially send up to three messages as follows:

  • To the configured recipient;
  • Auto-reply to the sender; and
  • Carbon copy to the sender.
Parameters
\Drupal\contact\MessageInterface$messageSubmitted message entity.
\Drupal\Core\Session\AccountInterface$senderUser that submitted the message entity form.
Exceptions
\Drupal\contact\MailHandlerExceptionWhen unable to determine message recipient.
}

Implements MailHandlerInterface.

References MessageInterface\copySender(), MessageInterface\getContactForm(), MessageInterface\getPersonalRecipient(), MessageInterface\getSenderMail(), MessageInterface\getSenderName(), AccountInterface\id(), MessageInterface\isPersonal(), Drupal\languageManager(), Drupal\logger(), and t().

Here is the call graph for this function:


The documentation for this class was generated from the following file: