PasswordReset.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Notifications;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Notifications\Messages\MailMessage;
  5. use Illuminate\Notifications\Notification;
  6. class PasswordReset 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)
  15. {
  16. return sysConfig('password_reset_notification');
  17. }
  18. public function toMail($notifiable): MailMessage
  19. {
  20. return (new MailMessage)
  21. ->subject(__('Reset Password Notification'))
  22. ->line(__('Please click on the button below to reset your password.'))
  23. ->action(__('Reset Password'), $this->url)
  24. ->line(__("If you're having trouble clicking the \":actionText\" button, copy and paste the URL below\ninto your web browser:", ['actionText' => $this->url]))
  25. ->line(__('You are receiving this email because we received a password reset request for your account.'))
  26. ->line(__('If you did not request a password reset, no further action is required.'));
  27. }
  28. }