diff core/modules/contact/src/MailHandlerInterface.php @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/modules/contact/src/MailHandlerInterface.php	Thu Jul 05 14:24:15 2018 +0000
@@ -0,0 +1,30 @@
+<?php
+
+namespace Drupal\contact;
+
+use Drupal\Core\Session\AccountInterface;
+
+/**
+ * Provides an interface for assembly and dispatch of contact mail messages.
+ */
+interface MailHandlerInterface {
+
+  /**
+   * 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.
+   *
+   * @param \Drupal\contact\MessageInterface $message
+   *   Submitted message entity.
+   * @param \Drupal\Core\Session\AccountInterface $sender
+   *   User that submitted the message entity form.
+   *
+   * @throws \Drupal\contact\MailHandlerException
+   *   When unable to determine message recipient.
+   */
+  public function sendMailMessages(MessageInterface $message, AccountInterface $sender);
+
+}