source: app/Notifications/WelcomeUser.php@ a55bb54

Last change on this file since a55bb54 was 194a359, checked in by beratkjufliju <kufliju@…>, 3 years ago

added departments, edited users and added user settings

  • Property mode set to 100644
File size: 1.6 KB
Line 
1<?php
2
3namespace App\Notifications;
4
5use App\Models\User;
6use Illuminate\Bus\Queueable;
7use Illuminate\Notifications\Notification;
8use Illuminate\Notifications\Messages\MailMessage;
9
10class WelcomeUser extends Notification
11{
12 use Queueable;
13
14 private $user;
15
16 /**
17 * Create a new notification instance.
18 *
19 * @return void
20 */
21 public function __construct(User $user)
22 {
23 $this->user = $user;
24 }
25
26 /**
27 * Get the notification's delivery channels.
28 *
29 * @param mixed $notifiable
30 * @return array
31 */
32 public function via($notifiable)
33 {
34 return ['mail'];
35 }
36
37 /**
38 * Get the mail representation of the notification.
39 *
40 * @param mixed $notifiable
41 * @return \Illuminate\Notifications\Messages\MailMessage
42 */
43 public function toMail($notifiable)
44 {
45 return (new MailMessage)
46 ->greeting("Hello " . $this->user->name)
47 ->line("We are happy to see you among us.")
48 ->line("Username: " . $this->user->username)
49 ->line("Security Code: " . $this->user->security_code)
50 ->line("To create password for your account just click the button then create something good. :))")
51 ->line("NOTE: You have only 10 minutes to create your password.")
52 ->action("Create Password", url("/auth/create-password/" . $this->user->id . "/" . $this->user->verify_token));
53 }
54
55 /**
56 * Get the array representation of the notification.
57 *
58 * @param mixed $notifiable
59 * @return array
60 */
61 public function toArray($notifiable)
62 {
63 return [
64 //
65 ];
66 }
67}
Note: See TracBrowser for help on using the repository browser.