PHP code example of siro / php-klaviyo-api

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

    

siro / php-klaviyo-api example snippets


// klaviyo Event API
$klaviyo->event->track($event, $customerProperties, $properties);
$klaviyo->event->trackAsync($event, $customerProperties, $properties);

// email template API
$klaviyo->template->getAll();
$klaviyo->template->create('newuser', $htmlString);

// lists API
$klaviyo->list->getLists();
$klaviyo->list->create('premium');



use Siro\Klaviyo\KlaviyoAPI;

$klaviyo = new KlaviyoAPI();
$klaviyo->event->trackAsync(
    'register',
    ['email' => '[email protected]'],
    []
);