Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Notifications;
- use App\User;
- use Illuminate\Bus\Queueable;
- use Illuminate\Notifications\Notification;
- use Illuminate\Notifications\Messages\MailMessage;
- class UserRegisteredSuccessfully extends Notification
- {
- use Queueable;
- /**
- * @var User
- */
- protected $user;
- /**
- * Create a new notification instance.
- *
- * @param User $user
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- }
- /**
- * Get the notification's delivery channels.
- *
- * @param mixed $notifiable
- * @return array
- */
- public function via($notifiable)
- {
- return ['mail'];
- }
- /**
- * Get the mail representation of the notification.
- *
- * @param mixed $notifiable
- * @return \Illuminate\Notifications\Messages\MailMessage
- */
- public function toMail($notifiable)
- {
- /** @var User $user */
- $user = $this->user;
- return (new MailMessage)
- ->from(env('ADMIN_MAIL'))
- ->subject('Successfully created new account')
- ->greeting(sprintf('Hello %s', $user->name))
- ->line('You have successfully registered to our system. Please activate your account.')
- ->action('Click Here', route('activate.user', $user->activation_code))
- ->line('Thank you for using our application!');
- }
- /**
- * Get the array representation of the notification.
- *
- * @param mixed $notifiable
- * @return array
- */
- public function toArray($notifiable)
- {
- return [
- //
- ];
- }
- }
Add Comment
Please, Sign In to add comment