| @@ -9,4 +9,5 @@ enum Email: string | |||||
| case USER_INFO_UPDATE_ORDER_APPROVE = '利用者情報変更完了'; | case USER_INFO_UPDATE_ORDER_APPROVE = '利用者情報変更完了'; | ||||
| case ENTRY_APPROVE = '申込受付'; | case ENTRY_APPROVE = '申込受付'; | ||||
| case ENTRY_PAYMENT_COMPLETE = '申込承認'; | case ENTRY_PAYMENT_COMPLETE = '申込承認'; | ||||
| case CHANGE_PLAN_ORDER_APPROVE = 'プラン変更完了'; | |||||
| } | } | ||||
| @@ -0,0 +1,42 @@ | |||||
| <?php | |||||
| namespace App\Email\Members; | |||||
| use App\Kintone\Models\ChangePlanApplication; | |||||
| use App\Kintone\Models\Customer; | |||||
| use App\Kintone\Models\SeasonTicketContract; | |||||
| class ChangePlanOrderApprove extends Members | |||||
| { | |||||
| public function __construct( | |||||
| private SeasonTicketContract $seasonTicketContract, | |||||
| private ChangePlanApplication $app, | |||||
| ?Customer $customer = null, | |||||
| ) { | |||||
| if ($customer === null) { | |||||
| $customer = $app->getCustomer(); | |||||
| } | |||||
| parent::__construct($customer); | |||||
| } | |||||
| public function getTemplateName(): string | |||||
| { | |||||
| return 'emails.members.change_plan_order_approve'; | |||||
| } | |||||
| public function getSubject(): string | |||||
| { | |||||
| return "プラン変更申請完了のお知らせ"; | |||||
| } | |||||
| public function getMemberParams(): array | |||||
| { | |||||
| return [ | |||||
| 'parking_name' => $this->app->parkingName, | |||||
| 'customer_name' => $this->customer->customerName, | |||||
| 'plan_name' => $this->app->planNameAfter, | |||||
| 'memo' => $this->app->memo, | |||||
| ]; | |||||
| } | |||||
| } | |||||
| @@ -27,13 +27,15 @@ class ChangePlanOrderNotice extends Members | |||||
| public function getSubject(): string | public function getSubject(): string | ||||
| { | { | ||||
| return "##TODO プラン変更申請受付のお知らせ"; | |||||
| return "プラン変更申請受付のお知らせ"; | |||||
| } | } | ||||
| public function getMemberParams(): array | public function getMemberParams(): array | ||||
| { | { | ||||
| return [ | return [ | ||||
| 'parking_name' => $this->app->parkingName, | 'parking_name' => $this->app->parkingName, | ||||
| 'customer_name' => $this->customer->customerName, | |||||
| 'plan_name' => $this->app->planNameAfter, | |||||
| 'memo' => $this->app->memo, | 'memo' => $this->app->memo, | ||||
| ]; | ]; | ||||
| } | } | ||||
| @@ -4,12 +4,14 @@ namespace App\Http\Controllers\Web\Email; | |||||
| use App\Codes\Email; | use App\Codes\Email; | ||||
| use App\Email\BaseEmailer; | use App\Email\BaseEmailer; | ||||
| use App\Email\Members\ChangePlanOrderApprove; | |||||
| use App\Email\Members\EntryApprove; | use App\Email\Members\EntryApprove; | ||||
| use App\Email\Members\EntryPaymentComplete; | use App\Email\Members\EntryPaymentComplete; | ||||
| use App\Email\Members\TerminateOrderApprove; | use App\Email\Members\TerminateOrderApprove; | ||||
| use App\Email\Members\UserInfoUpdateOrderApprove; | use App\Email\Members\UserInfoUpdateOrderApprove; | ||||
| use App\Email\Members\VehicleInfoUpdateOrderApprove; | use App\Email\Members\VehicleInfoUpdateOrderApprove; | ||||
| use App\Http\Controllers\Web\FromKintoneController; | use App\Http\Controllers\Web\FromKintoneController; | ||||
| use App\Kintone\Models\ChangePlanApplication; | |||||
| use App\Kintone\Models\SeasonTicketContract; | use App\Kintone\Models\SeasonTicketContract; | ||||
| use App\Kintone\Models\SeasonTicketContractEntry; | use App\Kintone\Models\SeasonTicketContractEntry; | ||||
| use App\Kintone\Models\TerminateApplication; | use App\Kintone\Models\TerminateApplication; | ||||
| @@ -54,6 +56,10 @@ class EmailSendController extends FromKintoneController | |||||
| if ($this->emailManager === null) { | if ($this->emailManager === null) { | ||||
| throw new LogicException("EmailManager不正"); | throw new LogicException("EmailManager不正"); | ||||
| } | } | ||||
| info(sprintf("Email送信依頼受信 %s [%s]", $this->param->emailId->value, json_encode($request->toArray()))); | |||||
| $this->emailManager->confirm(); | $this->emailManager->confirm(); | ||||
| } catch (Exception $e) { | } catch (Exception $e) { | ||||
| LoggingUtil::debugException($e); | LoggingUtil::debugException($e); | ||||
| @@ -100,6 +106,12 @@ class EmailSendController extends FromKintoneController | |||||
| $this->setEmail(new EntryPaymentComplete($parking, $entry, $plan)); | $this->setEmail(new EntryPaymentComplete($parking, $entry, $plan)); | ||||
| return; | return; | ||||
| } | } | ||||
| if ($emailId === Email::CHANGE_PLAN_ORDER_APPROVE) { | |||||
| $application = ChangePlanApplication::findByApplicationNo($this->param->applicationNo); | |||||
| $seasonTicketContract = SeasonTicketContract::find($application->seasonTicketContractRecordNo); | |||||
| $this->setEmail(new ChangePlanOrderApprove($seasonTicketContract, $application)); | |||||
| return; | |||||
| } | |||||
| if ($this->email === null || $this->emailManager === null) { | if ($this->email === null || $this->emailManager === null) { | ||||
| @@ -47,7 +47,7 @@ class ChangePlanOrderOptionsController extends WebController | |||||
| $ret = []; | $ret = []; | ||||
| foreach ($plan->canChangePlanNameList as $planName) { | foreach ($plan->canChangePlanNameList as $planName) { | ||||
| $ret[] = $planName->planName; | |||||
| $ret[$planName->planName] = SeasonTicketContractPlan::findByName($planName->planName)->showPlanName; | |||||
| } | } | ||||
| return $this->successResponse($ret); | return $this->successResponse($ret); | ||||
| @@ -8,6 +8,7 @@ use Illuminate\Support\Collection; | |||||
| /** | /** | ||||
| * アプリ名 定期駐車場プランマスタ | * アプリ名 定期駐車場プランマスタ | ||||
| * @property string planName | * @property string planName | ||||
| * @property string showPlanName | |||||
| * @property string parkingName | * @property string parkingName | ||||
| * @property string[] sendItem | * @property string[] sendItem | ||||
| * @property string vehicleType | * @property string vehicleType | ||||
| @@ -20,6 +21,7 @@ class SeasonTicketContractPlan extends KintoneModel | |||||
| const CONFIG_KEY = "KINTONE_APP_SEASON_TICKET_CONTRACT_PLAN"; | const CONFIG_KEY = "KINTONE_APP_SEASON_TICKET_CONTRACT_PLAN"; | ||||
| const FIELD_PLAN_NAME = "key"; | const FIELD_PLAN_NAME = "key"; | ||||
| const FIELD_SHOW_PLAN_NAME = "利用者へ表示するプラン名"; | |||||
| const FIELD_PARKING_NAME = "定期_駐車場名"; | const FIELD_PARKING_NAME = "定期_駐車場名"; | ||||
| const FIELD_SEND_ITEM = "送付物"; | const FIELD_SEND_ITEM = "送付物"; | ||||
| const FIELD_VEHICLE_TYPE = "種別"; | const FIELD_VEHICLE_TYPE = "種別"; | ||||
| @@ -31,6 +33,8 @@ class SeasonTicketContractPlan extends KintoneModel | |||||
| protected const FIELDS = [ | protected const FIELDS = [ | ||||
| ...parent::FIELDS, | ...parent::FIELDS, | ||||
| self::FIELD_PLAN_NAME => FieldType::SINGLE_LINE_TEXT, | |||||
| self::FIELD_SHOW_PLAN_NAME => FieldType::SINGLE_LINE_TEXT, | |||||
| self::FIELD_PARKING_NAME => FieldType::SINGLE_LINE_TEXT, | self::FIELD_PARKING_NAME => FieldType::SINGLE_LINE_TEXT, | ||||
| self::FIELD_SEND_ITEM => FieldType::CHECK_BOX, | self::FIELD_SEND_ITEM => FieldType::CHECK_BOX, | ||||
| self::FIELD_VEHICLE_TYPE => FieldType::SINGLE_LINE_TEXT, | self::FIELD_VEHICLE_TYPE => FieldType::SINGLE_LINE_TEXT, | ||||
| @@ -0,0 +1,19 @@ | |||||
| @extends('emails.layouts.member') | |||||
| @section('contents') | |||||
| 以下の内容でプラン変更手続きが完了いたしました。 | |||||
| ------------------------------------------------------------------------------------- | |||||
| ■申込内容■ | |||||
| ◆駐車場 | |||||
| {{ $parking_name }} | |||||
| ◆氏名 | |||||
| {{ $customer_name }} | |||||
| ◆変更先プラン | |||||
| {{ $plan_name }} | |||||
| ◆備考 | |||||
| {{ $memo }} | |||||
| @endsection | |||||
| @@ -1,5 +1,21 @@ | |||||
| @extends('emails.layouts.member') | @extends('emails.layouts.member') | ||||
| @section('contents') | @section('contents') | ||||
| プラン変更申請を受け付けました | |||||
| こちらのメールは【自動返信】メールです。 | |||||
| 内容を確認後、プラン更完了メールを送付いたします。 | |||||
| 土日祝・年末年始を除き 4 営業日後までに連絡が無い場合には、お手数ですが下記連絡先までお問い合わせ下さい。 | |||||
| ------------------------------------------------------------------------------------- | |||||
| ■申込内容■ | |||||
| ◆駐車場 | |||||
| {{ $parking_name }} | |||||
| ◆氏名 | |||||
| {{ $customer_name }} | |||||
| ◆変更先プラン | |||||
| {{ $plan_name }} | |||||
| ◆備考 | |||||
| {{ $memo }} | |||||
| @endsection | @endsection | ||||