You are here

public function MandrillAPI::getUser in Mandrill 8

Gets current API user information.

Return value

array

Overrides MandrillAPIInterface::getUser

1 method overrides MandrillAPI::getUser()
MandrillTestAPI::getUser in src/MandrillTestAPI.php
Gets current API user information.

File

src/MandrillAPI.php, line 147

Class

MandrillAPI
Service class to integrate with Mandrill.

Namespace

Drupal\mandrill

Code

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