ForgotPassword.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace App\Mail;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Mail\Mailable;
  5. use Illuminate\Queue\SerializesModels;
  6. class ForgotPassword extends Mailable
  7. {
  8. use Queueable, SerializesModels;
  9. protected $uuid;
  10. protected $lang;
  11. protected $dashboard_url;
  12. /**
  13. * Create a new message instance.
  14. *
  15. * @return void
  16. */
  17. public function __construct(string $uuid, string $lang = 'en-US', ?string $dashboard = null)
  18. {
  19. //
  20. $this->uuid = $uuid;
  21. $this->lang = $lang;
  22. if ($dashboard && ! empty($dashboard)) {
  23. $this->dashboard_url = $dashboard;
  24. } else {
  25. $this->dashboard_url = config('mint.server.dashboard_base_path');
  26. }
  27. }
  28. /**
  29. * Build the message.
  30. *
  31. * @return $this
  32. */
  33. public function build()
  34. {
  35. return $this->view('emails.reset_password.'.$this->lang)
  36. ->with([
  37. 'url' => $this->dashboard_url.'/anonymous/users/reset-password/'.$this->uuid,
  38. ]);
  39. }
  40. }