I’m looking for some assistance to debug an issue with the Cividesk Sparkpost extension. At first I thought that the extension was not compatible with Civi 5.8.x, but others report that is not the case. I am using the latest Cividesk code from github. Here are the symptoms.

  • The extension installed without an error, and when I entered the API key from Sparkpost and clicked “Save and send test email” it delivers an email with the content “Your SparkPost settings are correct.” The API key is authorized for all functions.

  • In Civicrm, emails are going out, but they are NOT going out through Sparkpost.

  • Since we have a backup email method defined, Civimail will send everything out through the backup method – in this case a self-managed SMTP server that is not ideal (for reasons I won’t go into here). Civimail shows the email as started and completed successfully.

  • Civicrm transactional emails are also delivered successfully through the backup SMTP method.

  • The ConfigAndLog/sparkpost_log file contains the following:

==== ERROR in CRM_Sparkpost::call() ==== stdClass Object ( [errors] => Array ( [0] => stdClass Object ( [message] => Forbidden. ) ) )

  • If we disable the backup SMTP, no emails are delivered. Civicrm pops up this error message:

Sparkpost error: Permission denied. Check that the API key is authorized for request https://api.sparkpost.com/api/v1/suppression-list/recipient@example.com.

  • Also in this case, all of the contact emails are set “on hold”.

  • As for potential causes, it is possible that recent changes to the server DNS may have created a problem. I am not that familiar with DNS, but new records were added for DKIM, DMARC and SPF and I am wondering if we got it wrong. The above errors coincide with the DNS changes, but that may have nothing to do with it.

  • I don’t understand how the test email says the settings are correct but otherwise we are seeing permission errors. The API key and other settings have been checked many times.

  • This is on Wordpress 5.0.3, Civi 5.9.0 (upgraded today, with no effect on the issue), and PHP 7.1. If you want to see the DNS records, check here.

  • Are you in the US or the EU? – Tony Horrocks Jan 16 '19 at 8:02
  • The US. Should that matter? – twowheeler Jan 16 '19 at 17:59
  • 1
    Yes it does, because if you are in the EU there is a different Sparkpost domain to register for GDPR reasons. So you need to fiddle with the code a bit. Anyways you don't need to do that. I would double check everything at the Sparkpost end particularly if you have exceeded the hourly quota or something like that. – Tony Horrocks Jan 17 '19 at 12:13
  • 1
    To close this issue, I eventually gave up on the cividesk extension and removed it. Instead I set up Sparkpost using the regular SMTP process and created a bounce account for it. It seems to work just fine. – twowheeler Jan 21 '19 at 1:04
  • @TonyHorrocks could you elaborate on the 'fiddling' needed (or link to somewhere with details)? I think I'm hitting that brick wall - am on smtp.eu.sparkpost.com and getting API invalid. – John Bradford Apr 12 '19 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.