From c2d56feea9fdfe2f0f2d161f0972ad86e6610be5 Mon Sep 17 00:00:00 2001 From: Marc Gorzala Date: Mon, 8 Apr 2024 16:31:01 +0200 Subject: [PATCH] now with name and real count --- .../dancier/kikeriki/adapter/out/userinfo/UserInfoAdapter.java | 1 + .../net/dancier/kikeriki/application/CheckAndSendService.java | 3 ++- .../net/dancier/kikeriki/application/port/UserInfoDto.java | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/dancier/kikeriki/adapter/out/userinfo/UserInfoAdapter.java b/src/main/java/net/dancier/kikeriki/adapter/out/userinfo/UserInfoAdapter.java index 31724db..d219e0a 100644 --- a/src/main/java/net/dancier/kikeriki/adapter/out/userinfo/UserInfoAdapter.java +++ b/src/main/java/net/dancier/kikeriki/adapter/out/userinfo/UserInfoAdapter.java @@ -10,6 +10,7 @@ public class UserInfoAdapter implements UserInfoPort { public UserInfoDto loadByDancerId(String dancerId) { UserInfoDto userInfoDto = new UserInfoDto(); userInfoDto.setDancerId(dancerId); + userInfoDto.setDancerName("recoby"); userInfoDto.setEmailAddress("dancer@dancier.net"); return userInfoDto; } diff --git a/src/main/java/net/dancier/kikeriki/application/CheckAndSendService.java b/src/main/java/net/dancier/kikeriki/application/CheckAndSendService.java index 4a6188e..890aeb6 100644 --- a/src/main/java/net/dancier/kikeriki/application/CheckAndSendService.java +++ b/src/main/java/net/dancier/kikeriki/application/CheckAndSendService.java @@ -59,7 +59,8 @@ public void sendMail(String dancerId, State state) { private String createBody(State state, UserInfoDto userInfoDto) { Map map = new HashMap<>(); - map.put("unread_messages", 10); + map.put("unread_messages", state.unreadMessagesCount()); + map.put("dancer_name", userInfoDto.getDancerName()); Context context = new Context(Locale.GERMANY, map); return templateEngine.process(USER_INFO_MAIL, context); } diff --git a/src/main/java/net/dancier/kikeriki/application/port/UserInfoDto.java b/src/main/java/net/dancier/kikeriki/application/port/UserInfoDto.java index 76ae60e..7edf0b8 100644 --- a/src/main/java/net/dancier/kikeriki/application/port/UserInfoDto.java +++ b/src/main/java/net/dancier/kikeriki/application/port/UserInfoDto.java @@ -7,6 +7,8 @@ public class UserInfoDto { private String dancerId; + private String dancerName; + private String emailAddress; }