You are here

function mandrill_add_inbound_route in Mandrill 7.2

Same name and namespace in other branches
  1. 8 mandrill.module \mandrill_add_inbound_route()

Create a new inbound route for a domain.

File

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

Code

function mandrill_add_inbound_route($domain, $pattern, $url) {
  $route = NULL;
  try {
    if ($mandrill = mandrill_get_api_object()) {
      $route = $mandrill->inbound
        ->addRoute($domain, $pattern, $url);
    }
  } catch (Mandrill_Error $e) {
    drupal_set_message(t('Mandrill: %message', array(
      '%message' => $e
        ->getMessage(),
    )), 'error');
    watchdog_exception('mandrill', $e);
  }
  return $route;
}