LaravelPackages.net
Acme Inc.
Toggle sidebar
rpwebdevelopment/laravel-blueshift

Blueshift integration package for laravel

10
0
v0.1.3
About rpwebdevelopment/laravel-blueshift

rpwebdevelopment/laravel-blueshift is a Laravel package for blueshift integration package for laravel. It currently has 0 GitHub stars and 10 downloads on Packagist (latest version v0.1.3). Install it with composer require rpwebdevelopment/laravel-blueshift. Discover more Laravel packages by rpwebdevelopment or browse all Laravel packages to compare alternatives.

Last updated

Blueshift integration package for laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is a Laravel specific package designed to make communication with the Blueshift API quick and easy.

Requirements

Currently this package only functions on Laravel 8.*

Installation

You can install the package via composer:

composer require rpwebdevelopment/laravel-blueshift

Usage

Configuration

Before the library can function, it expects the blueshift configuration to be provided This package provides a base version of the configuration which you can install by running

php artisan vendor:publish --tag=blueshift-config

The Base configuration pulls values from the environment (env) to populate the configuration.

  • BLUESHIFT_API_KEY - This should be the "Users Api Key" provided by Blueshift
  • BLUESHIFT_BASE_URL - Defaults to 'https://api.eu.getblueshift.com', for non EU this should be set to 'https://api.getblueshift.com'

Class Structure

laravel-blueshift provides specific classes for handling different API endpoints, the available classes and their methods are as follows:

  • BlueshiftCustomer
    • search(string $email);
    • get(string $uuid);
    • createJson(string $customer);
    • createArray(array $customer);
    • bulkCreateJson(string $customers);
    • bulkCreateArray(array $customers);
    • manageCustomerSubscriptions(?string $email = null, ?string $uuid = null, bool $unsubscribedEmail = false, bool $unsubscribedPush = false, bool $unsubscribedSms = false);
    • unsubscribeCustomerFromEmail(?string $email = null, ?string $uuid = null);
    • unsubscribeCustomerFromSms(?string $email = null, ?string $uuid = null);
    • unsubscribeCustomerFromPush(?string $email = null, ?string $uuid = null);
    • unsubscribeCustomerFromAll(?string $email = null, ?string $uuid = null);
    • manageEmailListSubscriptions(array $emailList, ?bool $unsubscribedEmail = null, ?bool $unsubscribedPush = null, ?bool $unsubscribedSms = null);
    • startTracking(?string $email, ?string $uuid);
    • stopTracking(?string $email, ?string $uuid);
    • delete(?string $email, ?string $uuid, bool $allMatching)
  • BlueshiftCatalog
    • createCatalog(string $name);
    • getList();
    • addItems(string $uuid, array $items);
    • getCatalog(string $uuid);
  • BlueshiftUserList
    • createList(string $name, string $description, string $source = 'email');
    • addUserToList(int $listId, string $identifierKey, string $identifierValue);
    • removeUserFromList(int $listId, string $identifierKey, string $identifierValue);
  • BlueshiftEvent
    • sendEvent(array $event);

From your laravel application these methods can be called as follows:

try {
    $customer = app(BlueshiftCustomer::class)->search('[email protected]');
} catch (\Exception $e) {
}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.

Comments