Fix SendGrid error message assignment [MAILPOET-810]

This commit is contained in:
Alexey Stoletniy
2017-02-13 10:35:21 +03:00
parent 228a671749
commit b539eae7f9

View File

@ -28,7 +28,7 @@ class SendGrid {
if(wp_remote_retrieve_response_code($result) !== 200) {
$response = json_decode($result['body'], true);
$response = (!empty($response['errors'][0])) ?
$response['errors'] :
$response['errors'][0] :
sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_SENDGRID);
return Mailer::formatMailerSendErrorResult($response);
}