TestEmailSettingNotification.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace App\Notifications;
  3. use Closure;
  4. use Illuminate\Notifications\Messages\MailMessage;
  5. use Illuminate\Notifications\Notification;
  6. use Illuminate\Support\Facades\Lang;
  7. class TestEmailSettingNotification extends Notification
  8. {
  9. // /**
  10. // * The callback that should be used to create the reset password URL.
  11. // *
  12. // * @var \Closure|null
  13. // */
  14. // protected static ?Closure $createUrlCallback;
  15. // /**
  16. // * The callback that should be used to build the mail message.
  17. // *
  18. // * @var \Closure|null
  19. // */
  20. // protected static ?Closure $toMailCallback;
  21. /**
  22. * TestEmailSettingNotification constructor.
  23. */
  24. public function __construct()
  25. {
  26. }
  27. /**
  28. * Get the notification's delivery channels.
  29. *
  30. * @param mixed $notifiable
  31. * @return array
  32. */
  33. public function via($notifiable)
  34. {
  35. return ['mail'];
  36. }
  37. /**
  38. * Get the mail representation of the notification.
  39. *
  40. * @param mixed $notifiable
  41. * @return \Illuminate\Notifications\Messages\MailMessage
  42. */
  43. public function toMail($notifiable)
  44. {
  45. return (new MailMessage)
  46. ->subject(Lang::get('notifications.test_email_settings.subject'))
  47. ->greeting(Lang::get('notifications.hello'))
  48. ->line(
  49. Lang::get('notifications.test_email_settings.reason')
  50. )
  51. ->line(
  52. Lang::get('notifications.test_email_settings.success')
  53. );
  54. }
  55. }