Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Mailer] Add downloadable attachments to profiler#44917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
src/Symfony/Component/Mailer/DataCollector/MessageDataCollector.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
kbond commentedJan 5, 2022
Only the component/bundle/bridge changelogs need to be updated for new features. |
kbond commentedJan 5, 2022
Can this be done without the need for a controller/temp files using data URIs to embed the file in an anchor tag or is there anotherfrontend-only solution? Could this work?https://stackoverflow.com/questions/283956/is-there-any-way-to-specify-a-suggested-filename-when-using-data-uri |
dbrekelmans commentedJan 5, 2022
@kbond If I remember correctly, I tried embedding it in the url (I built this about a year ago, so not entirely sure). I believe it causes issues when the content is too big and it gets cut off from the url by the browser. |
kbond commentedJan 5, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I just tried with a larger pdf (700kb) and it worked in the latest chrome/firefox: <ahref="data:application/pdf;base64,{{pdfContentsBase64Encoded }}"download="desired-filename.pdf">Download</a> |
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/mailer.html.twig OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/mailer.html.twig OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/mailer.html.twig OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
kbond left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is a great feature!
Few minor things.@dbrekelmans, did you test this in the context of a "real app"?
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/mailer.html.twig OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/mailer.html.twig OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
dbrekelmans commentedJan 19, 2022
@kbond Sorry for the late response, I got a bit distracted.
Yes, I just tested it again with the code changes. Seems to work perfectly :) |
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/mailer.html.twig OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
3b8145e to4320220Comparefabpot commentedJan 19, 2022
Thank you@dbrekelmans. |
Uh oh!
There was an error while loading.Please reload this page.
This PR allows developers to download email attachments from the profiler. This is very useful for debugging if you are sending emails with PDF attachments for example, and you want to check some data within the attachment through the profiler.