You are here

interface MassContactInterface in Mass Contact 8

Defines an interface for the Mass Contact helper service.

Hierarchy

Expanded class hierarchy of MassContactInterface

All classes that implement MassContactInterface

11 files declare their use of MassContactInterface
AdminSettingsForm.php in src/Form/AdminSettingsForm.php
AdminSettingsFormTest.php in src/Tests/Form/AdminSettingsFormTest.php
EmailBodyForm.php in src/Form/EmailBodyForm.php
MassContactForm.php in src/Form/MassContactForm.php
MassContactFormTest.php in tests/src/Functional/Form/MassContactFormTest.php

... See full list

File

src/MassContactInterface.php, line 10

Namespace

Drupal\mass_contact
View source
interface MassContactInterface {

  /**
   * User opt-out is disabled.
   */
  const OPT_OUT_DISABLED = 'disabled';

  /**
   * Global opt-out enabled.
   */
  const OPT_OUT_GLOBAL = 'global';

  /**
   * Per-category opt-out enabled.
   */
  const OPT_OUT_CATEGORY = 'category';

  /**
   * The user opt-out field ID.
   */
  const OPT_OUT_FIELD_ID = 'mass_contact_opt_out';

  /**
   * Determines if HTML emails are supported.
   *
   * @return bool
   *   Returns TRUE if the system is capable of sending HTML emails.
   */
  public function htmlSupported();

  /**
   * Main entry point for queuing mass contact emails.
   *
   * @param \Drupal\mass_contact\Entity\MassContactMessageInterface $message
   *   The mass contact message entity.
   * @param array $configuration
   *   An array of configuration. Default values are provided by the mass
   *   contact settings.
   */
  public function processMassContactMessage(MassContactMessageInterface $message, array $configuration = []);

  /**
   * Takes a mass contact, calculates recipients and queues them for delivery.
   *
   * @param \Drupal\mass_contact\Entity\MassContactMessageInterface $message
   *   The mass contact message entity.
   * @param array $configuration
   *   An array of configuration. Default values are provided by the mass
   *   contact settings.
   */
  public function queueRecipients(MassContactMessageInterface $message, array $configuration = []);

  /**
   * Sends a message to a list of recipient user IDs.
   *
   * @param int[] $recipients
   *   An array of recipient user IDs.
   * @param \Drupal\mass_contact\Entity\MassContactMessageInterface $message
   *   The mass contact message entity.
   * @param array $configuration
   *   An array of configuration. Default values are provided by the mass
   *   contact settings.
   */
  public function sendMessage(array $recipients, MassContactMessageInterface $message, array $configuration = []);

  /**
   * Given categories, returns an array of recipient IDs.
   *
   * @param \Drupal\mass_contact\Entity\MassContactCategoryInterface[] $categories
   *   An array of mass contact categories.
   * @param bool $respect_opt_out
   *   Whether to respect opt outs when getting the list of recipients.
   *
   * @return int[]
   *   An array of recipient user IDs.
   */
  public function getRecipients(array $categories, $respect_opt_out);

  /**
   * Get groups of recipients for batch processing.
   *
   * @param int[] $all_recipients
   *   An array of all recipients.
   *
   * @return array
   *   An array of arrays of recipients.
   */
  public function getGroupedRecipients(array $all_recipients);

}

Members

Namesort descending Modifiers Type Description Overrides
MassContactInterface::getGroupedRecipients public function Get groups of recipients for batch processing. 1
MassContactInterface::getRecipients public function Given categories, returns an array of recipient IDs. 1
MassContactInterface::htmlSupported public function Determines if HTML emails are supported. 1
MassContactInterface::OPT_OUT_CATEGORY constant Per-category opt-out enabled.
MassContactInterface::OPT_OUT_DISABLED constant User opt-out is disabled.
MassContactInterface::OPT_OUT_FIELD_ID constant The user opt-out field ID.
MassContactInterface::OPT_OUT_GLOBAL constant Global opt-out enabled.
MassContactInterface::processMassContactMessage public function Main entry point for queuing mass contact emails. 1
MassContactInterface::queueRecipients public function Takes a mass contact, calculates recipients and queues them for delivery. 1
MassContactInterface::sendMessage public function Sends a message to a list of recipient user IDs. 1