feat: implement user registration email notification and add email templates

This commit is contained in:
2025-10-21 18:00:45 +02:00
parent 2c07b0bc0f
commit 7959eec118
5 changed files with 92 additions and 2 deletions

View File

@@ -0,0 +1,61 @@
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailables\Address;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class UserRegistrationCompleted extends Mailable
{
use Queueable, SerializesModels;
private string $name;
private string $password;
/**
* Create a new message instance.
*/
public function __construct(string $name, string $password)
{
$this->name = $name;
$this->password = $password;
}
/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
subject: '[ISOP] Účet vytvorený',
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
return new Content(
view: 'mail.registration.completed',
with: [
"name" => $this->name,
"password" => $this->password
]
);
}
/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
}