fix: [esign] 알림톡 버튼 URL의 #{토큰} 변수를 실제 access_token으로 치환
This commit is contained in:
@@ -1061,12 +1061,25 @@ private function sendAlimtalk(
|
||||
: " 안녕하세요, {$signer->name}님. \n 전자계약 서명 요청이 도착했습니다.\n\n ■ 계약명: {$contract->title}\n ■ 서명 기한: {$expires}\n\n 아래 버튼을 눌러 계약서를 확인하고 서명해 주세요.";
|
||||
}
|
||||
|
||||
// 등록된 버튼 URL을 그대로 사용 (동적 URL 사용 시 템플릿 불일치 오류)
|
||||
// 버튼 URL의 #{토큰} 변수를 실제 access_token으로 치환
|
||||
$buttons = ! empty($templateButtons) ? $templateButtons : [
|
||||
['Name' => '계약서 확인하기', 'ButtonType' => 'WL',
|
||||
'Url1' => 'https://mng.codebridge-x.com', 'Url2' => 'https://mng.codebridge-x.com'],
|
||||
'Url1' => $signUrl, 'Url2' => $signUrl],
|
||||
];
|
||||
|
||||
foreach ($buttons as &$btn) {
|
||||
foreach (['Url1', 'Url2'] as $urlKey) {
|
||||
if (! empty($btn[$urlKey])) {
|
||||
$btn[$urlKey] = str_replace(
|
||||
['#{토큰}', '#{%ED%86%A0%ED%81%B0}', urlencode('#{토큰}')],
|
||||
[$signer->access_token, $signer->access_token, $signer->access_token],
|
||||
urldecode($btn[$urlKey])
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($btn);
|
||||
|
||||
$receiverNum = preg_replace('/[^0-9]/', '', $signer->phone);
|
||||
|
||||
\Log::info('E-Sign 알림톡 발송 시도', [
|
||||
|
||||
Reference in New Issue
Block a user