misc_pterodactyl-panel/app/Notifications/AccountCreated.php

48 lines
1.3 KiB
PHP
Raw Normal View History

<?php
2016-12-07 22:46:38 +00:00
namespace Pterodactyl\Notifications;
use Pterodactyl\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class AccountCreated extends Notification implements ShouldQueue
{
use Queueable;
/**
* Create a new notification instance.
*/
public function __construct(public User $user, public ?string $token = null)
{
}
/**
* Get the notification's delivery channels.
*/
public function via(): array
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*/
public function toMail(): MailMessage
{
2021-01-23 20:33:34 +00:00
$message = (new MailMessage())
2017-02-17 23:48:57 +00:00
->greeting('Hello ' . $this->user->name . '!')
2018-05-06 18:22:30 +00:00
->line('You are receiving this email because an account has been created for you on ' . config('app.name') . '.')
2017-02-17 23:48:57 +00:00
->line('Username: ' . $this->user->username)
->line('Email: ' . $this->user->email);
2021-01-23 20:33:34 +00:00
if (!is_null($this->token)) {
return $message->action('Setup Your Account', url('/auth/password/reset/' . $this->token . '?email=' . urlencode($this->user->email)));
}
return $message;
}
}