From e47fb0f8aab0d386b761d817d35de112843a15d2 Mon Sep 17 00:00:00 2001 From: zio Date: Tue, 14 Jul 2026 06:57:12 +0900 Subject: [PATCH] =?UTF-8?q?fix(marketing):=20honest=20send-result=20wordin?= =?UTF-8?q?g=20=E2=80=94=20queued=20counts,=20mail=5Flog=20is=20source=20o?= =?UTF-8?q?f=20truth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sentCount tallies async queue submissions, so SMTP failures (e.g. the 2026-07-14 MailAuthenticationException) were invisible in the response. Meta now says 'N queued, see send history' for both test and live paths. Co-Authored-By: Claude Fable 5 --- .../com/zioinfo/kintex/marketing/MarketingService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/src/main/java/com/zioinfo/kintex/marketing/MarketingService.java b/src/backend/src/main/java/com/zioinfo/kintex/marketing/MarketingService.java index 5840af2..e0c60b6 100644 --- a/src/backend/src/main/java/com/zioinfo/kintex/marketing/MarketingService.java +++ b/src/backend/src/main/java/com/zioinfo/kintex/marketing/MarketingService.java @@ -128,9 +128,10 @@ public class MarketingService { sentOk++; } skipped += eligible; // 실 대상 전원 이번엔 미발송(테스트) + // sentOk 는 큐 적재(시도) 건수 — 실제 SMTP 성공/실패는 비동기라 mail_log 가 정본(2026-07-14 인증실패 사례). String meta = testTo.isEmpty() ? "테스트(dry-run): 대상 " + eligible + "명 · 실발송 없음" - : "테스트 발송: 테스트 수신함 " + sentOk + "건 · 실대상 " + eligible + "명 미발송"; + : "테스트 발송 요청: 테스트 수신함 " + sentOk + "건 큐 적재(결과는 발송 이력 참조) · 실대상 " + eligible + "명 미발송"; // 상태 미전이(draft/scheduled 유지) — 테스트는 캠페인을 소진하지 않는다. mapper.markCampaignResult(eventId, campaignId, status, sentOk, skipped, failed, true, meta); return new CampaignSendResult(campaignId, status, true, mailEnabled, @@ -169,9 +170,9 @@ public class MarketingService { int remaining = skipped - overCap - failed; // rate cap 잔여 String newStatus = remaining > 0 ? "sending" : "done"; String meta = mailEnabled - ? "발송 " + sentOk + "건 (대상 " + eligibleTotal + "명" + ? "발송 요청 " + sentOk + "건 큐 적재 (대상 " + eligibleTotal + "명" + (remaining > 0 ? " · 잔여 " + remaining + "명" : "") - + (overCap > 0 ? " · 상한초과 " + overCap + "명" : "") + ")" + + (overCap > 0 ? " · 상한초과 " + overCap + "명" : "") + " · 결과는 발송 이력 참조)" : "발송 대상 " + sentOk + "건 (MAIL 비활성 — 실 전송 없음)"; mapper.markCampaignResult(eventId, campaignId, newStatus, sentOk, skipped, failed, false, meta); return new CampaignSendResult(campaignId, newStatus, false, mailEnabled,