Guest User

Untitled

a guest
Jan 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Notifications;
  4.  
  5. use App\User;
  6. use Illuminate\Bus\Queueable;
  7. use Illuminate\Notifications\Notification;
  8. use Illuminate\Notifications\Messages\MailMessage;
  9.  
  10. class UserRegisteredSuccessfully extends Notification
  11. {
  12. use Queueable;
  13. /**
  14. * @var User
  15. */
  16. protected $user;
  17.  
  18. /**
  19. * Create a new notification instance.
  20. *
  21. * @param User $user
  22. */
  23. public function __construct(User $user)
  24. {
  25. $this->user = $user;
  26. }
  27.  
  28. /**
  29. * Get the notification's delivery channels.
  30. *
  31. * @param mixed $notifiable
  32. * @return array
  33. */
  34. public function via($notifiable)
  35. {
  36. return ['mail'];
  37. }
  38.  
  39. /**
  40. * Get the mail representation of the notification.
  41. *
  42. * @param mixed $notifiable
  43. * @return \Illuminate\Notifications\Messages\MailMessage
  44. */
  45. public function toMail($notifiable)
  46. {
  47. /** @var User $user */
  48. $user = $this->user;
  49.  
  50. return (new MailMessage)
  51. ->from(env('ADMIN_MAIL'))
  52. ->subject('Successfully created new account')
  53. ->greeting(sprintf('Hello %s', $user->name))
  54. ->line('You have successfully registered to our system. Please activate your account.')
  55. ->action('Click Here', route('activate.user', $user->activation_code))
  56. ->line('Thank you for using our application!');
  57. }
  58.  
  59. /**
  60. * Get the array representation of the notification.
  61. *
  62. * @param mixed $notifiable
  63. * @return array
  64. */
  65. public function toArray($notifiable)
  66. {
  67. return [
  68. //
  69. ];
  70. }
  71. }
Add Comment
Please, Sign In to add comment