public void buildAndSaveNewOrderConfirmationMail(final RequestData requestData, final Customer customer, final OrderCustomer order) throws Exception {
final MarketArea marketArea = requestData.getMarketArea();
final String contextNameValue = requestData.getContextNameValue();
final String velocityPath = requestData.getVelocityEmailPrefix();
final OrderConfirmationEmailBean orderConfirmationEmailBean = new OrderConfirmationEmailBean();
orderConfirmationEmailBean.setFromAddress(marketArea.getEmailFromAddress(contextNameValue, Email.EMAIl_TYPE_RESET_PASSWORD_CONFIRMATION));
orderConfirmationEmailBean.setFromName(marketArea.getEmailFromName(contextNameValue, Email.EMAIl_TYPE_RESET_PASSWORD_CONFIRMATION));
orderConfirmationEmailBean.setReplyToEmail(marketArea.getEmailFromAddress(contextNameValue, Email.EMAIl_TYPE_RESET_PASSWORD_CONFIRMATION));
orderConfirmationEmailBean.setToEmail(customer.getEmail());
if (order != null) {
orderConfirmationEmailBean.setOrderNumber(order.getOrderNum());
DateFormat dateFormat = requestUtil.getFormatDate(requestData, DateFormat.MEDIUM, DateFormat.MEDIUM);
if (order.getExpectedDeliveryDate() != null) {
orderConfirmationEmailBean.setExpectedDeliveryDate(dateFormat.format(order.getExpectedDeliveryDate()));
} else {
orderConfirmationEmailBean.setExpectedDeliveryDate("NA");
}
orderConfirmationEmailBean.setOrderItemsTotalWithCurrencySign(order.getOrderItemTotalWithStandardCurrencySign());
orderConfirmationEmailBean.setOrderShippingTotalWithCurrencySign(order.getShippingTotalWithStandardCurrencySign());
orderConfirmationEmailBean.setOrderTaxesTotalWithCurrencySign(order.getTaxTotalWithStandardCurrencySign());
orderConfirmationEmailBean.setOrderTotalWithCurrencySign(order.getOrderTotalWithStandardCurrencySign());
}
emailService.buildAndSaveNewOrderConfirmationMail(requestData, customer, velocityPath, orderConfirmationEmailBean);
}