Skip to content

Commit

Permalink
fix: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladik-gif committed Oct 11, 2024
1 parent befd7b6 commit a773bd3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
@Slf4j
public class EmailMessageFactoryService {
public EmailMessageDto generateEmailMessage(EmailMessageInfoDto emailMessageInfoDto) {
String path = emailMessageInfoDto.path();
UUID uuidToken = emailMessageInfoDto.uuidToken();
EmailMessageType emailMessageType = emailMessageInfoDto.emailMessageType();
String link = generateLink(path, uuidToken, emailMessageType);
final var path = emailMessageInfoDto.path();
final var uuidToken = emailMessageInfoDto.uuidToken();
final var emailMessageType = emailMessageInfoDto.emailMessageType();
final var link = generateLink(path, uuidToken, emailMessageType);

log.info("Generated link: {}", link);
String messageBody = String.format(emailMessageType.getMessageBody(), emailMessageInfoDto.username(), link);

final var messageBody = String.format(
emailMessageType.getMessageBody(), emailMessageInfoDto.username(), link
);

return new EmailMessageDto(emailMessageInfoDto.email(), emailMessageType.getSubject(), messageBody);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
public class EmailSenderService {

@Value("${spring.mail.username}")
private String emailAddressFrom;
private final String emailAddressFrom;
private final JavaMailSender javaMailSender;

@Async
Expand Down

0 comments on commit a773bd3

Please sign in to comment.