You are here

public function MandrillAPI::getURLs in Mandrill 8

Gets the 100 most-clicked URLs.

Return value

array Array of URL objects.

Overrides MandrillAPIInterface::getURLs

1 method overrides MandrillAPI::getURLs()
MandrillTestAPI::getURLs in src/MandrillTestAPI.php
Gets the 100 most-clicked URLs.

File

src/MandrillAPI.php, line 309

Class

MandrillAPI
Service class to integrate with Mandrill.

Namespace

Drupal\mandrill

Code

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