h4ux / sendgrid-php-library Goto Github PK
View Code? Open in Web Editor NEWSendgrid API PHP Lib
Home Page: http://www.coolgeex.com/sendgrid-api-php-library/
Sendgrid API PHP Lib
Home Page: http://www.coolgeex.com/sendgrid-api-php-library/
I upgraded my app from php 5.3 to 5.5. Im using the Web API and i keep getting this error:
Message: curl_setopt(): The usage of the @filename API for file uploading is deprecated. Please use the CURLFile class instead
Please help!
The default 20-second timeout is too short for some operations to complete, such as newsletter_get_list_emails() on a list with > 15k addresses.
I'd suggest lengthening the timeout, or making it configurable on a per-request basis.
I've got a problem with SSL CA but this library didn't catch that and kept returning empty string.
This isn't good, I think the library should check HTTP response code. I updated code a little, please review the following patch:
% cat sendgrid.patch # This patch file was generated by NetBeans IDE # Following Index: paths are relative to: libraries/SendGrid-PHP-Library/sendgrid/core # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: sendgrid-connect.php --- sendgrid-connect.php Base (BASE) +++ sendgrid-connect.php Locally Modified (Based On LOCAL) @@ -55,7 +55,7 @@ * sendgrid endpoint ... * @var string */ - const SG_ENDPOINT = 'https://sendgrid.com/api'; + const SG_ENDPOINT = 'https://api.sendgrid.com/api'; /** * Creates a new SendGrid Newsletter API object to make calls with @@ -119,8 +119,10 @@ // obtain response $jsonResponse = curl_exec($session); - curl_close($session); - + $http_code = curl_getinfo($session, CURLINFO_HTTP_CODE); + if ($http_code != 200) { + $this->lastResponseError = curl_error($session); + } else { $this->debugCall('DEBUG - Json Response: ' , $jsonResponse); $results = json_decode ( $jsonResponse, TRUE ); @@ -128,6 +130,8 @@ $this->debugCall('DEBUG - Results: ' , $results); $this->lastResponseError = isset($results['error']) ? $results['error'] : NULL; + } + curl_close($session); return $this->lastResponseError ? false : $results; }
Also please note that SG API has new URL.
PS: after these changes I finally found a reason why my stopped communicating with SG: "Problem with the SSL CA cert (path? access rights?)"
hi, the api calls against sendgrid newsletter api don't work. you have a bad endpoint and do not distinguish between get and post requests. i think you want to check that.
and by the way, your coding style is terrible.
How to provide limit to send only some count of mails in an execution
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.