diff options
| author | Thomas Grothe <grothe.tr@gmail.com> | 2026-04-11 17:49:42 -0400 |
|---|---|---|
| committer | Thomas Grothe <grothe.tr@gmail.com> | 2026-04-11 17:49:42 -0400 |
| commit | d4f97aa956be051dd5b9a184557106dc7de112ac (patch) | |
| tree | e4c73c93408b5fbc4cc1b92cabcaceaaebbb1833 /app/Notifications/NewUserNotification.php | |
| parent | bcac54576d7309ac0471a7be5664c5a4e8d7349e (diff) | |
| parent | 054c19bf65beb43d0dd6137f9bf16cf8ca9f6190 (diff) | |
Merge remote-tracking branch 'origin/main'
Diffstat (limited to 'app/Notifications/NewUserNotification.php')
| -rw-r--r-- | app/Notifications/NewUserNotification.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app/Notifications/NewUserNotification.php b/app/Notifications/NewUserNotification.php new file mode 100644 index 0000000..d2a9b6f --- /dev/null +++ b/app/Notifications/NewUserNotification.php @@ -0,0 +1,36 @@ +<?php + +namespace App\Notifications; + +use Illuminate\Bus\Queueable; +use Illuminate\Contracts\Queue\ShouldQueue; +use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; +use App\Models\User; + +class NewUserNotification extends Notification implements ShouldQueue +{ + use Queueable; + + protected User $newUser; + + public function __construct(User $newUser) + { + $this->newUser = $newUser; + } + + public function via(object $notifiable): array + { + return ['mail']; + } + + public function toMail(object $notifiable): MailMessage + { + return (new MailMessage) + ->subject('New User Registered') + ->line("A new account has been created.") + ->line("Name: {$this->newUser->name}") + ->line("Email: {$this->newUser->email}") + ->line("Time: " . now()->format('Y-m-d H:i:s T')); + } +} |
