You are here

public function MandrillAPI::getTag in Mandrill 8

Gets a single tag.

Parameters

string $tag: The tag as a string.

Return value

array The tag information.

Overrides MandrillAPIInterface::getTag

File

src/MandrillAPI.php, line 187

Class

MandrillAPI
Service class to integrate with Mandrill.

Namespace

Drupal\mandrill

Code

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