@@ -366,7 +366,7 @@ public Response createUser(@OraData DbSession dbSession, FullRestRequest fullReq
366
366
PendingEmailConfirmationsProcessor pendingConfirmationProcessor = new PendingEmailConfirmationsProcessor (dbSession , httpSessionState .getUserId ());
367
367
String lang = request .getLanguage ();
368
368
PendingEmailConfirmations confirmation = pendingConfirmationProcessor .createEmailConfirmation (newUser );
369
- sendActivationMail (up , confirmation .getUrlPostfix (), account , email , lang , isYoungerThen14 );
369
+ sendActivationMail (up , confirmation .getUrlPostfix (), account , email , lang , isYoungerThen14 , httpSessionState . getUrl () );
370
370
}
371
371
Statistics .info ("UserCreate" , "success" , up .succeeded ());
372
372
UtilForREST .addResultInfo (response , up );
@@ -430,7 +430,7 @@ public Response updateUser(@OraData DbSession dbSession, FullRestRequest fullReq
430
430
up .updateUser (user , userName , role , email , null , isYoungerThen14 , deactivateAccount );
431
431
if ( deactivateAccount && up .succeeded () ) {
432
432
PendingEmailConfirmations confirmation = pendingConfirmationProcessor .createEmailConfirmation (user );
433
- sendActivationMail (up , confirmation .getUrlPostfix (), account , email , request .getLanguage (), isYoungerThen14 );
433
+ sendActivationMail (up , confirmation .getUrlPostfix (), account , email , request .getLanguage (), isYoungerThen14 , httpSessionState . getUrl () );
434
434
}
435
435
UtilForREST .addResultInfo (response , up );
436
436
}
@@ -513,7 +513,7 @@ public Response passwordRecovery(@OraData DbSession dbSession, FullRestRequest f
513
513
lostPassword .getUrlPostfix ()
514
514
};
515
515
try {
516
- this .mailManagement .send (user .getEmail (), "reset" , body , lang , false );
516
+ this .mailManagement .send (user .getEmail (), "reset" , body , lang , false , httpSessionState . getUrl () );
517
517
up .setStatus (ProcessorStatus .SUCCEEDED , Key .USER_PASSWORD_RECOVERY_SENT_MAIL_SUCCESS , responseParameters );
518
518
} catch ( MessagingException e ) {
519
519
up .setStatus (ProcessorStatus .FAILED , Key .USER_PASSWORD_RECOVERY_SENT_MAIL_FAIL , responseParameters );
@@ -691,7 +691,7 @@ public Response resendActivation(@OraData DbSession dbSession, FullRestRequest f
691
691
if ( !email .equals ("" ) ) {
692
692
PendingEmailConfirmations confirmation = pendingConfirmationProcessor .createEmailConfirmation (user );
693
693
// TODO ask here again for the age
694
- sendActivationMail (up , confirmation .getUrlPostfix (), account , email , lang , false );
694
+ sendActivationMail (up , confirmation .getUrlPostfix (), account , email , lang , false , httpSessionState . getUrl () );
695
695
}
696
696
}
697
697
UtilForREST .addResultInfo (response , up );
@@ -800,15 +800,22 @@ public Response setStatusText(FullRestRequest fullRequest) throws Exception {
800
800
}
801
801
}
802
802
803
- private void sendActivationMail (UserProcessor up , String urlPostfix , String account , String email , String lang , boolean isYoungerThen14 ) throws Exception {
803
+ private void sendActivationMail (
804
+ UserProcessor up ,
805
+ String urlPostfix ,
806
+ String account ,
807
+ String email ,
808
+ String lang ,
809
+ boolean isYoungerThen14 ,
810
+ String url ) throws Exception {
804
811
Map <String , String > responseParameters = new HashMap <>();
805
812
String [] body =
806
813
{
807
814
account ,
808
815
urlPostfix
809
816
};
810
817
try {
811
- this .mailManagement .send (email , "activate" , body , lang , isYoungerThen14 );
818
+ this .mailManagement .send (email , "activate" , body , lang , isYoungerThen14 , url );
812
819
up .setStatus (ProcessorStatus .SUCCEEDED , Key .USER_ACTIVATION_SENT_MAIL_SUCCESS , responseParameters );
813
820
} catch ( Exception e ) {
814
821
up .setStatus (ProcessorStatus .FAILED , Key .USER_ACTIVATION_SENT_MAIL_FAIL , responseParameters );
0 commit comments