public class DefaultTemplateManager extends Object implements TemplateManager
Currently, the system initialises the template table by reading from the email-template-id-mappings.xml file. Custom templates can be added to this file - ensuring that an appropriate ID is given to the new template (e.g. >= 10000).
Constructor and Description |
---|
DefaultTemplateManager(ApplicationProperties applicationProperties,
EventTypeManager eventTypeManager) |
Modifier and Type | Method and Description |
---|---|
Template |
getDefaultTemplate(EventType eventType)
Retrieve the default template for specified event type.
|
Template |
getTemplate(Long templateId) |
Template |
getTemplate(SchemeEntity notificationSchemeEntity)
Retrieve the template from the notification scheme entity.
|
String |
getTemplateContent(Long templateId,
String format) |
Map<Long,Template> |
getTemplatesMap(String type)
Retrieve a map of templates of the specified type.
|
void |
onCacheClear(ClearCacheEvent event) |
public DefaultTemplateManager(ApplicationProperties applicationProperties, EventTypeManager eventTypeManager)
public Template getTemplate(Long templateId)
getTemplate
in interface TemplateManager
public Template getTemplate(SchemeEntity notificationSchemeEntity)
If the scheme entity is not related to a template id - return the default template for the event type. The eventTypeId corresponds to the default template id if there is no specific template association.
getTemplate
in interface TemplateManager
notificationSchemeEntity
- a notification scheme entity objectpublic Template getDefaultTemplate(EventType eventType)
eventType
- event type to retrieve the default template forpublic Map<Long,Template> getTemplatesMap(String type)
getTemplatesMap
in interface TemplateManager
type
- String specifiying the type of template to retrievepublic String getTemplateContent(Long templateId, String format)
getTemplateContent
in interface TemplateManager
@EventListener public void onCacheClear(ClearCacheEvent event)
Copyright © 2002-2021 Atlassian. All Rights Reserved.