*/ public function backoff(): array { return [10, 30, 60, 300]; } /** * Create a new message instance. */ public function __construct( public readonly ContactFormData $data ) { } /** * Get the message envelope. */ public function envelope(): Envelope { return new Envelope( subject: trans('Contact') . ' - ' . Config::string('app.name') . ' - ' . e($this->data->subject), replyTo: [ new Address( $this->data->email, $this->data->firstName . ' ' . $this->data->lastName ), ], ); } /** * Get the message content definition. */ public function content(): Content { return new Content( markdown: 'emails.send-contact', ); } /** * Get the attachments for the message. * * @return \Illuminate\Mail\Mailables\Attachment[] */ public function attachments(): array { if ($this->data->file === null) { return []; } $extension = pathinfo($this->data->file->originalName, PATHINFO_EXTENSION); $joinedFileName = sprintf( 'BOUTIQUE_MESSAGE-PJ-%s.%s', date('YmdHis'), $extension ); return [ Attachment::fromPath($this->data->file->path) ->as($joinedFileName) ->withMime($this->data->file->mimeType), ]; } }