Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 10 additions & 21 deletions src/Mail/VerificationMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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,
]
);
]);
}
}
6 changes: 3 additions & 3 deletions views/mail/verification.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

</x-mail-layout>