You are here

public function MandrillAPI::getTags in Mandrill 8

Gets a list of tags.

Return value

array

Overrides MandrillAPIInterface::getTags

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

File

src/MandrillAPI.php, line 165

Class

MandrillAPI
Service class to integrate with Mandrill.

Namespace

Drupal\mandrill

Code

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