You are here

public function DrupalMandrill::__construct in Mandrill 7.2

Same name and namespace in other branches
  1. 7 lib/mandrill.inc \DrupalMandrill::__construct()

Override constructor to remove curl operations.

1 call to DrupalMandrill::__construct()
DrupalMandrillTest::__construct in tests/includes/mandrill_test.inc
1 method overrides DrupalMandrill::__construct()
DrupalMandrillTest::__construct in tests/includes/mandrill_test.inc

File

lib/mandrill.inc, line 19
Wrapper class around the Mandrill API.

Class

DrupalMandrill
Class DrupalMandrill.

Code

public function __construct($apikey = NULL, $timeout = 60) {
  if (!$apikey) {
    throw new Mandrill_Error('You must provide a Mandrill API key');
  }
  $this->apikey = $apikey;
  $library = libraries_load('mandrill');
  $this->userAgent = "Mandrill-PHP/{$library['version']}";
  $this->timeout = $timeout;
  $this->root = rtrim($this->root, '/') . '/';
  $this->templates = new Mandrill_Templates($this);
  $this->exports = new Mandrill_Exports($this);
  $this->users = new Mandrill_Users($this);
  $this->rejects = new Mandrill_Rejects($this);
  $this->inbound = new Mandrill_Inbound($this);
  $this->tags = new Mandrill_Tags($this);
  $this->messages = new Mandrill_Messages($this);
  $this->whitelists = new Mandrill_Whitelists($this);
  $this->ips = new Mandrill_Ips($this);
  $this->internal = new Mandrill_Internal($this);
  $this->subaccounts = new Mandrill_Subaccounts($this);
  $this->urls = new Mandrill_Urls($this);
  $this->webhooks = new Mandrill_Webhooks($this);
  $this->senders = new Mandrill_Senders($this);
  $this->metadata = new Mandrill_Metadata($this);
}