public interface NotificationMessage
Recipient tokens include:
recipientFirstName
: The recipient's first name.recipientLastName
: The recipient's last name.recipientName
: The recipient's full name, including first and last.recipientMobilePhone
: The recipient's mobile phone number.recipientOfficePhone
: The recipient's office phone number.recipientEmail
: The recipient's email.recipientTitle
: The recipient's title.NotificationParameters
. If the sender is not set, sender tokens will resolve to System values.
Sender tokens include:
senderFirstName
: The sender's first name.senderLastName
: The sender's last name.senderName
: The sender's full name, including first and last.senderUserName
: The sender's user name (login credentials).senderMobilePhone
: The sender's mobile phone number.senderOfficePhone
: The sender's office phone number.senderEmail
: The sender's email.senderTitle
: The sender's title.${vaultName}
,
${vaultId}
, ${uiBaseExtUrl}
, etc, which are automatically replaced for each notification.
You can view the full list
of tokens in Vault Help.
Note that many standard tokens are specific to some context. For example, ${docName}
,
${Object.name__v}
, and ${taskName}
are specific to a document, object, or workflow,
respectively. Because notifications created on the fly with NotificationMessage
are not associated with a
context, context specific tokens used in these types of notifications will resolve to empty strings.
{$Custom.tokenName}
.
You can set the value of a custom token in setTokenValue(String, String)
.
person__sys
), recipient tokens resolve to System values.
For example, ${recipientFirstName}
will resolve as "System", and ${recipientMobilePhone}
will resolve as an empty String.
To include information about a Person such as Person.first_name_sys
, use RecordService
to retrieve the Person record and Record.getValue(String, ValueType)
to get the
field value. Then you can add this value to your message as a custom token.Modifier and Type | Method and Description |
---|---|
NotificationMessage |
setMessage(String message)
Sets the message text for the body of a notification email.
|
NotificationMessage |
setNotificationText(String notificationText)
Sets the text of a notification, which appears in Home > Notifications in the Vault UI.
|
NotificationMessage |
setSubject(String subject)
Sets the subject of a notification email.
|
NotificationMessage |
setTokenValue(String tokenName,
String tokenValue)
Sets a custom token value.
|
NotificationMessage setNotificationText(String notificationText)
NotificationService.send()
is called with
this NotificationMessage
.notificationText
- notification text displayed in the Vault UINotificationMessage
NotificationMessage setSubject(String subject)
NotificationService.send()
is called with this
NotificationMessage
.subject
- subject text for the notification emailNotificationMessage
NotificationMessage setMessage(String message)
NotificationService.send()
is called with this
NotificationMessage
.message
- message text for the body of a notification emailNotificationMessage
NotificationMessage setTokenValue(String tokenName, String tokenValue)
${Custom.tokenName}
. You can use custom tokens in
the NotificationMessage
's text, subject, and message.
If a null tokenName or tokenValue is set, an error will occur when NotificationService.send()
is called
with this NotificationMessage
.tokenName
- name of a custom token for a NotificationMessage
. This name should not have the Custom prefix,
for example, use myTokenName
rather than Custom.myTokenName
.tokenValue
- value to set for the custom tokenNotificationMessage
Copyright © Veeva Systems 2017–2021. All rights reserved.