Version 1
[yaffs-website] / web / core / modules / contact / src / MailHandlerInterface.php
diff --git a/web/core/modules/contact/src/MailHandlerInterface.php b/web/core/modules/contact/src/MailHandlerInterface.php
new file mode 100644 (file)
index 0000000..6525ef3
--- /dev/null
@@ -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);
+
+}