Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering issue. #190

Open
Sepremex opened this issue Jun 27, 2024 · 1 comment
Open

Rendering issue. #190

Sepremex opened this issue Jun 27, 2024 · 1 comment

Comments

@Sepremex
Copy link

I'm not sure if this is related to BladeOne or to the PHP.
PHP v 8.3
BladeOne 3.52
I know is an old version, but for what is use it has been working fine up to yesterday.
The problem is here $view = $blade->run('www.index', compact('data'));
Then I do this: echo $view; and exit;
That is ok, but I need to send and email:
$mail->bodyHtml = $blade->run('email.message', compact('data'));
$mail->addAddress( $data->email);

My script doesn't pass from $mail->bodyHtml = $blade->run(); ... it renders the html and doesn't continue,
Like I said, just a few days back it was fine, and yesterday we had a server update, not sure what was updated, but something was, I'm using a share host, so I don't have much information as to what was updated...

@soysudhanshu
Copy link

soysudhanshu commented Jul 13, 2024

According to your issue.

You want to pass the rendered blade to the Mail::$bodyHTML but it outputs the email body.

Looking at the defination of BladeOne::evaluatePath which is called by BladeOne::run() it starts and output buffer and returns it content.

I don't think it is a library issue however, it your case it might be possible that PHP's output buffer gets full and then it sends all content out and clearing it, or alternatively might not be turned on at all.

Troubleshooting steps might be:

  • Check output buffering is turned on.
  • Increase the size of output buffer, if email body is larger than currently allow value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants