-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Refactor/#415] 이메일 전송 목적에 따른 이메일 전송 프로바이더 분리 및 전송 프로바이더 설정할 수 있도록 수정 그리고 전송 이메일 식별자 추가 #416
Conversation
/** | ||
* @return 전송한 이메일 식벽을 위한 값 | ||
*/ | ||
fun sendEmail(from: String, to: String, subject: String, message: String): String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
전송한 이메일 식별을 위한 반환 값 추가
|
||
/** | ||
* Default configuration set name is "few-configuration-set" | ||
*/ | ||
fun getWithConfigurationSetName(): String { | ||
return "few-configuration-set" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aws에서 구성 세트 구분을 위해 추가하였습니다.
override fun getWithConfigurationSetName(): String { | ||
return "few-article-configuration-set" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아티클 전송을 구분하기 위해 추가하였습니다.
fun send(args: T, emailSendProvider: EmailSendProvider? = null): String { | ||
val from = mailProperties.username | ||
val to = args.to | ||
val subject = args.subject | ||
val message = getHtml(args) | ||
emailSendProvider.sendEmail("FEW Letter <$from>", to, subject, message) | ||
return emailSendProvider?.sendEmail("FEW Letter <$from>", to, subject, message) | ||
?: run { | ||
defaultEmailSendProvider.sendEmail( | ||
"FEW Letter <$from>", | ||
to, | ||
subject, | ||
message | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
메서드에 프로바이더를 넣는다면 넣은 프로바이더로 전송하도록 수정하였습니다.
|
||
runCatching { | ||
amazonSimpleEmailService.sendEmail(sendEmailRequest) | ||
amazonSimpleEmailService.sendEmail(sendEmailRequest).messageId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기의 messageId가 AWS의 emailMessageId가 되어서 메일을 구분할 수 있어요!
🎫 연관 이슈
resolved: #415
💁♂️ PR 내용
🙏 작업
🙈 PR 참고 사항
SES에서 제공하는 값은 고유하다고 하고
JavaMailSender의 경우에는 고유하다는 것을 보장한다는 코멘트는 없네요..
📸 스크린샷
JavaMailSender messageId 예
🤖 테스트 체크리스트