Error when sending mails from webform module

Created on 9 April 2024, 8 months ago
Updated 26 April 2024, 7 months ago

Problem/Motivation

In combination with the webform module, the following error may occur:

TypeError: The body of "Symfony\Component\Mime\Part\TextPart" must be a string, a resource, or an instance of "Symfony\Component\Mime\Part\File" (got "Drupal\Core\Render\Markup"). in Symfony\Component\Mime\Part\TextPart->__construct() (line 48 of /var/www/html/vendor/symfony/mime/Part/TextPart.php)

The problem only occurs if there is an element of type "webform_attachment_twig" in the web form and an email is generated where attachments are also sent.

Steps to reproduce

1. install the webform and symfony_mailer_lite modules
2. create a webform
3. create a webform element of type "webform_attachment_twig" and enter some twig code, e.g. "{{ sid }}"
4. create an e-mail handler for the webform
5. activate the field "Include files as attachments ?" in the handler
6. fill in the webform and submit it

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany mhdev90 Apolda

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024