Initial commit

This commit is contained in:
2026-05-29 17:49:25 +09:00
commit 330105cb27
1081 changed files with 148694 additions and 0 deletions
@@ -0,0 +1,87 @@
= 메일 상태 조회
== 개요
Knox REST 메일수신상황조회 API와 연계하여 발신한 메일의 상태를 조회할 수 있다.
=== Knox메일 연계 설정
Knox REST 메일수신상황조회를 위해서는 Knox메일 연계 설정이 되어 있어야 한다. +
Knox메일 연계 설정은 <<_메일,메일>> 항목의 <<_knox메일_연계_설정,Knox메일 연계 설정>> 항목을 참조한다.
=== 메일별 수신 상황 카운트 조회
발신한 메일의 메일 아이디값을 이용하여 발신한 메일을 수신한 수신자들의 개봉상태를
요약한 카운트 정보조회
Service:: KnoxMailService
Method::
+
[source,java]
----
/**
* Knox 메일별 수신상태 조회
* @param mailIds Knox 메일 아이디 리스트
* @param sendMail 메일 정보
* @return Knox 메일 상태
*/
MailStatus[] getDeliveryStatusCount(List<String> mailIds, SendMail sendMail);
----
* SendMail 객체에 senderId (발신자 EP ID) 값 설정 필수
=== 수신인 별 수신 상황 조회
발신한 메일의 메일 아이디값을 이용하여 발신한 메일의 수신자 별 수신 상태 정보를 조회
Service:: KnoxMailService
Method::
+
[source,java]
----
/**
* Knox 메일 수신인별 수신상태 조회
* @param mailId Knox 메일 아이디
* @param sendMail 메일 정보
* @return Knox 메일 수신인별 수신상태 정보
*/
Recipient[] getDeliveryStatus(String mailId, SendMail sendMail);
----
* SendMail 객체에 senderId (발신자 EP ID) 값 설정 필수
=== 사용 예
.SentMailHistoryServiceImpl
[source,java]
----
@Override
public Map<String, Object> getSentMail(String mailId) {
Map<String, Object> rtnMap = new HashMap<>();
MailStatus mailStatus = new MailStatus();
List<Recipient> recipientList;
List<String> mailIds = new ArrayList<>();
mailIds.add(mailId);
SendMail sendMail = sentMailHistoryDao.getSentMail(mailId);
try {
// 14일 이전 문서는 Knox에서 조회
mailStatus = knoxMailService.getDeliveryStatusCount(mailIds, sendMail)[0]; // <1>
recipientList = Arrays.asList(knoxMailService.getDeliveryStatus(mailId, sendMail)); // <2>
if (ObjectUtils.isNotEmpty(recipientList)) {
// 메일 수신 상태 동기화
updateRecipient(mailId, recipientList);
} else {
recipientList = sentMailHistoryDao.getRecipientList(mailId);
}
} catch (Exception ex) {
log.error(ex.getMessage());
//Knox 에서 메일을 조회 할수 없을 경우, 14일이 경과 되었거나 Mail Box를 못찾을 경우
recipientList = sentMailHistoryDao.getRecipientList(mailId);
}
rtnMap.put("mailStatus", mailStatus);
rtnMap.put("recipientList", recipientList);
rtnMap.put("sendMail", sendMail);
return rtnMap;
}
----
<1> Knox 메일별 수신자들의 개봉상태 카운트 조회
<2> Knox 수신인 별 메일 수신 상황 조회