Closed pointybeard closed 2 years ago
@pointybeard thanks for bringing this to my attention. I’ll get some fixes out for the latest 2.x and 3.x branches today 👍
This has now been patched and is available in v2.11.2
and v3.0.0-RC2
.
https://github.com/craigpaul/laravel-postmark/commit/2feeeb9f050600f301d7c451716f1029001e8ceb https://github.com/craigpaul/laravel-postmark/commit/ab8e8d01292fbf28af382475ff7d2982dc8d847e
When I attempted to use this library to send an email using a template, I noticed the email body was always empty. After tracing around the code, I found that the output from the
postmark::template
view (https://github.com/craigpaul/laravel-postmark/blob/5481b9ad178fddc919fa717c9ae25eb7cc6b72ce/resources/views/template.blade.php) was always empty and I never received any feedback in output (logs, console etc). Further digging and I discovered that the data was getting into the render function, however, the output was always empty.After some more poking around I ended up in
Illuminate\View\View::gatherData()
. There is a line that adds "shared" data of__env
andapp
. Removing these allows the template to render. It seems there is just too much data in these array fields.To solve the problem, I paired down the data by changing the template from:
to:
I am unclear why there is so much data, but, at least this solves the problem. For reference, I am extending
PostmarkTemplateMailable
and overloading the__construct()
andbuild()
methods which is being called viaHere is my Mailable class for reference