File: D:/HostingSpaces/SBogers10/csb.komma.pro/app/Notifications/CustomerRegisteredSetPassword.php
<?php
namespace App\Notifications;
use App\Users\Models\SiteUser;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;
/**
* Class CustomerRegisteredSetPassword
*
* Notitication to tell a user to set his password
*
* @package App\Notifications
*/
class CustomerRegisteredSetPassword extends Notification
{
use Queueable;
/** @var SiteUser $authenticatable */
private $authenticatable;
/** @var string */
private $token;
/**
* Create a new notification instance.
*
* @param Authenticatable $authenticatable
* @param string $token
*/
public function __construct(Authenticatable $authenticatable, string $token)
{
$this->authenticatable = $authenticatable;
$this->token = $token;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail()
{
if(is_a($this->authenticatable, SiteUser::class)) {
$view = 'emails.customer.setPassword';
} else {
$view = 'emails.kmsuser.setPassword';
}
$mail = (new MailMessage)->view('emails.customer.setPassword', [
'customer' => $this->authenticatable,
'token' => $this->token,
])->subject(__('notifications.customer_set_password.subject'));
return $mail;
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}