1. Go to this page and download the library: Download woyra/woyra-php 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/ */
woyra / woyra-php example snippets
ra = new Woyra\Client('wk_live_...'); // or new Woyra\Client() to read WOYRA_API_KEY
$email = $woyra->emails->send([
'from' => 'Acme <[email protected]>',
'to' => '[email protected]', // a string, or an array of strings
'subject' => 'Your code',
'text' => 'Your code is 483920',
]);
echo $email['id'], ' ', $email['status'];
$woyra = new Woyra\Client('wk_live_...', [
'base_url' => 'https://kenya.woyra.io', // default https://api.woyra.io (or WOYRA_BASE_URL)
'max_retries' => 3, // retries after the first attempt
'timeout' => 30.0, // per attempt, in seconds
'api_version' => '2026-09-01', // sent as Woyra-Version when set
]);
$domain = $woyra->domains->create('yourdomain.com');
print_r($domain['records']); // DNS records to publish
$woyra->domains->verify($domain['id']);
$endpoint = $woyra->webhooks->create('https://api.yourapp.com/hooks/woyra', ['email.delivered', 'email.opened', 'email.clicked']);
echo $endpoint['secret']; // shown once: store it