InviteMail.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 $subject='wikipali invite email',string $lang='en-US',string $dashboard=null)
  20. {
  21. //
  22. $this->uuid = $uuid;
  23. $this->lang = $lang;
  24. $this->subject($subject);
  25. if($dashboard && !empty($dashboard)){
  26. $this->dashboard_url = $dashboard;
  27. }else{
  28. $this->dashboard_url = config('mint.server.dashboard_base_path');
  29. }
  30. }
  31. /**
  32. * Build the message.
  33. *
  34. * @return $this
  35. */
  36. public function build()
  37. {
  38. return $this->view('emails.invite.'.$this->lang)
  39. ->with([
  40. 'url' => $this->dashboard_url.'/anonymous/users/sign-up/'.$this->uuid,
  41. ]);
  42. }
  43. }