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