PHP code example of smart-sender / php-sdk

1. Go to this page and download the library: Download smart-sender/php-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/ */

    

smart-sender / php-sdk example snippets




$manager = \SmartSender\Manager::withToken('uwWH632A3w47mK80iiC94yiMgGOfw3QNGIdjmnAX5eXqvgNkWGEKdaZQsQCJ');

$response = $manager->console->tags->create([
    'name' => 'Tag 1',
    'color' => '000000',
]);

$tag = $response->getTag();

echo $tag->id;
echo $tag->name;

// setup proxy url
putenv('SMART_SENDER_BASE_URI=https://proxy.com');

// setup access token
putenv('SMART_SENDER_ACCESS_TOKEN=test');

// setup proxy url
putenv('SMART_SENDER_VERSION=v2.2');

// use the Smart Sender API client from default settings
$manager = \SmartSender\Manager::default();

// retrieve value from SMART_SENDER_ACCESS_TOKEN environment variable.
echo $manager->client->getAccessToken();
bash
composer