Skip to content

Commit

Permalink
Email and phone null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Raccoon254 committed Jun 13, 2024
1 parent 694e82b commit 1d095d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/Notifications/NewUserJoined.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public function toMail(object $notifiable): MailMessage
->line('A new user has joined the website.')
->line('Name: ' . $this->user->name)
->line('Email: ' . $this->user->email)
->line('Phone: ' . $this->user->phone)
->line('Location: ' . $this->user->location)
->line('Phone: ' . $this->user->phone ?? 'Not provided')
->line('Location: ' . $this->user->location ?? 'Not provided')
->action('View User', url(route('users.show', $this->user)))
->line('Thank you for using our application!');
}
Expand All @@ -56,6 +56,8 @@ public function toArray(object $notifiable): array
return [
'name' => $this->user->name,
'email' => $this->user->email,
'phone' => $this->user->phone ?? 'Not provided',
'location' => $this->user->location ?? 'Not provided',
];
}
}

0 comments on commit 1d095d5

Please sign in to comment.