PHP code example of zindua / sdk

1. Go to this page and download the library: Download zindua/sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zindua / sdk example snippets



Zindua\Client;

$zindua = new Client(['apiKey' => getenv('ZINDUA_API_KEY')]);

$result = $zindua->send([
    'to' => '[email protected]',
    'template' => 'otp-verification',
    'lang' => 'fr',
    'variables' => ['code' => '482910', 'appName' => 'MyShop'],
]);

echo $result['logId'];

$zindua->send([
    'to' => '+243812345678',
    'channel' => 'whatsapp',
    'template' => 'otp-verification',
    'variables' => ['code' => '482910'],
]);

$zindua = new Client([
    'apiKey' => getenv('ZINDUA_API_KEY'),
]);

use Zindua\ZinduaFactory;

$zindua = ZinduaFactory::client(); // reads ZINDUA_API_KEY from env

// config/zindua.php
return ['api_key' => env('ZINDUA_API_KEY')];

// AppServiceProvider
$this->app->singleton(Client::class, fn () => new Client([
    'apiKey' => config('zindua.api_key'),
]));



$zindua = new \Zindua\Client(['apiKey' => getenv('ZINDUA_API_KEY')]);