You are here

interface MessageWrapperInterface in Sparkpost email 8.2

An interface for the message wrapper we use.

Hierarchy

Expanded class hierarchy of MessageWrapperInterface

All classes that implement MessageWrapperInterface

3 files declare their use of MessageWrapperInterface
QueuedMessageWrapper.php in modules/sparkpost_requeue/src/QueuedMessageWrapper.php
SparkpostSend.php in src/Plugin/QueueWorker/SparkpostSend.php
sparkpost_requeue.module in modules/sparkpost_requeue/sparkpost_requeue.module
Sparkpost requeue module.

File

src/MessageWrapperInterface.php, line 14
Message class.

Namespace

Drupal\sparkpost
View source
interface MessageWrapperInterface {

  /**
   * MessageWrapperInterface constructor.
   *
   * @param \Drupal\sparkpost\ClientServiceInterface $clientService
   *   Client service.
   */
  public function __construct(ClientServiceInterface $clientService);

  /**
   * Gets the sparkpost message to send.
   *
   * @return array
   *   Message structure,
   */
  public function getSparkpostMessage();

  /**
   * Gets the Drupal message the sparkpost message was based on.
   *
   * @return array
   *   The drupal message.
   */
  public function getDrupalMessage();

  /**
   * Gets the last exception thrown.
   *
   * @return \SparkPost\SparkPostException
   *   The exception.
   */
  public function getApiResponseException();

  /**
   * Gets the last result.
   *
   * @return array
   *   Result.
   */
  public function getResult();

  /**
   * Gets the client service.
   */
  public function getClientService();

  /**
   * Sets the sparkpost message.
   *
   * @param array $sparkpost_message
   *   The message structure needed.
   */
  public function setSparkpostMessage(array $sparkpost_message);

  /**
   * Sets the Drupal message.
   *
   * @param array $drupal_message
   *   Drupal message structure.
   */
  public function setDrupalMessage(array $drupal_message);

  /**
   * Sets the result from the API call.
   *
   * @param array $result
   *   The result we got.
   */
  public function setResult(array $result);

  /**
   * Sets the API response exception.
   *
   * @param \SparkPost\SparkPostException $sparkPostException
   *   The exception.
   */
  public function setApiResponseException(SparkPostException $sparkPostException);

  /**
   * Clears the API response exception.
   */
  public function clearApiResposeException();

  /**
   * Sends the message.
   *
   * @return bool
   *   If it was a success or not.
   */
  public function sendMessage();

}

Members

Namesort descending Modifiers Type Description Overrides
MessageWrapperInterface::clearApiResposeException public function Clears the API response exception. 1
MessageWrapperInterface::getApiResponseException public function Gets the last exception thrown. 1
MessageWrapperInterface::getClientService public function Gets the client service. 1
MessageWrapperInterface::getDrupalMessage public function Gets the Drupal message the sparkpost message was based on. 1
MessageWrapperInterface::getResult public function Gets the last result. 1
MessageWrapperInterface::getSparkpostMessage public function Gets the sparkpost message to send. 1
MessageWrapperInterface::sendMessage public function Sends the message. 1
MessageWrapperInterface::setApiResponseException public function Sets the API response exception. 1
MessageWrapperInterface::setDrupalMessage public function Sets the Drupal message. 1
MessageWrapperInterface::setResult public function Sets the result from the API call. 1
MessageWrapperInterface::setSparkpostMessage public function Sets the sparkpost message. 1
MessageWrapperInterface::__construct public function MessageWrapperInterface constructor. 1