Level 1
The preview gives the same result with {{ $code }} included as a string and not rendering the actual code
I have a mail view named passwordReset.blade.php like this
<!DOCTYPE html>
<html>
<head>
<title>Wachtwoord Reset</title>
<style>
body {
font-family: "Calibri", sans-serif;
color: #000000;
font-size: 0.9167em;
}
.token {
color: #00a9b5;
font-weight: bold;
}
</style>
</head>
<body>
<p>Beste gebruiker van de ,</p>
<p>
Er is een aanvraag gedaan voor het herstellen van je wachtwoord. Ben je dit niet geweest dan mag je deze e-mail negeren. Voor het opnieuw instellen van je wachtwoord voer je de onderstaande code in bij de app:
</p>
<p class="token">
{{ $code }}
</p>
<p>
Let op! Deze code is 30 minuten geldig.
</p>
<p>
Hartelijke groet,
</p>
</body>
</html>
But in the mail the code stays like this: {{ $code }}
This is my mailable class:
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
use App\Models\User;
class PasswordResetNew extends Mailable
{
use Queueable, SerializesModels;
private User $user;
/**
* Create a new message instance.
*/
public function __construct(User $user)
{
$this->user = $user;
}
/**
* Get the message content definition.
*/
public function content(): Content
{
return new Content(
view: 'emails.passwordReset',
with: [
'code' => $this->user->USER_WACHTWOORD_RESETCODE,
],
);
}
/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
}
And i have already debugged and the value is not empty before in the constructor and content functions.
And this mail gets called like this: Mail::to($user->USER_EMAIL) ->send(new PasswordResetNew($user));
Thanks
I have fixed it. Apparently on ubuntu 24.04 when using php 8.3 this problem comes up. When downgrading to php 8.2 it fixes the issue immediately. Very weird but it works now. Thanks for your help
Please or to participate in this conversation.