ContainerAction.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace App\Mail;
  3. use App\Models\Container;
  4. use App\Models\Enums\ObjectAction;
  5. use App\Models\Task;
  6. use Illuminate\Bus\Queueable;
  7. use Illuminate\Contracts\Queue\ShouldQueue;
  8. use Illuminate\Mail\Mailable;
  9. use Illuminate\Mail\Mailables\Content;
  10. use Illuminate\Mail\Mailables\Envelope;
  11. use Illuminate\Queue\SerializesModels;
  12. class ContainerAction extends Mailable
  13. {
  14. use Queueable, SerializesModels;
  15. /**
  16. * Create a new message instance.
  17. */
  18. public function __construct(public Container $container, protected ObjectAction $objectAction, public array $actions = [])
  19. {
  20. }
  21. /**
  22. * Get the message envelope.
  23. */
  24. public function envelope(): Envelope
  25. {
  26. return new Envelope(
  27. subject: $this->container->email_subject ?: $this->container->name,
  28. );
  29. }
  30. /**
  31. * Get the message content definition.
  32. */
  33. public function content(): Content
  34. {
  35. return new Content(
  36. //view: 'view.name',
  37. markdown: 'emails.actions.container',
  38. );
  39. }
  40. /**
  41. * Get the attachments for the message.
  42. *
  43. * @return array<int, \Illuminate\Mail\Mailables\Attachment>
  44. */
  45. public function attachments(): array
  46. {
  47. return [];
  48. }
  49. }