alexthekiwi / boltmail-laravel-sdk
A package for interacting with the Boltmail API
1.0.0
2022-04-20 22:01 UTC
Requires
- php: ^7.4|^8.0
- guzzlehttp/guzzle: ^7.2
- laravel/framework: ^8.12 | ^9.0
README
A package for interacting with the Boltmail API with Laravel.
Installation
- Generate an API key pair through the Boltmail admin screen
- Set the
BOLTMAIL_PUBLIC_KEY
variable in your .env - Publish the config file for this package with
php artisan vendor:publish --provider="AlexClark\Boltmail\BoltmailServiceProvider"
Usage
This package uses Laravel's service container and facades to call available methods statically. If there's a method you need that's not built in to the facade, you can use the "call" method and provide the endpoint/params manually.
Check out AlexClark\Boltmail\Boltmail
to see all built-in methods.
<?php 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' => 'example@example.com', 'FNAME' => 'First', 'LNAME' => 'Last' ]; Boltmail::addSubscriber($listId, $subscriber); } }