cividesk / com.cividesk.email.sparkpost

This extension allows CiviCRM to send emails and process bounces through the SparkPost service.
10 stars 30 forks source link

Undefined property #43

Closed khorporative closed 7 years ago

khorporative commented 7 years ago

Just installed CiviDesk Sparkpost extension in CiviCRM.

When pasting API Key and clicking Save & Send Test Email, the plugin gives error: Notice: Undefined property: stdClass::$description in CRM_Sparkpost::call() (line 149 of /var/www/html/crm/sites/default/files/civicrm/ext/com.cividesk.email.sparkpost/CRM/Sparkpost.php).

SparkPost error Could not install webhook (Sparkpost error: HTTP return code 400, Sparkpost error code UNABLE_TO_VERIFY_LEAF_SIGNATURE (POST to webhook target URL failed with error code UNABLE_TO_VERIFY_LEAF_SIGNATURE: ). Check https://support.sparkpost.com/customer/en/portal/articles/2140916-extended-error-codes for interpretation.).

SparkPost integration v1.1, CiviCRM 4.7.14., Drupal 7.52

sparkpost

sparkpost-error

nganivet commented 7 years ago

This is due to the root CA certificates not being up to date on your server. CURL cannot therefore validate the certificate presented by Sparkpost when establishing secure communications.

You will need to either:

You can show your support and appreciation for our work by making a donation at https://www.cividesk.com/pay and indicating 'SparkPost support' as the invoice id. Suggested donation amounts are $40 for end-users, and $40 per client using this extension for service providers.

Thanks.

robbrandt commented 7 years ago

Hi. I have run into this same issue. I am confused by it however. I have two nearly identical Amazon Ubuntu 16.04 servers (both created from the same custom image I created a couple of weeks ago). They are both set up for virtual hosting, in which each site could have it's own cert. Both have CiviCRM installed. One of them works with your extension, and the other doesn't. One difference is that the one that works has a valid cert installed for the CiviCRM site. The one that doesn't work is currently an alias domain we are working from for testing purposes, and as such it doesn't have a cert.

When you say "root" cert, I think you mean for the server itself, not for the site. But my experience might be that the site cert needs to be valid?

robbrandt commented 7 years ago

I just discovered something very interesting. An AskUbuntu thread referencing the Verify Leaf issue had a link pointing to this page: https://askubuntu.com/questions/244582/add-certificate-authorities-system-wide-on-firefox/248326#248326, the gist of which is that Firefox doesn't use system wide certificates. By habit, I is Chrome on the site that works, and Firefox on the site that doesn't. Having read this, I tried the Sparkpost test in Chrome on the site that didn't work, and now it does! I don't know that this actually solves a problem, but it could help someone from tearing their hair out trying to figure out why it sometimes works and other times doesn't.

nganivet commented 7 years ago

@robbrandt Thanks for the pointer and solution to this issue for Firefox users.

robbrandt commented 7 years ago

I'm not sure that it's a solution, but it is a valuable piece of information. I don't really understand why you need to have a certificate to send an email. No other app I am using on this server has an issue, and I don't believe Sparkpost itself requires a cert. The other apps I use do SMTP via swiftmailer or or the old phpmailer libraries, and they just work.

nganivet commented 7 years ago

This is because we are doing API calls to Sparkpost, among other reasons to verify that your domain is setup correctly, and to configure a callback to gather bounces. These calls are done over https, and you need a recent root certificate to validate the API endpoint. We are also sending emails through the API as this is more efficient than SMTP and allows for more options, and in particular getting relevant status codes for the result of the send.

You can absolutely not use this extension and instead configure the Sparkpost SMTP server/credentials through the standard CiviCRM dialogue. But then you will need to create your own return path or callback to process bounces.

Please also be mindful that we are volunteering our time to create and support this extension. A thank you and/or encouragements would certainly be more appreciated than such rants.

robbrandt commented 7 years ago

Sorry, it was not meant as a rant. And I do appreciate the work you and Joe do. If there was a rant it was against Sparkpost primarily, and CiviCRM secondarily because I've always had difficulty getting SMTP services working with Civi. I came to your extension precisely because the "other" Sparkpost extension that uses SMTP doesn't work in php 5.6, and I used that one because when we first started using Sparkpost, the basic SMTP option in CiviCRM wouldn't work.

nganivet commented 7 years ago

Well, this extension should make your life a lot easier once you've resolved that root certificate issue. I'll see you in St Louis soon. Thanks.