@@ -28,7 +28,12 @@ public class UserAccountRegistrationServiceImpl implements UserAccountRegistrati
28
28
private final JavaMailSender mailSender ;
29
29
30
30
@ Autowired
31
- public UserAccountRegistrationServiceImpl (SimpleworklistProperties simpleworklistProperties , UserAccountRegistrationRepository userAccountRegistrationRepository , TokenGeneratorService tokenGeneratorService , JavaMailSender mailSender ) {
31
+ public UserAccountRegistrationServiceImpl (
32
+ SimpleworklistProperties simpleworklistProperties ,
33
+ UserAccountRegistrationRepository userAccountRegistrationRepository ,
34
+ TokenGeneratorService tokenGeneratorService ,
35
+ JavaMailSender mailSender
36
+ ) {
32
37
this .simpleworklistProperties = simpleworklistProperties ;
33
38
this .userAccountRegistrationRepository = userAccountRegistrationRepository ;
34
39
this .tokenGeneratorService = tokenGeneratorService ;
@@ -38,7 +43,8 @@ public UserAccountRegistrationServiceImpl(SimpleworklistProperties simpleworklis
38
43
@ Override
39
44
public boolean registrationIsRetryAndMaximumNumberOfRetries (String email ) {
40
45
UserAccountRegistration earlierOptIn = userAccountRegistrationRepository .findByEmail (email );
41
- return earlierOptIn == null ?false :(earlierOptIn .getNumberOfRetries () >= simpleworklistProperties .getRegistration ().getMaxRetries ());
46
+ return earlierOptIn == null ?false :(earlierOptIn .getNumberOfRetries ()
47
+ >= simpleworklistProperties .getRegistration ().getMaxRetries ());
42
48
}
43
49
44
50
@ Override
@@ -47,7 +53,8 @@ public void registrationCheckIfResponseIsInTime(String email) {
47
53
UserAccountRegistration earlierOptIn = userAccountRegistrationRepository .findByEmail (email );
48
54
if (earlierOptIn != null ) {
49
55
Date now = new Date ();
50
- if ((simpleworklistProperties .getRegistration ().getTtlEmailVerificationRequest () + earlierOptIn .getRowCreatedAt ().getTime ()) < now .getTime ()) {
56
+ if ((simpleworklistProperties .getRegistration ().getTtlEmailVerificationRequest ()
57
+ + earlierOptIn .getRowCreatedAt ().getTime ()) < now .getTime ()) {
51
58
userAccountRegistrationRepository .delete (earlierOptIn );
52
59
}
53
60
}
@@ -109,10 +116,12 @@ private void sendEmailToRegisterNewUser(UserAccountRegistration o) {
109
116
SimpleMailMessage msg = new SimpleMailMessage ();
110
117
msg .setTo (o .getEmail ());
111
118
msg .setText (
112
- "Dear new User, "
119
+ "Dear new User,\n \n "
113
120
+ "thank you for registring at Simple Worklist. \n "
114
- + "Please validate your email and go to URL: \n http://" + urlHost + "/user/register/confirm/" + o .getToken ()
115
- + "\n \n Sincerely Yours, The Team" );
121
+ + "Please validate your email and go to URL: \n "
122
+ + "http://" + urlHost + "/user/register/confirm/" + o .getToken ()
123
+ + "\n \n Sincerely Yours, Simpleworklist Team"
124
+ );
116
125
msg .setSubject ("Your Registration at Simple Worklist" );
117
126
msg .setFrom (mailFrom );
118
127
try {
0 commit comments