From 15795666375c40c51beaca9be2edbf6b015931e0 Mon Sep 17 00:00:00 2001 From: chaerim Date: Mon, 18 Sep 2023 20:41:29 +0900 Subject: [PATCH] refactor(ses): change source email and template name --- .../com/e2i/wemeet/service/aws/ses/AwsSesService.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/e2i/wemeet/service/aws/ses/AwsSesService.java b/src/main/java/com/e2i/wemeet/service/aws/ses/AwsSesService.java index 106eaae2..81628fe9 100644 --- a/src/main/java/com/e2i/wemeet/service/aws/ses/AwsSesService.java +++ b/src/main/java/com/e2i/wemeet/service/aws/ses/AwsSesService.java @@ -16,6 +16,7 @@ import java.util.Map; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.ValueOperations; import org.springframework.stereotype.Service; @@ -34,10 +35,12 @@ public class AwsSesService implements EmailCredentialService { private final SesClient sesClient; private final RedisTemplate redisTemplate; private final MemberRepository memberRepository; - private static final String TEMPLATE_NAME = "certifyEmailTemplate"; + @Value("${aws.ses.templateName}") + private String templateName; - private static final String SOURCE_EMAIL = "qkrdbsk28@naver.com"; + @Value("${aws.ses.sourceEmail}") + private String sourceEmail; @Override public void issue(String receiveTarget) { @@ -94,9 +97,9 @@ private void validateIsExistMail(String mail) { private SendTemplatedEmailRequest createEmailRequest(String email, String message) { try { return SendTemplatedEmailRequest.builder() - .source(SOURCE_EMAIL) + .source(sourceEmail) .destination(d -> d.toAddresses(email)) - .template(TEMPLATE_NAME) + .template(templateName) .templateData(this.toJson(message)) .build(); } catch (JsonProcessingException e) {