SendMail.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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\Mail\Mailables\Content;
  7. use Illuminate\Mail\Mailables\Envelope;
  8. use Illuminate\Queue\SerializesModels;
  9. use \Illuminate\Mail\Mailables\Attachment;
  10. class SendMail extends Mailable
  11. {
  12. use Queueable, SerializesModels;
  13. public $mailData;
  14. /**
  15. * Create a new message instance.
  16. */
  17. public function __construct($mailData)
  18. {
  19. $this->mailData = $mailData;
  20. }
  21. /**
  22. * Get the message envelope.
  23. */
  24. public function envelope(): Envelope
  25. {
  26. return new Envelope(
  27. subject: $this->mailData['title'],
  28. );
  29. }
  30. /**
  31. * Get the message content definition.
  32. */
  33. public function content(): Content
  34. {
  35. return new Content(
  36. view: 'mail',
  37. );
  38. }
  39. /**
  40. * Get the attachments for the message.
  41. *
  42. * @return array<int, \Illuminate\Mail\Mailables\Attachment>
  43. */
  44. public function attachments(): array
  45. {
  46. // return [Attachment::fromStorageDisk('public',session()->pull('audio'))];
  47. return [];
  48. }
  49. }