interface MassContactInterface in Mass Contact 8
Defines an interface for the Mass Contact helper service.
Hierarchy
- interface \Drupal\mass_contact\MassContactInterface
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
File
- src/
MassContactInterface.php, line 10
Namespace
Drupal\mass_contactView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MassContactInterface:: |
public | function | Get groups of recipients for batch processing. | 1 |
MassContactInterface:: |
public | function | Given categories, returns an array of recipient IDs. | 1 |
MassContactInterface:: |
public | function | Determines if HTML emails are supported. | 1 |
MassContactInterface:: |
constant | Per-category opt-out enabled. | ||
MassContactInterface:: |
constant | User opt-out is disabled. | ||
MassContactInterface:: |
constant | The user opt-out field ID. | ||
MassContactInterface:: |
constant | Global opt-out enabled. | ||
MassContactInterface:: |
public | function | Main entry point for queuing mass contact emails. | 1 |
MassContactInterface:: |
public | function | Takes a mass contact, calculates recipients and queues them for delivery. | 1 |
MassContactInterface:: |
public | function | Sends a message to a list of recipient user IDs. | 1 |