Looking to hire Laravel developers? Try LaraJobs

boltmail-laravel-sdk maintained by alexthekiwi

Description
A package for interacting with the Boltmail API
Author
Last update
2022/04/21 00:01 (dev-main)
License
Links
Downloads
19

Comments
comments powered by Disqus

Boltmail Laravel Adaptor

A package for interacting with the Boltmail API with Laravel.

Installation

  1. Generate an API key pair through the Boltmail admin screen
  2. Set the BOLTMAIL_PUBLIC_KEY variable in your .env
  3. 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);
    }
}