userModel.setPassword(registrationForm.getFirstPassword().trim());
User user = registrationService.registerUser(userModel, false);
if (user != null && user.getId() != null && user.getId() > 0) {
try {
EventDelivery deliveryMechanism = eventDeliveryFactory.getEventDelivery(EventType.USER_ACCOUNT_ACTIVATION);
if (deliveryMechanism != null) {
deliveryMechanism.sendNotifications(user);
}
} catch (MailException e) {
log.error("Error sending Activation email to " + user.getEmail() + ".", e);
String[] codes = {"registration.emailException"};
ObjectError error = new ObjectError("registrationForm", codes, null, null);