fix send email with login credentials
This commit is contained in:
@@ -363,24 +363,20 @@ public class UserServiceImpl implements UserService {
|
||||
templateMessageService.generateAndSendMessage(user, template);
|
||||
}
|
||||
|
||||
if(sendEmailUponAccountCreation){
|
||||
if (user.equals(AuthUtils.getUser())) {
|
||||
logger.debug("User {} changed own password.", user.getCode());
|
||||
return;
|
||||
}
|
||||
else if(sendEmailUponAccountCreation){
|
||||
user.setSendEmailUponAccountCreation(false);
|
||||
AppBase appBase = Beans.get(AppBaseService.class).getAppBase();
|
||||
Template template = appBase.getAccountCreationTemplate();
|
||||
|
||||
AppBase appBase = Beans.get(AppBaseService.class).getAppBase();
|
||||
Template template = appBase.getAccountCreationTemplate();
|
||||
if (template == null) {
|
||||
throw new AxelorException(
|
||||
appBase,
|
||||
TraceBackRepository.CATEGORY_NO_VALUE,
|
||||
I18n.get("Template for account creation is missing."));
|
||||
}
|
||||
|
||||
if (template == null) {
|
||||
throw new AxelorException(
|
||||
appBase,
|
||||
TraceBackRepository.CATEGORY_NO_VALUE,
|
||||
I18n.get("Template for account creation is missing."));
|
||||
}
|
||||
|
||||
TemplateMessageService templateMessageService = Beans.get(TemplateMessageService.class);
|
||||
templateMessageService.generateAndSendMessage(user, template);
|
||||
TemplateMessageService templateMessageService = Beans.get(TemplateMessageService.class);
|
||||
templateMessageService.generateAndSendMessage(user, template);
|
||||
}
|
||||
} finally {
|
||||
user.setTransientPassword(null);
|
||||
|
||||
Reference in New Issue
Block a user