PHP code example of alexthekiwi / boltmail-laravel-sdk

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

    

alexthekiwi / boltmail-laravel-sdk example snippets




namespace App\Http\Controllers;

use Illuminate\Http\Request;
use AlexClark\Boltmail\Facades\Boltmail;

class SubscriberController extends Controller
{
    /**
     * Gets all lists from Boltmail
     */
    public function index()
    {
        Boltmail::getLists();
    }

    /**
     * Adds a subscriber to a specified list
     */
    public function store()
    {
        $listId = 'abcdef123';

        $subscriber = [
            'EMAIL' => '[email protected]',
            'FNAME' => 'First',
            'LNAME' => 'Last'
        ];

        Boltmail::addSubscriber($listId, $subscriber);
    }
}