AccountActivation.php 961 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Notifications;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Notifications\Messages\MailMessage;
  5. use Illuminate\Notifications\Notification;
  6. class AccountActivation extends Notification
  7. {
  8. use Queueable;
  9. private string $url;
  10. public function __construct(string $url)
  11. {
  12. $this->url = $url;
  13. }
  14. public function via($notifiable): array
  15. {
  16. return ['mail'];
  17. }
  18. public function toMail($notifiable): MailMessage
  19. {
  20. return (new MailMessage)->subject(__('Verify Email Address'))->line(__('Please click the button below to verify your email address.'))
  21. ->action(__('Verify Your Email Address'), $this->url)
  22. ->line(__("If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:", ['actionText' => $this->url]))
  23. ->line(__('If you did not create an account, no further action is required.'));
  24. }
  25. }