model.put("image", image);
model.put("code", voucher.getCode());
model.put("storeName", storeName);
model.put("storeUrl", storeUrl);
EmailMessage email = new EmailMessage();
email.setTo(voucher.getToEmail());
email.setFrom(getSettingService().getConfig(SettingKey.CFG_EMAIL));
email.setSenderName(storeName);
String subject = MessageFormat.format(messageMap.get("text.subject"), voucher.getFromName());
email.setSubject(subject);
String text = templateService.renderTemplate("/admin/email/voucher", model);
email.setBodyHtml(text);
emailService.send(email);
}