Dec. 22, 2015
Customers can modify existing email templates or add new email templates that can be used to send emails from CloudPortal Business Manager.
A dialog box opens that contains the code for the template.
This modified template can now be used to send emails. This template gets persisted into the DB so it does not get reverted when CloudPortal Business Manager is re-started.
To add new templates, you must have the development setup as described in Installing and building custom components.
A sample liquibase change set for adding a custom email template will look as follows:
/** * @param template - the template location * @param model - model object required for the template * @param subjectKey - key code in messageSource for the subject * @param user - user to him the email has to be sent */ public void sendEmail(final String template, final Map<String, Object> model, final String subjectKey, final String toAddresses); eg: Map<String, Object> model = new HashMap<String, Object>(); model.put("locale", LocaleUtils.toLocale(config.getDefaultLocale())); model.put("user", user); emailService.sendEmail("SAMPLE_TEMPLATE", model, "email.template.SAMPLE_TEMPLATE.subject", <email addresses>);
Service provider can choose not to send email associated with any email template by simply making the content of the email template as NULL or empty. When content of any email template is nullified, then the email is not sent and is ignored.