Git Product home page Git Product logo

yii2-sparkpost's People

Contributors

alexander-emelyanov avatar bariew avatar djagya avatar mary-grace avatar vitaliykoziy avatar

Stargazers

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

Watchers

 avatar  avatar

yii2-sparkpost's Issues

Exception when setTo() is empty

When setTo() receives an empty value (such as an empty array []) it will crash with an exception.
I think an exception is too much. It should simply skip sending when the receiver list is empty and perhaps log a warning (yii2-mandrill does this too). Excellent extension otherwise! Thank you for the great work.

Retrieving Sparkpost return or error codes

Is there a way to retrieve the return or error codes that a returned from Sparkpost? I see that there is an exception where those details can get logged in line 187 of Mailer.php, but that doesn't seem to be exposed anywhere.

SparkPost API error messages hidden

Hello again!

I found another minor (but quite significant) problem with errors.
Whenever SparkPost rejects a transmission for whatever reason we get an exception.
It all happens on these two lines.

The problem is that there are additional strings sent from SparkPost and whenever this happens (for example when quotas are exceeded) those are not included in the final exception.

In addition to 'message' APIResponseException includes some additional and critical information in the following two variables: 'apiMessage' and 'apiCode'. Could you please include them in Yii's log and the final thrown exception?


Additionally, while at it, would it be possible to add a setting to allow Mailer to fail gracefully without exceptions? It is quite problematic when the entire application crashes because of something that happened on SparPost's server. Otherwise we need to wrap every single send() call in a try-catch block, because you never know when SparkPost might decide to crash our application. Better yet, make it fail gracefully by default and simply return false when an exception occurs because of SparkPost to indicate the email was not sent successfully.

Sending multiples emails with data

Hi @djagya,

I'm writing here like "an issue" but it would be new feature on the API.
I saw that SparkPost it's able to send multiples emails using custom data for each user, like the example below:

{
  "campaign_id": "campaign_name",
  "recipients": [
    {
      "address": "[email protected]",
      "metadata": {
        "unique_id": 1212
      },
      "substitution_data": {
        "nome": "Name 1",
        "nova_senha": "axIjU2"
      }
    },
    {
      "address": "[email protected]",
      "metadata": {
        "unique_id": 7862
      },
      "substitution_data": {
        "nome": "Name 2",
        "nova_senha": "asCADe12"
      }
    }
  ],
  "content": {
    "template_id": "template_id_publish"
  }
}

I didn't find anything that configure this JSON on Yii2's API, so it would be great to have this feature on Yii2's API. This could improve even more the development on Yii2 saving unnecessary looping.

What do you think about that? Did you solve this case with another solution?

Thanks.

Sparkpost 2.0 Library

Hi,

I see you've switched to the latest Sparkpost library (2.0). I haven't spent much on investigating what's new but I did notice for instance APIResponseException class is missing which should cause this plugin to break.

Just a heads up.

Matjaz

Installation via composer failed.

Hi,

Thanks for such a nice extension, I am trying to install this plugin via composer but it fails to install, below is the error.

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/browser-kit v4.0.3 requires php ^7.1.3 -> your PHP version (7.0.0) does not satisfy that requirement.
    - symfony/browser-kit v4.0.3 requires php ^7.1.3 -> your PHP version (7.0.0) does not satisfy that requirement.
    - Installation request for symfony/browser-kit (installed at v4.0.3) -> satisfiable by symfony/browser-kit[v4.0.3].


Installation failed, reverting ./composer.json to its original content.

Is there a way around without upgrading to php 7.1.3?

Package sparkpost/php-sparkpost is abandoned

Hi! When I update packages in my project, I receive the following message

egeloen/http-adapter suggests installing doctrine/cache (Allows you to use the cache event subscriber)
egeloen/http-adapter suggests installing ext-http (Allows you to use the PECL adapter)
egeloen/http-adapter suggests installing guzzle/guzzle (Allows you to use the Guzzle 3 adapter)
egeloen/http-adapter suggests installing guzzlehttp/guzzle (Allows you to use the Guzzle 4 adapter)
egeloen/http-adapter suggests installing kriswallsmith/buzz (Allows you to use the Buzz adapter)
egeloen/http-adapter suggests installing nategood/httpful (Allows you to use the Httpful adapter)
egeloen/http-adapter suggests installing rmccue/requests (Allows you to use the Requests adapter)
egeloen/http-adapter suggests installing symfony/stopwatch (Allows you to use the stopwatch http adapter and event subscriber)
egeloen/http-adapter suggests installing tedivm/stash (Allows you to use the cache event subscriber)
egeloen/http-adapter suggests installing zendframework/zendframework1 (Allows you to use the Zend 1 adapter)
egeloen/http-adapter suggests installing zendframework/zend-http (Allows you to use the Zend 2 adapter)
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.

Think it is time to update this package.
Do you plan to update soon?

sparkpost v2

do you have plans to use sparkpost library v2?

Transmission ID

Hi,

is it possible that you return Transmission ID (contained in the result from sparkpost) instead of TRUE when message is succesfully sent?

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.