email = $user->email; $this->parkName = $parking->park_name; $this->useStartRequestDate = $subscription ? $subscription->use_start_request_date : null; $this->vehicleType = $seasonTicketContract->vehicle_type; $this->contractorTypeName = $contractorTypeName; $this->seasonTicketSeqNo = $seasonTicketContract->season_ticket_seq_no; $this->confirmationCode = $seasonTicketContract->confirmation_code; $this->parkingUseType = $seasonTicketContract->parking_use_type; $this->customerCode = $seasonTicketContract->customer_code; $this->parkingManagementCode = $seasonTicketContract->parking_management_code; } public function getTemplateName(): string { return 'mails.members.subscription.approve'; } public function getSubject(): string { return '【スマートパーキングパス】定期申し込み完了'; } public function getMemberParams(): array { return [ 'email' => $this->email, 'park_name' => $this->parkName, 'use_start_request_date' => $this->getUseStartRequestDate(), 'vehicle_type' => $this->getVehicleType(), 'contractor_type_name' => $this->contractorTypeName, 'how_to_use' => $this->getHowToUse(), 'season_ticket_seq_no' => $this->seasonTicketSeqNo, 'confirmation_code' => $this->confirmationCode, 'ic_card_rental_request' => $this->parkingUseType === ParkingUseTypeCode::IC_RENTAL, 'ic_self_card_request' => $this->parkingUseType === ParkingUseTypeCode::IC_SELF, 'ic_qr_code_request' => $this->parkingUseType === ParkingUseTypeCode::QR, 'my_qr_code_url' => $this->getMyQrCodeUrl(), ]; } private function getUseStartRequestDate() { if ($this->useStartRequestDate === null) return "-"; return $this->useStartRequestDate->format("Y年m月d日"); } private function getVehicleType() { return VehicleTypeCode::getName($this->vehicleType); } private function getHowToUse() { switch ($this->parkingUseType) { case ParkingUseTypeCode::IC_RENTAL: return "貸与ICカード"; case ParkingUseTypeCode::IC_SELF: return "個人ICカード"; case ParkingUseTypeCode::QR: return "QRコード"; } throw new LogicException(sprintf("不適切な駐車場利用方法 %d", $this->parkingUseType->value)); } private function getMyQrCodeUrl() { return $this->getAppUrl(['app', 'qrcode', 'detail', $this->customerCode, $this->parkingManagementCode]); } }