개발 slecs

정산 완료 시 거래명세서 Excel 첨부 이메일 발송 추가

목차

feat: 거래명세서 Excel 생성 및 이메일 첨부 기능 추가

이메일 기능 정비 작업임. 거래명세서를 Excel로 생성해서 이메일에 첨부하는 기능이 핵심이었음.

이메일 발송 구조

public interface EmailProvider {
    void send(EmailDto dto);
    void sendWithAttachment(EmailDto dto, File attachment);
}

NCP(NAVER Cloud Platform) Simple & Easy Notification Service 기반 구현체를 사용함.

거래명세서 Excel 생성

public File generateStatement(Long partnerSn, YearMonth ym) {
    List<Transaction> list = mapper.selectByPeriod(partnerSn, ym);
    Workbook wb = new XSSFWorkbook();
    Sheet sheet = wb.createSheet("거래명세서");
    Row header = sheet.createRow(0);
    header.createCell(0).setCellValue("거래일시");
    header.createCell(1).setCellValue("거래유형");
    // ...
    return writeToTempFile(wb);
}

이메일 발송 시점

트리거 내용
정산 완료 명세서 첨부 이메일
계정 가입 환영 이메일
비밀번호 재설정 링크 포함 이메일

댓글 0

첫 댓글 달아줘.