PHP code example of sabbajohn / pulse-php

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

    

sabbajohn / pulse-php example snippets


use Sabbajohn\PulsePhp\PulseClient;

$pulse = new PulseClient('https://pulse.example.com', 'api-token');

$pulse->get('health');

$pulse->emails()->sendSync([
    'to' => [['email' => '[email protected]', 'name' => 'Cliente']],
    'subject' => 'Bem-vindo',
    'html' => '<p>Ola!</p>',
]);

$pulse->automations()->trigger('pedido.criado', ['pedido_id' => 123]);

$pulse->emails()->ingestBounce([
    'email_id' => 154,
    'bounce_type' => 'hard',
    'recipient' => '[email protected]',
    'reason' => 'Mailbox unavailable',
]);
bash
composer