Unable to send emails using SparkPost API since upgrading to 5.51.0
Since upgrading to CiviCRM 5.51.0 we are unable to use the Email API to send emails via the SparkPost API. We get the below error:
{
"error_code": 0,
"entity": "Email",
"action": "send",
"trace": "
#0 /public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_email_send(Array)\n
#1 /public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(149): Civi\\API\\Provider\\MagicFunctionProvider->invoke(Array)\n
#2 /public_html/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\\API\\Kernel->runRequest(Array)\n
#3 /public_html/wp-content/plugins/civicrm/civicrm/api/api.php(22): Civi\\API\\Kernel->runSafe('Email', 'send', Array)\n
#4 /public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php(300): civicrm_api('Email', 'send', Array)\n
#5 /public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/REST.php(541): CRM_Utils_REST::process(Array, Array)\n
#6 /public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(285): CRM_Utils_REST::ajax()\n
#7 /public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem(Array)\n
#8 /public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke(Array)\n
#9 /public_html/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke(Array)\n
#10 /public_html/wp-includes/class-wp-hook.php(307): CiviCRM_For_WordPress->invoke('')\n
#11 /public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)\n
#12 /public_html/wp-includes/plugin.php(476): WP_Hook->do_action(Array)\n
#13 /public_html/wp-admin/admin.php(259): do_action('toplevel_page_C...')\n
#14 {main}",
"is_error": 1,
"error_message": "Error sending email to FirstName LastName "
}
When we disable the SparkPost plugin we get the below result:
{
"is_error": 0,
"undefined_fields": [
"page",
"noheader"
],
"version": 3,
"count": 1,
"id": 1854,
"values": {
"1854": {
"contact_id": "1854",
"send": 1,
"status_msg": "Successfully sent email to email@example.com"
}
},
"xdebug": []
}
Environment: WordPress 5.0 CiviCRM 5.50.1 PHP: 7.3 Web Server: Apache