발신번호 반려 이메일 주소

This commit is contained in:
2023-02-13 14:30:46 +09:00
parent d44e81ff56
commit 048097ff41
3 changed files with 28 additions and 8 deletions

View File

@@ -62,4 +62,6 @@ interface SendNumMgtMapper {
List<InsertNumber> selectSndrnoListAll(InsertNumberReqDto insertNumberReqDto);
String selectApiAuthToken(String apiApplicationId);
String selectUserEmailByAdminId(String adminId);
}

View File

@@ -618,6 +618,12 @@ public class SendNumMgtService {
SendNumMgtMapper sendNumMgtMapper = sqlSessionMaster.getMapper(SendNumMgtMapper.class);
logger.debug("넘어오는 값 확인하기={}",updateApprReqDto);
String adminId = updateApprReqDto.getAdminId();
String userEmail = sendNumMgtMapper.selectUserEmailByAdminId(adminId);
Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
UserDetails userDetails = (UserDetails) principal;
String regId = userDetails.getUsername();
@@ -648,18 +654,19 @@ public class SendNumMgtService {
updateApprSendNumber.setAdminId(regId);
sendNumMgtMapper.updateSndrno(updateApprSendNumber);
}
String SndrNoString = sndrNoList.toString();
String re1 = SndrNoString.replace("[", "<br>");
String re2 = re1.replace(", ","</br><br>");
String re3 = re2.replace("]", "</br>");
logger.debug("발신번호 리스트 스트링 ={}",re3);
//2. 반려 발신번호 리스트에 값이 있을 경우 메일을 보냄
if(sndrNoList.size()>0) {
//3. 발신번호 리스트 치환
String SndrNoString = sndrNoList.toString();
String re1 = SndrNoString.replace("[", "<br>");
String re2 = re1.replace(", ","</br><br>");
String re3 = re2.replace("]", "</br>");
// logger.debug("발신번호 리스트 스트링 ={}",re3);
//try catch 처리하기
try {
String testEmail = "lmh3294@naver.com";
Map<Object, Object> mailResultMap = new HashMap<Object, Object>();
// API authToken 조회
@@ -671,7 +678,7 @@ public class SendNumMgtService {
mailReqMap.put("rejectListSndrNo", re3);
mailReqMap.put("rejectHtml", updateApprReqDto.getMemo());
//이메일 수신자 가져오는 쿼리
mailReqMap.put("toEmail", testEmail);
mailReqMap.put("toEmail", userEmail);
mailReqMap.put("fromEmail", fromEmail);
mailReqMap.put("templeteCode", senrNoRejTempleteCode);
mailReqMap.put("homeUrl", mailTempleteHomeUrl);

View File

@@ -218,6 +218,17 @@
USER_ID = #{adminId}
</select>
<select id="selectUserEmailByAdminId" parameterType="String" resultType="String">
/* sendNumMgt-mapper.xml(selectUserSeqByAdminId) */
SELECT
EMAIL
FROM
hubez_common.EZ_SVC_USER
WHERE
USER_ID = #{adminId}
</select>
<delete id="deleteNumber" parameterType="kr.co.uplus.ez.api.sendNumMgt.dto.DeleteNumberReqDto">
/* sendNumMgt-mapper.xml(deleteNumber) */
DELETE