php-sparkpost | SparkPost client library for PHP | REST library

 by   SparkPost PHP Version: 2.3.0 License: MIT

kandi X-RAY | php-sparkpost Summary

kandi X-RAY | php-sparkpost Summary

php-sparkpost is a PHP library typically used in Web Services, REST applications. php-sparkpost has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

The official PHP library for using the SparkPost REST API. Before using this library, you must have a valid API Key. To get an API Key, please log in to your SparkPost account and generate one in the Settings page.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              php-sparkpost has a low active ecosystem.
              It has 189 star(s) with 66 fork(s). There are 68 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 2 open issues and 116 have been closed. On average issues are closed in 291 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of php-sparkpost is 2.3.0

            kandi-Quality Quality

              php-sparkpost has 0 bugs and 0 code smells.

            kandi-Security Security

              php-sparkpost has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              php-sparkpost code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              php-sparkpost is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              php-sparkpost releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              php-sparkpost saves you 609 person hours of effort in developing the same functionality from scratch.
              It has 1417 lines of code, 113 functions and 28 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed php-sparkpost and discovered the below as its top functions. This is intended to give you an instant insight into php-sparkpost implemented functionality, and help decide if they suit your requirements.
            • Build request parameters
            • Set the options
            • Add list to recipients
            • Convert an address to an object .
            • Set the promise and return the response .
            • Wait for promise .
            • Return a new response with the given body .
            • Get Headers
            • Get the response body
            • Get the current request
            Get all kandi verified functions for this library.

            php-sparkpost Key Features

            No Key Features are available at this moment for php-sparkpost.

            php-sparkpost Examples and Code Snippets

            No Code Snippets are available at this moment for php-sparkpost.

            Community Discussions

            QUESTION

            How to send multiple emails in one go with SparkPost PHP API?
            Asked 2018-Sep-20 at 08:22

            I've successfully used the PHP transmissions endpoint in Sparkpost PHP API https://github.com/SparkPost/php-sparkpost#send-an-email-using-the-transmissions-endpoint with https://github.com/SparkPost/php-sparkpost#wait-synchronous but now I need to send two different emails to two different addresses, at the same point in my program.

            Seemed like the obvious way was to use the asynchronous method https://github.com/SparkPost/php-sparkpost#then-asynchronous but I can't get this working with the post endpoint. Code below.

            Or is there a better way? I wasn't sure how to make the synchronous code do two separate requests one after the other.

            ...

            ANSWER

            Answered 2018-Sep-20 at 08:22

            You've defined handlers for promise fulfillment and rejection. But the promise requires to be fulfilled or rejected to invoke the handlers.

            Since you're waiting for response from SparkPost, you need to wait() on the promise object.

            $promise1->wait(); $promise2->wait();

            Read last line in Then (Asynchronous) Section of SparkPost Reference.

            Also, if you're planning for multiple promises then you may use \GuzzleHttp\Promise\all() to combine all promises ( as suggested in second last line of same section )

            Source https://stackoverflow.com/questions/52066210

            QUESTION

            SparkPost additional field
            Asked 2018-May-29 at 06:57

            I can´t get my head around syntax on line 25 in this SparkPost code - link on github What if I want to add an additional variable to this?

            ...

            ANSWER

            Answered 2017-Aug-03 at 11:51

            substitution_data is an arbitrary list of key/value pairs you can supply and then use in your content or template. In PHP you pass in substitution_data as an associative array. To add more items to it you can do this:

            Source https://stackoverflow.com/questions/45482542

            QUESTION

            SparkPost client library for PHP: asynch promise.then() send not sending
            Asked 2018-Mar-12 at 14:07

            I'm using the example from https://github.com/SparkPost/php-sparkpost#send-an-email-using-the-transmissions-endpoint

            with the asynch promise here: https://github.com/SparkPost/php-sparkpost#then-asynchronous

            Everything is installed properly using Composer. If I use $response = $promise->wait(); email is sent but not $promise->then(function(){}, function(){})

            I'm running php script from command line, asynch option set to true

            ...

            ANSWER

            Answered 2018-Mar-12 at 14:07

            There is a mistake (or just an bad assumption) in the SparkPost docs.

            You have to call ->wait() somehow anyway. So just add $promise->wait(); in the end of your second script, and it'll be fine.

            By "somehow" I mean that you can combine promises together using all(), some() and other functions.

            Source https://stackoverflow.com/questions/49223411

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install php-sparkpost

            The recommended way to install the SparkPost PHP Library is through composer. Sparkpost requires php-http client (see Setting up a Request Adapter). There are several providers available. If you were using guzzle6 your install might look like this.
            Because of dependency collision, we have opted to use a request adapter rather than requiring a request library. This means that your application will need to pass in a request adapter to the constructor of the SparkPost Library. We use the HTTPlug in SparkPost. Please visit their repo for a list of supported clients and adapters. If you don't currently use a request library, you will need to require one and create a client from it and pass it along. The example below uses the GuzzleHttp Client Library.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/SparkPost/php-sparkpost.git

          • CLI

            gh repo clone SparkPost/php-sparkpost

          • sshUrl

            git@github.com:SparkPost/php-sparkpost.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular REST Libraries

            public-apis

            by public-apis

            json-server

            by typicode

            iptv

            by iptv-org

            fastapi

            by tiangolo

            beego

            by beego

            Try Top Libraries by SparkPost

            heml

            by SparkPostJavaScript

            node-sparkpost

            by SparkPostJavaScript

            matchbox

            by SparkPostTypeScript

            python-sparkpost

            by SparkPostPython

            gosparkpost

            by SparkPostGo