symfony / swiftmailer-bundle

Symfony Swiftmailer Bundle
https://symfony.com/swiftmailer-bundle
MIT License
1.56k stars 151 forks source link

Error when rendering Mail in Profiler #267

Closed QuentinCurtet closed 4 years ago

QuentinCurtet commented 5 years ago

Impossible to access an attribute ("all") on a null variable. in vendor/symfony/swiftmailer-bundle/Resources/views/Collector/swiftmailer.html.twig (line 200)

{% for header in message.headers.all if (header.fieldName ?? '') not in ['Subject', 'From', 'To'] %}{{- header -}}{% endfor %}

We only remove the mailer component from serialization and we add an attachment to the mail.

Any idea ?

stof commented 5 years ago

We only remove the mailer component from serialization and we add an attachment to the mail.

I don't understand what you mean here

QuentinCurtet commented 5 years ago

When we tried to send the mail in debug mode, the mail was sent, but we had a critical error about closure in DataCollector (serialization problem i think). So we add a __sleep function to not take account of mailer instance in the serialization.