Git Product home page Git Product logo

lob's Introduction

Lob.com notifications channel for Laravel 5.3

Latest Version on Packagist Software License Build Status StyleCI SensioLabsInsight Quality Score Code Coverage Total Downloads

This package makes it easy to send notifications using Lob.com with Laravel 5.3.

Contents

Installation

You can install the package via composer:

composer require laravel-notification-channels/lob

You must install the service provider:

// config/app.php
'providers' => [
    ...
    NotificationChannels\Lob\LobServiceProvider::class,
],

Setting up lob

  • Register a new account on Lob.com
  • Check for you API keys
  • Finally add your API key to your config/services.php
// config/services.php
...
'lob' => [
    'api_key' => env('LOB_API_KEY'),
],
...

Usage

Now you can use the channel in your via() method inside the notification:

use NotificationChannels\Lob\LobChannel;
use NotificationChannels\Lob\LobPostcard;
use NotificationChannels\Lob\LobAddress;
use Illuminate\Notifications\Notification;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return [LobChannel::class];
    }

    public function toLobPostcard($notifiable)
    {
        return LobPostcard::create()
            ->toAddress(
                LobAddress::create('300 BOYLSTON AVE E')
                    ->name('John Smith')
                    ->city('SEATTLE')
                    ->state('WA')
                    ->zip('98002');
            )
            ->front('https://path.to/my/image/postcardfront.png')
            ->message('Wishing you a wonderful weekend!');
    }
}

Available Postcard methods

  • fromAddress() Address of the sender.
  • toAddress() Address of teh receiver.
  • country() Set the country. US is default.
  • city() required if city is US.
  • state() required if city is US.
  • zip() required if city is US.
  • front() A 4.25"x6.25" or 6.25"x11.25" image to use as the front of the postcard.
  • message() The message at the back of the card.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

lob's People

Contributors

atymic avatar casperboone avatar freekmurze avatar irazasyed avatar jaybizzle avatar mpociot avatar sebastiandedeyne avatar themsaid avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.