djagya / yii2-sparkpost Goto Github PK
View Code? Open in Web Editor NEWSparkPost integration for Yii2
License: MIT License
SparkPost integration for Yii2
License: MIT License
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.
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.
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.
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.
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
Codeception's Yii2 Module is works well with the default yii2-swiftmailer, but cannot be used with yii2-sparkpost.
It is currently impossible to run the tests inside yii2-app-advanced if we switch to this sparkpost mailer, because it lacks support for file transport.
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?
Can you please make a Guzzle 6 dependency more configurable? We use Guzzle 5 in our legacy project, so this dependency makes impossible to use your library as is.
See https://github.com/SparkPost/php-sparkpost#setting-up-a-request-adapter
Thank you
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?
Additionally set timeour for Curl adapter to 2-3 sec instead 10
do you have plans to use sparkpost library v2?
Hi,
is it possible that you return Transmission ID (contained in the result from sparkpost) instead of TRUE when message is succesfully sent?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.