Interface NotificationTemplate
public interface NotificationTemplate
Set the template and tokens to resolve for a notification. You can use templates to support user language-specific
message translations. Templates may also contain tokens. Learn more about tokens in com.veeva.vault.sdk.api.notification.
-
Method Summary
Modifier and TypeMethodDescriptionsetTemplateName
(String templateName) Sets the notification template name (using the name of the notification template).default NotificationTemplate
setTokenResolver
(Consumer<TokenResolverInput> tokenResolverInputConsumer) Sets a Consumer that can provide resolved values for the requested tokens specified in aTokenResolverInput
.setTokenValue
(String tokenName, String tokenValue) Sets a custom token value.
-
Method Details
-
setTemplateName
Sets the notification template name (using the name of the notification template).If the templateName is not set or is invalid, an error will occur when
NotificationService.send()
is called with thisNotificationTemplate
.- Parameters:
templateName
- public key of notification template- Returns:
- the current
NotificationTemplate
-
setTokenValue
Sets a custom token value. Custom tokens, identified by${Custom.tokenName}
, can be placed in a notification template subject, message or text.Custom tokens in a notification template, such as Document Message or Object Message, can only contain characters [a-z,A-Z,0-9,_] and must be 40 characters maximum.
If a null tokenName or
tokenValue
is set, an error will occur whenNotificationService.send()
is called with this NotificationTemplate.- Parameters:
tokenName
- name of a custom token in the template. This name should not have the Custom prefix, for example, usemyTokenName
rather thanCustom.myTokenName
.tokenValue
- value to set for the custom token- Returns:
- the current
NotificationTemplate
-
setTokenResolver
default NotificationTemplate setTokenResolver(Consumer<TokenResolverInput> tokenResolverInputConsumer) Sets a Consumer that can provide resolved values for the requested tokens specified in aTokenResolverInput
. The default implementation does not set a Consumer for resolving tokens.- Parameters:
tokenResolverInputConsumer
- a Consumer that can resolve token values- Returns:
- the current
NotificationTemplate
-