m.setContent(getMailContent(MAIL_SPREAD_WOJ, params));
return m;
}
public Mail createInviteUserMail(User userLogged, String invitedLastName, String invitedFirstName, String invitedMail, License licenseToAffect) {
BasicMail m = new BasicMail();
m.setFrom(userLogged.getEmail());
m.setTo(new String[] {invitedMail});
Map params = new LinkedHashMap();
if (licenseToAffect.getGroup() != null) {
m.setSubject(getMailTitle(MAIL_GROUP_INVITATION_REQUEST));
params.put("groupName", licenseToAffect.getGroup().getName());
params.put("firstName", invitedFirstName);
params.put("lastName", invitedLastName);
} else {
m.setSubject(getMailTitle(MAIL_INVITATION_REQUEST));
}
params.put("licId", ""+licenseToAffect.getId());
params.put("adminId", ""+userLogged.getId());
params.put("invitedMail", invitedMail);
params.put("userFirstName", ((UserImpl)userLogged).getFirstName());
params.put("userLastName", ((UserImpl)userLogged).getLastName());
if (licenseToAffect.getGroup() != null) {
m.setContent(getMailContent(MAIL_GROUP_INVITATION_REQUEST, params));
} else {
m.setContent(getMailContent(MAIL_INVITATION_REQUEST, params));
}
return m;
}