InviteMail.php 1.1 KB

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