Skip to content

Commit

Permalink
refactor: edit name of function that send mail
Browse files Browse the repository at this point in the history
  • Loading branch information
woowabrie committed Oct 12, 2023
1 parent 5c5c180 commit dd427ec
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class MailMessageService(
reservations.forEach { mailReservation ->
mailReservation.send()
mailReservationRepository.save(mailReservation)
sendingMailService.sendByBccSynchronous(MailData(messagesById.getValue(mailReservation.mailMessageId)))
sendingMailService.sendMailByBccSynchronous(MailData(messagesById.getValue(mailReservation.mailMessageId)))
mailReservation.finish()
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/apply/application/mail/SendingMailService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class SendingMailService(
}

@Async
fun sendByBcc(request: MailData, files: Map<String, ByteArrayResource>) {
fun sendMailByBcc(request: MailData, files: Map<String, ByteArrayResource>) {
val mailMessage = mailMessageRepository.save(request.toMailMessage())
val body = generateMailBody(request)
val recipients = request.recipients + mailProperties.username
Expand All @@ -107,7 +107,7 @@ class SendingMailService(
saveMailHistories(mailMessage.id, succeeded, failed)
}

fun sendByBccSynchronous(request: MailData, files: Map<String, ByteArrayResource> = emptyMap()) {
fun sendMailByBccSynchronous(request: MailData, files: Map<String, ByteArrayResource> = emptyMap()) {
val mailMessage = mailMessageRepository.save(request.toMailMessage())
val body = generateMailBody(request)
val recipients = mailMessage.recipients + mailProperties.username
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/apply/ui/admin/mail/MailsFormView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class MailsFormView(
if (result == null) {
createNotification("받는사람을 한 명 이상 지정해야 합니다.")
} else {
sendingMailService.sendByBcc(result, result.attachments)
sendingMailService.sendMailByBcc(result, result.attachments)
UI.getCurrent().navigate(MailsView::class.java)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/apply/ui/api/MailRestController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class MailRestController(
@LoginUser(administrator = true) user: User
): ResponseEntity<Unit> {
val inputStreamFiles = files.associate { (it.originalFilename!! to ByteArrayResource(it.bytes)) }
sendingMailService.sendByBcc(request, inputStreamFiles)
sendingMailService.sendMailByBcc(request, inputStreamFiles)
return ResponseEntity.noContent().build()
}

Expand Down

0 comments on commit dd427ec

Please sign in to comment.