template = $template; $this->data = $data; } public function envelope(): Envelope { return new Envelope( subject: $this->template->subject, ); } public function content(): Content { $message = str_replace( [ '{\$company_name}', '{\$company_logo}', '{\$client_name}', '{\$order_num}', '{\$order_total}', '{\$invoice_num}', ], [ $this->data['company_name'], $this->data['company_logo'], $this->data['client_name'], $this->data['order_num'], $this->data['order_total'], $this->data['invoice_num'], ], $this->template->message ); return new Content( view: 'emails.template', with: ['template' => $message], ); } public function attachments(): array { return []; } }