InviteMail.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Mail;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Mail\Mailable;
  5. use Illuminate\Queue\SerializesModels;
  6. class InviteMail 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 $subject = 'wikipali invite email', string $lang = 'en-US', string $dashboard = null)
  18. {
  19. //
  20. $this->uuid = $uuid;
  21. $this->lang = $lang;
  22. $this->subject($subject);
  23. if ($dashboard && !empty($dashboard)) {
  24. $this->dashboard_url = $dashboard;
  25. } else {
  26. $this->dashboard_url = config('mint.server.dashboard_base_path');
  27. }
  28. }
  29. /**
  30. * Build the message.
  31. *
  32. * @return $this
  33. */
  34. public function build()
  35. {
  36. return $this->view('emails.invite.' . $this->lang)
  37. ->with([
  38. 'url' => $this->dashboard_url . '/anonymous/users/sign-up/' . $this->uuid,
  39. ]);
  40. }
  41. }