Skip to main content

TemplateApiClient

com.notificationhub.sdk.client.TemplateApiClient — accessed via client.templates().

Methods

create

Map<String, Object> create(TemplateRequest request) throws NotificationHubException

update

Map<String, Object> update(UUID templateId, TemplateRequest request) throws NotificationHubException

get

Map<String, Object> get(UUID templateId) throws NotificationHubException

list

Map<String, Object> list(int page, int size) throws NotificationHubException

Paginated list of templates.

delete

void delete(UUID templateId) throws NotificationHubException

preview

Map<String, String> preview(UUID templateId, Map<String, Object> variables) throws NotificationHubException

Renders a saved template with the given variables.

previewRaw

Map<String, String> previewRaw(String rawTemplateHtml, Map<String, Object> variables) throws NotificationHubException

Renders arbitrary HTML through the template engine without persisting it — useful for a live editor preview.

TemplateRequest.Builder

MethodDescription
name(String name)Template name. Required.
subject(String subject)Default subject line. Required.
content(String content)Template body. Required.
build()Returns a TemplateRequest. Throws IllegalStateException if name, subject, or content is missing/blank.