-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ses): change source email and template name
- Loading branch information
1 parent
2240cc8
commit 1579566
Showing
1 changed file
with
7 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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<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) { | ||
|
@@ -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) { | ||
|