WelcomeMessage.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. namespace App\Notifications;
  3. use App\Models\User;
  4. use Illuminate\Bus\Queueable;
  5. use Illuminate\Contracts\Queue\ShouldQueue;
  6. use Illuminate\Notifications\Notification;
  7. class WelcomeMessage extends Notification implements ShouldQueue
  8. {
  9. use Queueable;
  10. /**
  11. * @var User
  12. */
  13. private $user;
  14. /**
  15. * Create a new notification instance.
  16. *
  17. * @param User $user
  18. */
  19. public function __construct(User $user)
  20. {
  21. $this->user = $user;
  22. }
  23. /**
  24. * Get the notification's delivery channels.
  25. *
  26. * @param mixed $notifiable
  27. * @return array
  28. */
  29. public function via($notifiable)
  30. {
  31. return ['database'];
  32. }
  33. public function AdditionalLines()
  34. {
  35. $AdditionalLine = '';
  36. if (config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL') != 0) {
  37. $AdditionalLine .= __('Verifying your e-mail address will grant you ').config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_EMAIL').' '.__('additional').' '.config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME').'. <br />';
  38. }
  39. if (config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL') != 0) {
  40. $AdditionalLine .= __('Verifying your e-mail will also increase your Server Limit by ').config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_EMAIL').'. <br />';
  41. }
  42. $AdditionalLine .= '<br />';
  43. if (config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD') != 0) {
  44. $AdditionalLine .= __('You can also verify your discord account to get another ').config('SETTINGS::USER:CREDITS_REWARD_AFTER_VERIFY_DISCORD').' '.config('SETTINGS::SYSTEM:CREDITS_DISPLAY_NAME').'. <br />';
  45. }
  46. if (config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD') != 0) {
  47. $AdditionalLine .= __('Verifying your Discord account will also increase your Server Limit by ').config('SETTINGS::USER:SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD').'. <br />';
  48. }
  49. return $AdditionalLine;
  50. }
  51. /**
  52. * Get the array representation of the notification.
  53. *
  54. * @param mixed $notifiable
  55. * @return array
  56. */
  57. public function toArray($notifiable)
  58. {
  59. return [
  60. 'title' => __('Getting started!'),
  61. 'content' => '
  62. <p> '.__('Hello')." <strong>{$this->user->name}</strong>, ".__('Welcome to our dashboard').'!</p>
  63. <h5>'.__('Verification').'</h5>
  64. <p>'.__('You can verify your e-mail address and link/verify your Discord account.').'</p>
  65. <p>
  66. '.$this->AdditionalLines().'
  67. </p>
  68. <h5>'.__('Information').'</h5>
  69. <p>'.__('This dashboard can be used to create and delete servers').'.<br /> '.__('These servers can be used and managed on our pterodactyl panel').'.<br /> '.__('If you have any questions, please join our Discord server and #create-a-ticket').'.</p>
  70. <p>'.__('We hope you can enjoy this hosting experience and if you have any suggestions please let us know').'!</p>
  71. <p>'.__('Regards').',<br />'.config('app.name', 'Laravel').'</p>
  72. ',
  73. ];
  74. }
  75. }