Open williamdes opened 2 months ago
Moving view and with into a function fixes it
/**
* Get the message content definition.
*/
public function content(): Content
{
return new Content(
view: 'email.toUser.payinFailed',
with: [
'payinId' => $this->ressourceId,
],
);
}
Added in Laravel by: https://github.com/laravel/framework/pull/44462
I don't think Bladestan knows how to analyze Illuminate\Mail\Mailables\Content so this will just result in the template being ignored.
Indeed
Added support in #114
I don't think Bladestan knows how to analyze Illuminate\Mail\Mailables\Content
so this will just result in the template being ignored.
Here is what you can do instead and still have it analyzed:
return $this->to('admin@example.eu')
->subject('[Payin] n°' . $this->ressourceId)
->html(view('email.toUser.payinFailed')
->with([
'payinId' => $this->ressourceId,
]));
That's just 6 extra chars :)
Test case: https://github.com/TomasVotruba/bladestan/pull/109
As reported in https://github.com/TomasVotruba/bladestan/pull/108#issuecomment-2309072935
The baseline item is
This was the official way to do emails in Laravel 8, still works in Laravel 10. See: https://laravel.com/docs/8.x/mail#using-the-from-method
Related: