Skip to content

Commit

Permalink
hotfix: signup email fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonardoMeireles55 committed Jan 28, 2025
1 parent d4bfb5f commit 2ee3456
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private void sendUserActionEmail(String actionType, String username, String emai
LocalDateTime date) {
String subject = String.format("User %s - %s", username, actionType);
String content = createUserActionEmailContent(actionType, username, email, date);
sendHtmlEmail(new EmailDTO(email, subject, content));
sendPlainTextEmail(new EmailDTO(email, subject, content));
}

private String createUserActionEmailContent(String actionType, String username, String email,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ public User signUp(String username, String email, String password) {
if (userRepository.existsByEmail(email)) {
throw new CustomGlobalErrorHandling.UserAlreadyExistException();
}
emailService.notifyUserSignup(user.getUsername(), user.getEmail(), LocalDateTime.now());
try {
emailService.notifyUserSignup(user.getUsername(), user.getEmail(), LocalDateTime.now());
} catch (Exception e) {
log.error("Failed signup for user: {}. Exception: ", user.getEmail(), e);
}

return userRepository.save(user);
}

Expand Down

0 comments on commit 2ee3456

Please sign in to comment.