Yii2 Freshdesk extension
Simple Yii2 module to extend Freshdesk API, (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist macklus/yii2-freshdesk "*"
or add, (*4)
"macklus/yii2-freshdesk": "*"
to the require section of your composer.json file., (*5)
Usage
Once the extension is installed, simply declare a component in your config file:, (*6)
'freshdesk' => [
'class' => 'macklus\freshdesk\Freshdesk',
'api_key' => 'ThisIsAFakeApiKey',
'domain' => 'macklus',
],
After that, you can call Freshdesk API by using:, (*7)
$response = Yii::$app->freshdesk->tickets->create([
'name' => 'Customer name',
'email' => 'Customer Email',
'cc_emails' => ['Customer Email'],
'subject' => "Your ticket",
'description' => 'The content of ticket',
'status' => 2,
'priority' => 1,
]);