You are here

public function MandrillAPI::getSenders in Mandrill 8

Gets a list of senders.

Return value

array

Overrides MandrillAPIInterface::getSenders

1 method overrides MandrillAPI::getSenders()
MandrillTestAPI::getSenders in src/MandrillTestAPI.php
Gets a list of senders.

File

src/MandrillAPI.php, line 246

Class

MandrillAPI
Service class to integrate with Mandrill.

Namespace

Drupal\mandrill

Code

public function getSenders() {
  $senders = array();
  try {
    if ($mandrill = $this
      ->getAPIObject()) {
      $senders = $mandrill->senders
        ->getList();
    }
  } catch (\Exception $e) {
    \Drupal::messenger()
      ->addError(t('Mandrill: %message', array(
      '%message' => $e
        ->getMessage(),
    )));
    $this->log
      ->error($e
      ->getMessage());
  }
  return $senders;
}