This PR will fix an issue with public properties not being available in the view.
For example, this will not work:
class MyMail extends Mailable
{
use Queueable, SerializesModels;
public $myPublicProperty = 'Hello World';
/**
* Get the message content definition.
*
* @return \Illuminate\Mail\Mailables\Content
*/
public function content()
{
return new Content(
view: $this->mjml('emails.thanks-for-your-application')->buildMjmlView()['html'],
);
}
}
What will work with current code is by pass it in the with within Content definition.
class MyMail extends Mailable
{
use Queueable, SerializesModels;
/**
* Get the message content definition.
*
* @return \Illuminate\Mail\Mailables\Content
*/
public function content()
{
return new Content(
view: $this->mjml('emails.thanks-for-your-application')->buildMjmlView()['html'],
with: [
'myPublicProperty' => 'Hello World',
]
);
}
}
This PR will fix an issue with public properties not being available in the view.
For example, this will not work:
What will work with current code is by pass it in the
with
withinContent
definition.