, . CI. Mailjet . , CI docs.
, CodeIgniter Composer, $config ['composer_autoload'] TRUE application/config/config.php.
github CodeIgniter
$config['composer_autoload'] = TRUE; APPPATH.'config/config.php' composer.json / APPPATH locationcomposer install , vendor- , ,
Mailman.php
<?php defined('BASEPATH') OR exit('No direct script access allowed');
use \Mailjet\Resources;
class Mailman extends CI_Controller
{
private $apikey = 'apy__key__here';
private $secretkey = 'apy__secret__here';
protected $mj = NULL;
public function __construct()
{
$this->mj = new \Mailjet\Client($this->apikey, $this->apisecret);
}
public function index()
{
$response = $this->mj->get(Resources::$Contact);
if ($response->success())
var_dump($response->getData());
else
var_dump($response->getStatus());
}
}
Mailjet ( ) CI, docs, . Personaly , .