1 | <?php
|
---|
2 |
|
---|
3 | namespace App\Notifications;
|
---|
4 |
|
---|
5 | use Illuminate\Bus\Queueable;
|
---|
6 | use Illuminate\Notifications\Messages\MailMessage;
|
---|
7 | use Illuminate\Notifications\Notification;
|
---|
8 | use Illuminate\Support\Facades\Auth;
|
---|
9 | use Illuminate\Support\Facades\URL;
|
---|
10 |
|
---|
11 | class ManagerArtistInviteNotification extends Notification
|
---|
12 | {
|
---|
13 | use Queueable;
|
---|
14 |
|
---|
15 | /**
|
---|
16 | * User invitation token
|
---|
17 | *
|
---|
18 | * @var string
|
---|
19 | */
|
---|
20 | private $token;
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * Create a new notification instance.
|
---|
24 | *
|
---|
25 | * @return void
|
---|
26 | */
|
---|
27 | public function __construct($token)
|
---|
28 | {
|
---|
29 | $this->token = $token;
|
---|
30 | }
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * Get the notification's delivery channels.
|
---|
34 | *
|
---|
35 | * @param mixed $notifiable
|
---|
36 | * @return array
|
---|
37 | */
|
---|
38 | public function via($notifiable)
|
---|
39 | {
|
---|
40 | return ['mail'];
|
---|
41 | }
|
---|
42 |
|
---|
43 | /**
|
---|
44 | * Get the mail representation of the notification.
|
---|
45 | *
|
---|
46 | * @param mixed $notifiable
|
---|
47 | * @return \Illuminate\Notifications\Messages\MailMessage
|
---|
48 | */
|
---|
49 | public function toMail($notifiable)
|
---|
50 | {
|
---|
51 | $url = URL::temporarySignedRoute('manager.accept.invite', now()->addDays(2), ['token' => $this->token, 'email' => $notifiable->email]);
|
---|
52 |
|
---|
53 | return (new MailMessage)
|
---|
54 | ->subject(Auth::user()->name . ' invited you as a Manager | Clapsify')
|
---|
55 | ->line('Hope you are having a great day! You have been invited as a manager!')
|
---|
56 | ->line(Auth::user()->name . ' has invited you to become their manager. Please accept the invitation below to start managing with their profile.')
|
---|
57 | ->action('Accept Invitation', $url)
|
---|
58 | ->line('We are happy to have you 🤗');
|
---|
59 | }
|
---|
60 |
|
---|
61 | /**
|
---|
62 | * Get the array representation of the notification.
|
---|
63 | *
|
---|
64 | * @param mixed $notifiable
|
---|
65 | * @return array
|
---|
66 | */
|
---|
67 | public function toArray($notifiable)
|
---|
68 | {
|
---|
69 | return [
|
---|
70 | //
|
---|
71 | ];
|
---|
72 | }
|
---|
73 | }
|
---|