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 AppMail;
use IlluminateBusQueueable;
use IlluminateContractsQueueShouldQueue;
use IlluminateMailMailable;
use IlluminateMailMailablesContent;
use IlluminateMailMailablesEnvelope;
use IlluminateQueueSerializesModels;
use AppModelsUser;
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, IlluminateMailMailablesAttachment>
*/
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