You are here

public function MandrillAPI::getWebhooks in Mandrill 8

Gets a list of webhooks.

Return value

array

Overrides MandrillAPIInterface::getWebhooks

File

src/MandrillAPI.php, line 111

Class

MandrillAPI
Service class to integrate with Mandrill.

Namespace

Drupal\mandrill

Code

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