Giter Site home page Giter Site logo

digiaonline / lumen-sparkpost Goto Github PK

View Code? Open in Web Editor NEW
11.0 12.0 1.0 176 KB

SparkPost module for the Lumen PHP framework.

Home Page: https://packagist.org/packages/nordsoftware/lumen-sparkpost

License: MIT License

PHP 100.00%
sparkpost lumen lumen-php-framework php

lumen-sparkpost's Introduction

Lumen SparkPost

Test Coverage Status Code Climate Scrutinizer Code Quality Latest Stable Version Total Downloads License

SparkPost module for the Lumen PHP framework.

Requirements

Setup

Installation

Run the following command to install the package through Composer:

composer require nordsoftware/lumen-sparkpost

Configure

Copy the configuration template in config/sparkpost.php to your application's config directory and modify according to your needs. For more information see the Configuration Files section in the Lumen documentation.

The only required config is the API key, which you can get on your SparkPost account pages. Please note that the default configuration uses synchronous sending mode. If you want to change that, set the async option to true instead.

Bootstrapping

Add the following lines to bootstrap/app.php:

$app->register(Nord\Lumen\SparkPost\SparkPostServiceProvider::class);

Usage

You can now use Nord\Lumen\SparkPost\SparkPostService to access SparkPost anywhere in your application.

public function sendEmail(SparkPostService $sparkpost) {
    $results = $sparkpost->send([
        'from' => [
            'name' => 'From Envelope',
            'email' => '[email protected]',
        ],
        'recipients' => [
            [
                'address' => [
                    'email' => '[email protected]',
                ],
            ],
        ],
        'template' => 'my-first-email',
    ]);
}

Contributing

Please read the guidelines.

Running tests

Clone the project and install its dependencies by running:

composer install

Run the following command to run the test suite:

vendor/bin/codecept run unit

License

MIT, see LICENSE.

lumen-sparkpost's People

Contributors

dependabot[bot] avatar hugovk avatar jalle19 avatar kryysler avatar stylecibot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

nemo4614

lumen-sparkpost's Issues

Add more unit tests

The unit test + coverage framework is set up with a simple test, now more tests are needed to fully test it.

Update dependencies

Package egeloen/http-adapter is abandoned, you should avoid using it. Use php-http/httplug instead.
Package sparkpost/php-sparkpost is abandoned, you should avoid using it. Use sparkpost/sparkpost instead.

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.