MailManager

Provides a Mail plugin manager. Hierarchy class \Drupal\Component\Plugin\PluginManagerBase implements PluginManagerInterface uses DiscoveryTraitclass \Drupal\Core\Plugin\DefaultPluginManager implements CachedDiscoveryInterface, PluginManagerInterface, CacheableDependencyInterface uses DiscoveryCachedTrait, UseCacheBackendTraitclass \Drupal\Core\Mail\MailManager implements MailManagerInterface uses StringTranslationTrait See also \Drupal\Core\Annotation\Mail \Drupal\Core\Mail\MailInterface

MailInterface::mail

public MailInterface::mail(array $message) Sends a message composed by \Drupal\Core\Mail\MailManagerInterface->mail(). Parameters array $message: Message array with at least the following elements: id: A unique identifier of the email type. Examples: 'contact_user_copy', 'user_password_reset'. to: The mail address or addresses where the message will be sent to. The formatting of this string will be validated with the PHP email validation filter. Some examples: user@example.com user@examp

MailInterface::format

public MailInterface::format(array $message) Formats a message prior to sending. Allows to preprocess, format, and postprocess a mail message before it is passed to the sending system. By default, all messages may contain HTML and are converted to plain-text by the Drupal\Core\Mail\Plugin\Mail\PhpMail implementation. For example, an alternative implementation could override the default implementation and also sanitize the HTML for usage in a MIME- encoded email, but still invoking the Drupal\Co

MailInterface

Defines an interface for pluggable mail back-ends. Hierarchy interface \Drupal\Core\Mail\MailInterface See also \Drupal\Core\Annotation\Mail \Drupal\Core\Mail\MailManager Plugin API File core/lib/Drupal/Core/Mail/MailInterface.php, line 12 Namespace Drupal\Core\Mail Members Name Modifiers Type Description MailInterface::format public function Formats a message prior to sending. MailInterface::mail public function Sends a message composed by \Drupal\Core\Mail\Mai

MailHandlerInterface::sendMailMessages

public MailHandlerInterface::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 $message: Submitted message entity. \Drupal\Core\Session\AccountInterface $sender: User that submitted the message entity form. Throws \Drup

MailHandlerInterface

Provides an interface for assembly and dispatch of contact mail messages. Hierarchy interface \Drupal\contact\MailHandlerInterface File core/modules/contact/src/MailHandlerInterface.php, line 10 Namespace Drupal\contact Members Name Modifiers Type Description MailHandlerInterface::sendMailMessages public function Sends mail messages as appropriate for a given Message form submission.

MailHandlerException

Exception thrown by MailHandler when unable to determine message recipient. Hierarchy class \Drupal\contact\MailHandlerException extends \RuntimeException File core/modules/contact/src/MailHandlerException.php, line 8 Namespace Drupal\contact Members

MailHandler::__construct

public MailHandler::__construct(MailManagerInterface $mail_manager, LanguageManagerInterface $language_manager, LoggerInterface $logger, TranslationInterface $string_translation, EntityManagerInterface $entity_manager) Constructs a new \Drupal\contact\MailHandler object. Parameters \Drupal\Core\Mail\MailManagerInterface $mail_manager: Mail manager service. \Drupal\Core\Language\LanguageManagerInterface $language_manager: Language manager service. \Psr\Log\LoggerInterface $logger: A logger inst

MailHandler::sendMailMessages

public MailHandler::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 $message: Submitted message entity. \Drupal\Core\Session\AccountInterface $sender: User that submitted the message entity form. Throws \Drupal\contac

MailHandler::$userStorage

The user entity storage handler. Type: \Drupal\Core\Entity\EntityStorageInterface File core/modules/contact/src/MailHandler.php, line 46 Class MailHandler Provides a class for handling assembly and dispatch of contact mail messages. Namespace Drupal\contact Code protected $userStorage;