fix(marketing): honest send-result wording — queued counts, mail_log is source of truth
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 <noreply@anthropic.com>
This commit is contained in:
parent
b3d3a5588c
commit
e47fb0f8aa
@ -128,9 +128,10 @@ public class MarketingService {
|
|||||||
sentOk++;
|
sentOk++;
|
||||||
}
|
}
|
||||||
skipped += eligible; // 실 대상 전원 이번엔 미발송(테스트)
|
skipped += eligible; // 실 대상 전원 이번엔 미발송(테스트)
|
||||||
|
// sentOk 는 큐 적재(시도) 건수 — 실제 SMTP 성공/실패는 비동기라 mail_log 가 정본(2026-07-14 인증실패 사례).
|
||||||
String meta = testTo.isEmpty()
|
String meta = testTo.isEmpty()
|
||||||
? "테스트(dry-run): 대상 " + eligible + "명 · 실발송 없음"
|
? "테스트(dry-run): 대상 " + eligible + "명 · 실발송 없음"
|
||||||
: "테스트 발송: 테스트 수신함 " + sentOk + "건 · 실대상 " + eligible + "명 미발송";
|
: "테스트 발송 요청: 테스트 수신함 " + sentOk + "건 큐 적재(결과는 발송 이력 참조) · 실대상 " + eligible + "명 미발송";
|
||||||
// 상태 미전이(draft/scheduled 유지) — 테스트는 캠페인을 소진하지 않는다.
|
// 상태 미전이(draft/scheduled 유지) — 테스트는 캠페인을 소진하지 않는다.
|
||||||
mapper.markCampaignResult(eventId, campaignId, status, sentOk, skipped, failed, true, meta);
|
mapper.markCampaignResult(eventId, campaignId, status, sentOk, skipped, failed, true, meta);
|
||||||
return new CampaignSendResult(campaignId, status, true, mailEnabled,
|
return new CampaignSendResult(campaignId, status, true, mailEnabled,
|
||||||
@ -169,9 +170,9 @@ public class MarketingService {
|
|||||||
int remaining = skipped - overCap - failed; // rate cap 잔여
|
int remaining = skipped - overCap - failed; // rate cap 잔여
|
||||||
String newStatus = remaining > 0 ? "sending" : "done";
|
String newStatus = remaining > 0 ? "sending" : "done";
|
||||||
String meta = mailEnabled
|
String meta = mailEnabled
|
||||||
? "발송 " + sentOk + "건 (대상 " + eligibleTotal + "명"
|
? "발송 요청 " + sentOk + "건 큐 적재 (대상 " + eligibleTotal + "명"
|
||||||
+ (remaining > 0 ? " · 잔여 " + remaining + "명" : "")
|
+ (remaining > 0 ? " · 잔여 " + remaining + "명" : "")
|
||||||
+ (overCap > 0 ? " · 상한초과 " + overCap + "명" : "") + ")"
|
+ (overCap > 0 ? " · 상한초과 " + overCap + "명" : "") + " · 결과는 발송 이력 참조)"
|
||||||
: "발송 대상 " + sentOk + "건 (MAIL 비활성 — 실 전송 없음)";
|
: "발송 대상 " + sentOk + "건 (MAIL 비활성 — 실 전송 없음)";
|
||||||
mapper.markCampaignResult(eventId, campaignId, newStatus, sentOk, skipped, failed, false, meta);
|
mapper.markCampaignResult(eventId, campaignId, newStatus, sentOk, skipped, failed, false, meta);
|
||||||
return new CampaignSendResult(campaignId, newStatus, false, mailEnabled,
|
return new CampaignSendResult(campaignId, newStatus, false, mailEnabled,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user