data = $data; $this->template = Template::find($template); } /** * Get the message envelope. * * @return \Illuminate\Mail\Mailables\Envelope */ public function envelope() { return new Envelope( subject: str_replace("{\$product_name}", $this->data['product_name'], $this->template->subject), ); } /** * Get the message content definition. * * @return \Illuminate\Mail\Mailables\Content */ public function content() { return new Content( view: 'emails.template', with: [ 'template' => str_replace( [ "{\$company_name}", "{\$company_logo}", "{\$client_name}", "{\$product_name}", "{\$product_billing}", "{\$product_price}", "{\$service_host}", "{\$service_username}", "{\$service_password}", "{\$service_password}", "{\$ftp_account}", "{\$ftp_password}", ], [ $this->data['company_name'], $this->data['company_logo'], $this->data['client_name'], $this->data['product_name'], $this->data['product_billing'], $this->data['product_price'], $this->data['service_host'], $this->data['service_username'], $this->data['service_password'], $this->data['service_due_exp'], $this->data['ftp_account'], $this->data['ftp_password'], ], $this->template->message) ] ); } /** * Get the attachments for the message. * * @return array */ public function attachments() { return []; } }