From 0336fd8b68ca3b8d2952d9f5265a9e47ae1491b4 Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Tue, 10 Oct 2023 19:44:15 +0900 Subject: [PATCH] =?UTF-8?q?=E5=8F=A3=E5=BA=A7=E7=99=BB=E9=8C=B2=E5=A4=B1?= =?UTF-8?q?=E6=95=97=E3=83=A1=E3=83=BC=E3=83=AB=E3=80=80=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/SMBCPoll.php | 10 ++++-- .../FailedRegisterBankAccountNotice.php | 32 +++++++++++++++++++ app/Kintone/Models/Customer.php | 2 +- ...led_register_bank_account_notice.blade.php | 9 ++++++ 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 app/Email/Members/FailedRegisterBankAccountNotice.php create mode 100644 resources/views/emails/members/failed_register_bank_account_notice.blade.php diff --git a/app/Console/Commands/SMBCPoll.php b/app/Console/Commands/SMBCPoll.php index 681f276..1423551 100644 --- a/app/Console/Commands/SMBCPoll.php +++ b/app/Console/Commands/SMBCPoll.php @@ -2,11 +2,13 @@ namespace App\Console\Commands; +use App\Email\Members\FailedRegisterBankAccountNotice; use App\Http\API\SMBC\PollResultRecord; use App\Http\API\SMBC\SMBC; use App\Http\API\SMBC\SMBCStatus; use App\Kintone\Models\BankAccountUpdateApplication; use App\Kintone\Models\Customer; +use App\Logic\EmailManager; use App\Logic\GeneralApplicationManager; use App\Models\SmbcPollStatus; use App\Util\DateUtil; @@ -161,8 +163,12 @@ class SMBCPoll extends BaseCommand return; } if ($data->status === SMBCStatus::ERROR || $data->status === SMBCStatus::CANCEL) { - // TODOエラーメール送信 - + // エラーメール送信 + $customer = Customer::findByCustomerCode($data->getCustomerCode()); + $this->outputWarn(sprintf("申請失敗のためエラーメール送信 受付番号%s 顧客コード:%d 氏名:%s", $data->acceptNo, $customer->customerCode, $customer->customerName)); + $email = new FailedRegisterBankAccountNotice($customer); + $emailMmanager = new EmailManager($email); + $emailMmanager->confirm(); return; } if ($data->status === SMBCStatus::PROCESSING) { diff --git a/app/Email/Members/FailedRegisterBankAccountNotice.php b/app/Email/Members/FailedRegisterBankAccountNotice.php new file mode 100644 index 0000000..4b06318 --- /dev/null +++ b/app/Email/Members/FailedRegisterBankAccountNotice.php @@ -0,0 +1,32 @@ + $this->getAppUrl(['dashboard', 'update', 'user', 'back-register']), + ]; + } +} diff --git a/app/Kintone/Models/Customer.php b/app/Kintone/Models/Customer.php index 202f7fb..6bef8b4 100644 --- a/app/Kintone/Models/Customer.php +++ b/app/Kintone/Models/Customer.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\Auth; /** * アプリ名 顧客マスタ - * @property string customerCode + * @property int customerCode * @property string customerName * @property string customerNameKana * @property string email diff --git a/resources/views/emails/members/failed_register_bank_account_notice.blade.php b/resources/views/emails/members/failed_register_bank_account_notice.blade.php new file mode 100644 index 0000000..32e3b9b --- /dev/null +++ b/resources/views/emails/members/failed_register_bank_account_notice.blade.php @@ -0,0 +1,9 @@ +@extends('emails.layouts.member') + +@section('contents') +振替口座登録手続きをしていただきましたが、エラー等で登録が完了していません。 +お手数をおかけしますが、下記URLから再度振替口座登録を行ってください。 +(再登録の際は、金融機関での登録完了のご確認をお願いいたします。) + +{{ $url }} +@endsection \ No newline at end of file