fix: [esign] 본사(tenant_id=1) OTP는 항상 이메일 발송
- 본사는 알림톡 방식 선택 시에도 OTP를 이메일로 처리 - getContract 응답에서도 본사는 send_method를 email로 반환
This commit is contained in:
@@ -133,7 +133,7 @@ public function getContract(string $token): JsonResponse
|
||||
'has_stamp' => (bool) $signer->signature_image_path,
|
||||
'signed_at' => $signer->signed_at,
|
||||
],
|
||||
'send_method' => $contract->send_method ?? 'email',
|
||||
'send_method' => $contract->tenant_id == 1 ? 'email' : ($contract->send_method ?? 'email'),
|
||||
'is_signable' => $isSignable,
|
||||
'status_message' => $statusMessage,
|
||||
],
|
||||
@@ -166,8 +166,8 @@ public function sendOtp(string $token): JsonResponse
|
||||
$sendMethod = $contract->send_method ?? 'email';
|
||||
$channel = 'email';
|
||||
|
||||
// 알림톡/both 방식이고 전화번호가 있으면 SMS로 발송
|
||||
if (in_array($sendMethod, ['alimtalk', 'both']) && $signer->phone) {
|
||||
// 알림톡/both 방식이고 전화번호가 있으면 SMS로 발송 (본사 tenant_id=1은 이메일 유지)
|
||||
if (in_array($sendMethod, ['alimtalk', 'both']) && $signer->phone && $contract->tenant_id != 1) {
|
||||
$smsSent = $this->sendOtpViaSms($contract, $signer, $otpCode);
|
||||
if ($smsSent) {
|
||||
$channel = 'sms';
|
||||
|
||||
Reference in New Issue
Block a user