MailHandlerInterface.php 856 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Drupal\contact;
  3. use Drupal\Core\Session\AccountInterface;
  4. /**
  5. * Provides an interface for assembly and dispatch of contact mail messages.
  6. */
  7. interface MailHandlerInterface {
  8. /**
  9. * Sends mail messages as appropriate for a given Message form submission.
  10. *
  11. * Can potentially send up to three messages as follows:
  12. * - To the configured recipient;
  13. * - Auto-reply to the sender; and
  14. * - Carbon copy to the sender.
  15. *
  16. * @param \Drupal\contact\MessageInterface $message
  17. * Submitted message entity.
  18. * @param \Drupal\Core\Session\AccountInterface $sender
  19. * User that submitted the message entity form.
  20. *
  21. * @throws \Drupal\contact\MailHandlerException
  22. * When unable to determine message recipient.
  23. */
  24. public function sendMailMessages(MessageInterface $message, AccountInterface $sender);
  25. }