You are here

public function DrupalMandrill::__construct in Mandrill 8

Override constructor to remove curl operations.

File

src/DrupalMandrill.php, line 31

Class

DrupalMandrill
Overrides default Mandrill library to provide custom API call function.

Namespace

Drupal\mandrill

Code

public function __construct($apikey = NULL, $timeout = 60) {
  if (!$apikey) {
    throw new Mandrill_Error('You must provide a Mandrill API key');
  }
  $this->apikey = $apikey;
  $this->userAgent = "Mandrill-PHP/1.0.55";
  $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);
}