quanticz / mailq-php-library Goto Github PK
View Code? Open in Web Editor NEWPHP library for MailQ API
License: MIT License
PHP library for MailQ API
License: MIT License
Throw specific exception when invalid recipient email, for example [email protected]
We are using MailQ and wanted to stop using it manually a start using it automatically, starting with a couple of Symfony Commands that would accomplish basic tasks. And this is how it went.
I've added the library to our app composer dependencies (version 0.2.0 that matches current master).
I started with the recipient lists list. I've called $mailQ->getRecipientsLists
and got a strict warning about Request::createRequest()
being called statically when not being static. OK, I've made it static. BTW Do you really develop with strict warnings turned off?
Then I got a fatal error because class Response
didn't exist. Well, it really didn't. So I fixed it.
Then I got an error that "292 is not a curl resource" (or something like that). Well, I fixed it. You can't really close a curl resource and try to use it later (try to close a database connection and use it later and see how that goes).
Then I tried to list recipients lists that I am member of. And strangely, it returned the same list all the time. Guess why. Yes, because you prepare a cool $url
variable (there should be a .=
here btw) but you don't use it and build the request URL again.
I fixed that and got a correct list.
Then I tried to create a new recipients list. And a cute little thing happened. When I didn't provide the "variables" parameter, your service crashed:
{"error":{"message":"Cannot invoke method asList() on null object","note":"This exception was not expected. Please send error message to developers."}}
I kinda expected that when I don't pass an explicit value to ResponseListEntity
constructor, it will use a default value (empty array I would guess). Well, I was wrong. OK, I started to provide at least an empty array/object.
Then I tried to delete the recipient list. And I have to admit, I was surprised it had worked.
Then I tried to list members of a recipient list. And for some reason a RecipientEntity is returned instead of a RecipientsEntity. So I tried to fix it. And I obviously had to use that cute tweak to make a data
parameter a recipients
parameter.
And it started working. Kinda. Recipients didn't get their email into the email
property but it was inside the data
property.
And that's where I've decided to use all my powers to make our project stop using MailQ and migrate somewhere else.
It will be good, to have time for send request. Now I have to wait for execution time, and I so I cant handle if it is sent successfully or not.
We are still facing the notice when trying to parse annotations that @dominikdvoracek reported. Upgrading to 0.7.0 did not help.
The problem is that you assume that $property->getAnnotation($mapping);
returns an Annotation object. However it does not despite the method's docblock claiming it does. In fact when this notice is raised $annotation
contains a string "undeliveredTimestamp"
.
I suppose it used to work but stopped when this PR was merged to Nette\Reflection.
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.