data = $data; $this->template = Template::find($template); } /** * Get the message envelope. */ public function envelope(): Envelope { return new Envelope( subject: $this->template->subject, ); } /** * Get the message content definition. */ public function content(): Content { return new Content( view: 'emails.template', with: [ 'template' => str_replace( [ "{\$company_name}", "{\$company_logo}", ], [ $this->data['company_name'], $this->data['company_logo'], ], $this->template->message) ] ); } /** * Get the attachments for the message. * * @return array */ public function attachments(): array { return []; } }