diff options
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')); + } +} |
