//
// UserUtil.setRoles(userId, roles);
// Send email notification
EmailConfig registrationEmail = userConfig.getRegistrationEmail();
if (registrationEmail != null && registrationEmail.isSend()) {
String adminName = company.getAdminName();
String subject = registrationEmail.getSubject();
subject = StringUtil.replace(
subject,
new String[] {"[$ADMIN_EMAIL_ADDRESS$]", "[$ADMIN_NAME$]",
"[$COMPANY_MX$]", "[$COMPANY_NAME$]",
"[$PORTAL_URL$]",
"[$USER_EMAIL_ADDRESS$]", "[$USER_ID$]",
"[$USER_NAME$]", "[$USER_PASSWORD$]"},
new String[] {company.getEmailAddress(), adminName,
company.getMx(), company.getName(),
company.getPortalURL(),
user.getEmailAddress(), user.getUserId(),
user.getFullName(), password1});
String body = registrationEmail.getBody();
body = StringUtil.replace(
body,
new String[] {"[$ADMIN_EMAIL_ADDRESS$]", "[$ADMIN_NAME$]",
"[$COMPANY_MX$]", "[$COMPANY_NAME$]",
"[$PORTAL_URL$]",