Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needs better documentation on dependencies #100

Closed
lonehorseend opened this issue Jul 16, 2014 · 6 comments
Closed

Needs better documentation on dependencies #100

lonehorseend opened this issue Jul 16, 2014 · 6 comments

Comments

@lonehorseend
Copy link

Apparently, if you aren't using Composer, you are in a boatload of trouble. The documentation does not mention the still needed dependencies of Unirest and something else I can't get working called the SMTPAPI.

In line 23 of Sendgrid\Email, the program is looking \Smtpapi\Header.

Thing is, I do not want to use SMTP. I want to use the WEB API.

@nquinlan
Copy link
Contributor

We have an alternative installation for those not using Composer, this packages all the dependencies and follows a "old" php standards. From the README:

Alternative: Install from zip

If you are not using Composer, simply download and install the latest packaged release of the library as a zip.

Then require the library from package:

require("path/to/sendgrid-php/sendgrid-php.php");

Previous versions of the library can be found in the version index.

Do you feel there's a way we can better highlight this?


As for the SMTPAPI, that's a misnomer on our part. The SMTPAPI is a JSON string which gives the email advanced functionality, such as substitutions and categorization. This is available through both SMTP and Web, and in fact is done through web for this library as that's the only transport we support through our official client libraries.

The SMTPAPI library in this case is how we do addTo, addCategory, addFilter and more. You can find more about it on the library's GitHub repo.


I'm going to close this issue, however I'd love to get your response and see if there's anything we can do to improve the README. If you feel it should remain open let me know.

@lonehorseend
Copy link
Author

I tried that installation and it didn’t work!

@nquinlan
Copy link
Contributor

What errors did you get?

@lonehorseend
Copy link
Author

Okay, so I see what happened, I’m used to an older version, so I only uploaded part of the lib part of the package and not the vendor part. Now that both are on the server, I'm getting this error:

Fatal error: Uncaught exception 'Exception' with message 'error:0D0890A1:asn1 encoding routines:func(137):reason(161)' in /var/www/html/lib/vendor/mashape/unirest-php/lib/Unirest/Unirest.php:219 Stack trace: #0 /var/www/html/lib/vendor/mashape/unirest-php/lib/Unirest/Unirest.php(74): Unirest::request('POST', 'https://api.sen...', Array, Array, NULL, NULL) #1 /var/www/html/lib/lib/SendGrid.php(45): Unirest::post('https://api.sen...', Array, Array) #2 /var/www/html/Request_Quote.php(101): SendGrid->send(Object(SendGrid\Email)) #3 {main} thrown in /var/www/html/lib/vendor/mashape/unirest-php/lib/Unirest/Unirest.php on line 219

@nquinlan
Copy link
Contributor

error:0D0890A1:asn1 encoding routines looks to be an OpenSSL error. I've not seen it before, but it appears something on your server is out of date or slightly out of whack.

Check you version of OpenSSL and libcurl and ensure they're both up to date. It sounds as if OpenSSL might be a few versions behind.

The other solution which is not recommended as it will allow for MITM attacks and all sorts of other not so great stuff is to disable SSL Verification. This can be done by passing in a turn_off_ssl_verification when initializing SendGrid:

$sendgrid   = new SendGrid(SENDGRID_USERNAME, SENDGRID_PASSWORD,  array("turn_off_ssl_verification" => true));

@lonehorseend
Copy link
Author

Yeah, you're right it was SSL. Server has an outdated version. Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants