public function SendinblueMailin::__construct in SendinBlue 7.2
Same name and namespace in other branches
- 7 includes/sendinblue.mailin.php \SendinblueMailin::__construct()
File
- includes/
sendinblue.mailin.php, line 25 - Rest class file.
Class
- SendinblueMailin
- Sendinblue REST client.
Code
public function __construct() {
$this->sendInBlueLoggerFactory = new SendInBlueLoggerFactory();
$this->sendInBlueConfigFactory = new SendInBlueConfigFactory();
if (!function_exists('curl_init')) {
$this->sendInBlueLoggerFactory
->error('SendinBlue requires CURL module');
return;
}
if (module_exists('libraries')) {
libraries_load('sendinblue');
}
if (!method_exists(Configuration::class, 'getApiKey')) {
drupal_set_message('SendInBlue client initialization failed: Unable to load the SendInBlue PHP library.', 'error');
$this->sendInBlueLoggerFactory
->error('SendInBlue client initialization failed: Unable to load the SendInBlue PHP library.');
}
$this->sendinblueApiV2 = new SendinblueApiV2();
$this->sendinblueApiV3 = new SendinblueApiV3();
$this
->updateSendinblueMailin($this
->getAccessKey());
}