mailing = $mailing; } /** * Get the message envelope. */ public function envelope(): Envelope { return new Envelope( subject: $this->mailing->subject, ); } /** * Get the message content definition. */ public function content(): Content { return new Content( htmlString: $this->mailing->message, ); } /** * Get the attachments for the message. * * @return array */ public function attachments(): array { return $this->mailing->attachments()->get()->map(function (ProjectMailingAttachment $attachment) { $projectPath = $attachment->mailing()->project()->first()->path; return Attachment::fromStorage( path: $projectPath.$attachment->path ) ->as($attachment->name) ->withMime('application/pdf'); })->toArray(); } }