Skip to content

Commit

Permalink
refactor(ses): change source email and template name
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaerim1001 committed Sep 18, 2023
1 parent 2240cc8 commit 1579566
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/com/e2i/wemeet/service/aws/ses/AwsSesService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -34,10 +35,12 @@ public class AwsSesService implements EmailCredentialService {
private final SesClient sesClient;
private final RedisTemplate<String, String> 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 = "[email protected]";

@Value("${aws.ses.sourceEmail}")
private String sourceEmail;

@Override
public void issue(String receiveTarget) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1579566

Please sign in to comment.