PHP code example of sendstreak / sendstreak-php

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

    

sendstreak / sendstreak-php example snippets


$client = new SendStreak\SendStreakPhp\SendStreakClient("YOUR_API_KEY");

$contact = new SendStreak\SendStreakPhp\Contact(
    "[email protected]", 
    [
        'firstName' => 'John',
        'lastName' => 'Doe',
        'onboarded' => false
    ]
);
// Push your contacts to SendStreak with as many attributes as you want
$client->updateContact($contact);

// Send them emails using predefined templates
$client->sendMail(
    "[email protected]",
    "customer-welcome-email",
    [
        'username' => 'johndoe'
    ]
);

// You can also do the same asynchronously
$client->updateContactAsync($contact);

$client->sendMailAsync(
    "[email protected]",
    "customer-welcome-email",
    [
        'username' => 'johndoe'
    ]
);