use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\URL;
class NewRegistration extends Notification
{
//
public function via($notifiable)
{
return ['mail', 'database'];
}
public function toMail($notifiable)
{
$user = $notifiable;
if ($user->email_verified_at == '') {
$verificationUrl = $this->verificationUrl($notifiable);
if (static::$toMailCallback) {
return call_user_func(static::$toMailCallback, $notifiable, $verificationUrl);
}
return (new MailMessage())
->subject('Thank you for registration!')
->line('Please click the button below to verify your email address.')
->action('Verify Email Address', $verificationUrl)
->line('If you did not create an account, no further action is required.');
}
return (new MailMessage())
->subject('Thank you for registration!')
->line('Thank you for registration at '.app_name().'.')
->action('Vist Application', url('/'))
->line('We are really happy that you started to use '.app_name().'!');
}
public function toDatabase($notifiable)
{
$user = $notifiable;
$text = 'Registration Completed! | New registration completed for <strong>'.$user->name.'</strong>';
$url_backend = route('backend.users.profile', $user->id);
$url_frontend = route('frontend.users.profile', $user->id);
return [
'title' => 'Registration Completed!',
'module' => 'User',
'type' => 'created', // created, published, viewed,
'icon' => 'fas fa-user',
'text' => $text,
'url_backend' => $url_backend,
'url_frontend' => $url_frontend,
];
}
//
}