public boolean sendNotifications(EmailModel emailModel) {
boolean success = false;
if (emailModel != null) {
try {
Long organizationId = (Long) emailModel.getParams().get("organizationId");
UserModel userModel = null;
Map<String, Object> userModelMap = (Map<String, Object>) emailModel.getParams().get("userModel");
if (userModelMap != null) {
userModel = new UserModel();
userModel.setEmail((String) userModelMap.get("email"));
Integer id = (Integer) userModelMap.get("id");
if (id != null) {
userModel.setId(id.longValue());
}
userModel.setFirstName((String) userModelMap.get("firstName"));
userModel.setLastName((String) userModelMap.get("lastName"));
userModel.setUserName((String) userModelMap.get("userName"));
}
success = emailService.sendOrganizationRegistrationEmail(organizationId, userModel);
} catch (ClassCastException e) {
log.error("Error casting params out of EmailModel:", e);
}