Skip to content

Commit

Permalink
jakarta mail has to use the same version to work multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
commel committed Apr 12, 2024
1 parent aeec5e7 commit 53b6580
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
<version>2.1.3</version>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/de/holarse/queues/commands/MailCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,10 @@ public String getBody() {
public void setBody(String body) {
this.body = body;
}

@Override
public String toString() {
return "MailCommand{" + "sender=" + sender + ", recipients=" + recipients + ", subject=" + subject + '}';
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@ public ModelAndView register(@Valid @ModelAttribute("registerForm") final Regist
userSlug.setUser(user);
userSlugRepository.saveAndFlush(userSlug);

// TODO: Mail an Email-Adresse mit Verification-Key asynchron anleiern....
log.debug("Preparing mail to send");
final RegisterMailMessage rmm = new RegisterMailMessage(user);
log.debug("Passing mail to queue");
jmsTemplate.convertAndSend(JmsQueueTypes.QUEUE_MAIL, emailRenderService.to(rmm));
log.debug("Passing complete");

mv.addObject("validationKey", userStatus.getVerificationHash());
mv.addObject(WebDefines.DEFAULT_VIEW_ATTRIBUTE_NAME, "sites/accounts/registered");
Expand Down

0 comments on commit 53b6580

Please sign in to comment.