target = $checkedOutTo; $this->item = $asset; $this->admin = $checkedInBy; $this->note = $note; $this->settings = Setting::getSettings(); $this->expected_checkin = ''; if ($this->item->expected_checkin) { $this->expected_checkin = Helper::getFormattedDateObject($this->item->expected_checkin, 'date', false); } } /** * Get the message envelope. */ public function envelope(): Envelope { $from = new Address(env('MAIL_FROM_ADDR','service@snipe-it.io')); return new Envelope( from: $from, subject: trans('mail.Asset_Checkin_Notification'), ); } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return Content */ public function content(): Content { $this->item->load('assetstatus'); $fields = []; // Check if the item has custom fields associated with it if (($this->item->model) && ($this->item->model->fieldset)) { $fields = $this->item->model->fieldset->fields; } return new Content( markdown: 'mail.markdown.checkin-asset', with: [ 'item' => $this->item, 'status' => $this->item->assetstatus?->name, 'admin' => $this->admin, 'note' => $this->note, 'target' => $this->target, 'fields' => $fields, 'expected_checkin' => $this->expected_checkin, ], ); } /** * Get the attachments for the message. * * @return array */ public function attachments(): array { return []; } }