You are here

function mandrill_update_webhook in Mandrill 7.2

Update an existing webhook.

File

./mandrill.module, line 549
Enables Drupal to send email directly through Mandrill.

Code

function mandrill_update_webhook($id, $path, $events, $description = 'Drupal Webhook') {
  $result = NULL;
  try {
    if ($mandrill = mandrill_get_api_object()) {
      $result = $mandrill->webhooks
        ->update($id, $GLOBALS['base_url'] . '/' . $path, $description, $events);
    }
  } catch (Mandrill_Error $e) {
    drupal_set_message(t('Mandrill: %message', array(
      '%message' => $e
        ->getMessage(),
    )), 'error');
    watchdog_exception('mandrill', $e);
  }
  return $result;
}