SupportMailManager.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App\Mail;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Mail\Mailable;
  5. use Illuminate\Queue\SerializesModels;
  6. use Illuminate\Contracts\Queue\ShouldQueue;
  7. class SupportMailManager extends Mailable
  8. {
  9. use Queueable, SerializesModels;
  10. /**
  11. * Create a new message instance.
  12. *
  13. * @return void
  14. */
  15. public $array;
  16. public function __construct($array)
  17. {
  18. $this->array = $array;
  19. }
  20. /**
  21. * Build the message.
  22. *
  23. * @return $this
  24. */
  25. public function build()
  26. {
  27. // dd($array);
  28. return $this->view($this->array['view'])
  29. ->from($this->array['from'], env('MAIL_FROM_NAME'))
  30. ->subject($this->array['subject'])
  31. ->with([
  32. 'content' => $this->array['content'],
  33. 'link' => $this->array['link'],
  34. 'sender' => $this->array['sender'],
  35. 'details' => $this->array['details']
  36. ]);
  37. }
  38. }