You are here

public function MandrillAPI::getInboundDomains in Mandrill 8

Gets a list of inbound domains.

Return value

array

Overrides MandrillAPIInterface::getInboundDomains

File

src/MandrillAPI.php, line 129

Class

MandrillAPI
Service class to integrate with Mandrill.

Namespace

Drupal\mandrill

Code

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