From 2d41ee016aa18c47667b60c7d8bbdb9c8352e2d9 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 24 Aug 2023 18:00:55 +0200 Subject: [PATCH] fix body logging --- src/SparkPostApiTransport.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SparkPostApiTransport.php b/src/SparkPostApiTransport.php index c125a7f..3eabb3c 100644 --- a/src/SparkPostApiTransport.php +++ b/src/SparkPostApiTransport.php @@ -371,6 +371,9 @@ protected function logMessageContent(Email $message, $results = []) $contentType = $message->getHtmlBody() !== null ? "text/html" : "text"; $logContent = $body; + if (is_object($logContent)) { + $logContent = $logContent->toString(); + } $emailHeaders = $message->getHeaders(); // Append some extra information at the end