- Issue created by @vistree
- 🇩🇪Germany vistree
Seems we could fix the problem when changing:
Line 165 in docroot/modules/contrib/graph_mail/src/Plugin/Mail/GraphMail.php:
from
'content' => is_string($message['body']) ? $message['body'] : $message['body'][0],
to
'content' => is_string($message['body']) ? $message['body'] : (string)$message["body"],
Debugging the $message object when sending an email using swiftmailer I figured out the $message['body'] in an object with protected parameter $message['body']->string
- 🇧🇪Belgium nightlife2008
I recreated the patch on the latest dev codebase, and added another case where the body can also be an array.
- 🇩🇪Germany vistree
Hi nightlife2008,
Thanx for your patch. Looks good to me ;-) - Status changed to Closed: duplicate
over 1 year ago 8:22am 3 April 2023 - 🇮🇹Italy apaderno Brescia, 🇮🇹
I am closing this issue in favor of 🐛 Error: Cannot use object of type Drupal\Core\Render\Markup as array in Drupal\graph_mail\Plugin\Mail\GraphMail::mail() Fixed , since the patch provided in that issue is preferable.