ConversationMailManager.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Mail;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Contracts\Queue\ShouldQueue;
  5. use Illuminate\Mail\Mailable;
  6. use Illuminate\Queue\SerializesModels;
  7. class ConversationMailManager 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. return $this->view('emails.conversation')
  28. ->from($this->array['from'], env('MAIL_FROM_NAME'))
  29. ->subject($this->array['subject'])
  30. ->with([
  31. 'content' => $this->array['content'],
  32. 'link' => $this->array['link'],
  33. 'sender' => $this->array['sender'],
  34. 'details' => $this->array['details']
  35. ]);
  36. }
  37. }