diff --git a/src/Mail/VerificationMail.php b/src/Mail/VerificationMail.php index 16a616cb..283d708c 100644 --- a/src/Mail/VerificationMail.php +++ b/src/Mail/VerificationMail.php @@ -5,8 +5,6 @@ use Fleetbase\Models\VerificationCode; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; -use Illuminate\Mail\Mailables\Content; -use Illuminate\Mail\Mailables\Envelope; use Illuminate\Queue\SerializesModels; class VerificationMail extends Mailable @@ -17,12 +15,12 @@ class VerificationMail extends Mailable /** * The verification code to email. */ - private VerificationCode $verificationCode; + public VerificationCode $verificationCode; /** * Custom content to render if supplied. */ - private ?string $content; + public ?string $content; /** * Create a new message instance. @@ -36,30 +34,21 @@ public function __construct(VerificationCode $verificationCode, ?string $content } /** - * Get the message content definition. - */ - public function envelope(): Envelope - { - return new Envelope( - subject: $this->verificationCode->code . ' is your ' . config('app.name') . ' verification code', - ); - } - - /** - * Get the message content definition. + * Build the message. + * + * @return $this */ - public function content(): Content + public function build() { - return new Content( - markdown: 'fleetbase::mail.verification', - with: [ + return $this + ->subject($this->verificationCode->code . ' is your ' . config('app.name') . ' verification code') + ->markdown('fleetbase::mail.verification', [ 'appName' => config('app.name'), 'currentHour' => now()->hour, 'user' => $this->verificationCode->subject, 'code' => $this->verificationCode->code, 'type' => $this->verificationCode->for, 'content' => $this->content, - ] - ); + ]); } } diff --git a/views/mail/verification.blade.php b/views/mail/verification.blade.php index ada64df5..f326bdc4 100644 --- a/views/mail/verification.blade.php +++ b/views/mail/verification.blade.php @@ -20,9 +20,9 @@ @endif @if($type === 'email_verification') - @component('mail::button', ['url' => \Fleetbase\Support\Utils::consoleUrl('onboard', ['step' => 'verify-email', 'session' => base64_encode($user->uuid), 'code' => $code ])]) - Verify Email - @endcomponent +@component('mail::button', ['url' => \Fleetbase\Support\Utils::consoleUrl('onboard', ['step' => 'verify-email', 'session' => base64_encode($user->uuid), 'code' => $code ])]) +Verify Email +@endcomponent @endif