Object[] parameters = {customerNewAccountConfirmationEmailBean.getLastname(), customerNewAccountConfirmationEmailBean.getFirstname()};
mimeMessagePreparator.setSubject(coreMessageSource.getMessage("email.new_account.email_subject", parameters, locale));
mimeMessagePreparator.setHtmlContent(VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, velocityPath + "new-account-confirmation-html-content.vm", model));
mimeMessagePreparator.setPlainTextContent(VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, velocityPath + "new-account-confirmation-text-content.vm", model));
Email email = new Email();
email.setType(Email.EMAIl_TYPE_NEW_ACCOUNT_CONFIRMATION);
email.setStatus(Email.EMAIl_STATUS_PENDING);
saveOrUpdateEmail(email, mimeMessagePreparator);
} catch (MailException e) {
logger.error("Error, can't save the message :", e);
throw e;