$value) { $subject = str_replace('{' . $key . '}', $value, $subject); $content = str_replace('{' . $key . '}', $value, $content); } if ($type === 'email') { // 이메일 발송 (G5 기본 mailer 사용 가정) include_once(G5_LIB_PATH.'/mailer.lib.php'); // $data['customer_email'] 등이 존재해야 함 if (!empty($data['customer_email'])) { mailer($g5['title'], $g5['admin_email'], $data['customer_email'], $subject, $content, 1); consultant_log("이메일 발송: {$template_key} to {$data['customer_email']}"); return true; } } elseif ($type === 'sms') { // SMS 발송 (G5 기본 SMS 라이브러리 사용 가정 - 실제 구현은 SMS 모듈에 따라 다름) // 여기서는 로그만 남기고 실제 발송 로직은 SMS 모듈에 맞게 구현 필요 // 예: // include_once(G5_LIB_PATH.'/icode.sms.lib.php'); // $SMS = new SMS; // $SMS->SMS_con($g5['sms_admin'], $g5['sms_id'], $g5['sms_pw'], $g5['sms_port']); // $SMS->Add($data['customer_phone'], $g5['admin_phone'], $g5['sms_admin'], iconv("utf-8", "euc-kr", $content), ""); // $SMS->Send(); consultant_log("SMS 발송 시도: {$template_key} to {$data['customer_phone']} (내용: $content)"); return true; // 실제 발송 성공 여부에 따라 변경 } return false; } ?>