use of org.olat.core.id.Preferences in project openolat by klemens.
the class SendTokenToUserForm method generateMailText.
private String generateMailText() {
Preferences prefs = user.getUser().getPreferences();
Locale locale = I18nManager.getInstance().getLocaleOrDefault(prefs.getLanguage());
String emailAdress = user.getUser().getProperty(UserConstants.EMAIL, locale);
if (emailAdress != null) {
dummyKey = Encoder.md5hash(emailAdress);
String serverpath = Settings.getServerContextPathURI();
Translator userTrans = Util.createPackageTranslator(RegistrationManager.class, locale);
String body = userTrans.translate("pwchange.intro", new String[] { user.getName() }) + userTrans.translate("pwchange.body", new String[] { serverpath, dummyKey, i18nModule.getLocaleKey(locale) });
return body;
} else
return "This function is not available for users without an email-adress!";
}
use of org.olat.core.id.Preferences in project openolat by klemens.
the class MailHelper method getMailFooter.
public static String getMailFooter(Identity sender) {
Preferences prefs = sender.getUser().getPreferences();
Locale locale = I18nManager.getInstance().getLocaleOrDefault(prefs.getLanguage());
return getMailFooter(locale, sender);
}
Aggregations