From 8ae89938713d54f3fe8a627c0907d693107d5c70 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Tue, 17 Oct 2023 10:37:39 +0200 Subject: [PATCH] Handle Sendinblue error responses without a message key --- .../Bridge/Sendinblue/Transport/SendinblueApiTransport.php | 2 +- .../Notifier/Bridge/Sendinblue/SendinblueTransport.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Mailer/Bridge/Sendinblue/Transport/SendinblueApiTransport.php b/src/Symfony/Component/Mailer/Bridge/Sendinblue/Transport/SendinblueApiTransport.php index 0a43deb97f65d..110ad48f1a077 100644 --- a/src/Symfony/Component/Mailer/Bridge/Sendinblue/Transport/SendinblueApiTransport.php +++ b/src/Symfony/Component/Mailer/Bridge/Sendinblue/Transport/SendinblueApiTransport.php @@ -65,7 +65,7 @@ protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $e } if (201 !== $statusCode) { - throw new HttpTransportException('Unable to send an email: '.$result['message'].sprintf(' (code %d).', $statusCode), $response); + throw new HttpTransportException('Unable to send an email: '.($result['message'] ?? $response->getContent(false)).sprintf(' (code %d).', $statusCode), $response); } $sentMessage->setMessageId($result['messageId']); diff --git a/src/Symfony/Component/Notifier/Bridge/Sendinblue/SendinblueTransport.php b/src/Symfony/Component/Notifier/Bridge/Sendinblue/SendinblueTransport.php index b554cfef9f67b..d8709f7d1e960 100644 --- a/src/Symfony/Component/Notifier/Bridge/Sendinblue/SendinblueTransport.php +++ b/src/Symfony/Component/Notifier/Bridge/Sendinblue/SendinblueTransport.php @@ -75,7 +75,7 @@ protected function doSend(MessageInterface $message): SentMessage if (201 !== $statusCode) { $error = $response->toArray(false); - throw new TransportException('Unable to send the SMS: '.$error['message'], $response); + throw new TransportException('Unable to send the SMS: '.($error['message'] ?? $response->getContent(false)), $response); } $success = $response->toArray(false); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy