Interface NotificationParameters
-
Method Summary
Modifier and TypeMethodDescriptionsetNotificationMode
(NotificationMode... notificationModes) Choose where the user will receive this notification.setNotifyByEmailOnly
(boolean emailOnly) Deprecated.setRecipientsByGroups
(List<Group> recipientGroups) Sets the List ofGroup
s who will receive the notification.setRecipientsByPersonIds
(Set<String> recipientPersonIds) Sets the Person (person__sys
) record IDs who will receive the notification.setRecipientsByRecordRoles
(List<RecordRole> recipientRecordRoles) Sets the List ofRecordRole
s who will receive the notification.setRecipientsByUserIds
(Set<String> recipientIds) Sets the User (user__sys
) record ids who will receive the notification.setReplyToByPersonId
(String replyToPersonId) Sets the Person (person__sys
) record ID who will receive notification responses.setReplyToByUserId
(String replyToId) Sets the User (user__sys
) record id who will receive notification responses.setSenderId
(String senderId) Sets the sender ID to provide values for sender tokens used in a notification template or message.
-
Method Details
-
setRecipientsByUserIds
Sets the User (user__sys
) record ids who will receive the notification. Additive to the recipientGroup
s,RecordRole
s, and person IDs.If any invalid User IDs are set as recipients, an error will occur when
NotificationService.send()
is called with thisNotificationParameters
.If any inactive User IDs are set as recipients, they are ignored when
NotificationService.send()
is called with thisNotificationParameters
.- Parameters:
recipientIds
- Set of notification recipients' User IDs- Returns:
- The current
NotificationParameters
-
setRecipientsByGroups
Sets the List ofGroup
s who will receive the notification. Additive to the recipient User IDs,RecordRole
s, and person IDs.If any
Group
in the List is null, an error will occur whenNotificationService.send()
is called with thisNotificationParameters
.If any
Group
contains inactive User IDs, those users are ignored whenNotificationService.send()
is called with thisNotificationParameters
.- Parameters:
recipientGroups
- List of Groups to receive the notification- Returns:
- the current
NotificationParameters
-
setRecipientsByRecordRoles
Sets the List ofRecordRole
s who will receive the notification. Additive to the recipient User IDs,Group
s, and person IDs.If any
RecordRole
in the List is null, an error will occur whenNotificationService.send()
is called with thisNotificationParameters
.If any
RecordRole
contains inactive User IDs, those users are ignored whenNotificationService.send()
is called with thisNotificationParameters
.- Parameters:
recipientRecordRoles
- List of RecordRoles to receive the notification- Returns:
- the current
NotificationParameters
-
setRecipientsByPersonIds
Sets the Person (person__sys
) record IDs who will receive the notification. Additive to the recipient User IDs,Group
s, andRecordRole
s.Persons are treated as external users and cannot receive in-app notifications. Person recipients will only receive email notifications to the email address found in each person record's standard
email__sys
field. Emails to persons use the external email template rather than the Vault user email template.Vault does not evaluate Person records for associated User (
user__sys
) records. If you wish to send in-app notifications, or to send emails using the Vault user email template, you must provide User IDs usingsetRecipientsByUserIds
.If any invalid Person IDs are set as recipients, an error will occur when
NotificationService.send()
is called with thisNotificationParameters
.If any inactive Person IDs are set as recipients, they are ignored when
NotificationService.send()
is called with thisNotificationParameters
.If any Person IDs without an email address are set as recipients, they are ignored when
NotificationService.send()
is called with thisNotificationParameters
.- Parameters:
recipientPersonIds
- Set of Person (person__sys) record IDs to receive the notification.- Returns:
- the current
NotificationParameters
-
setSenderId
Sets the sender ID to provide values for sender tokens used in a notification template or message. Setting the sender ID is not required to send a notification, but if the sender ID is not specified or set to null, sender tokens will default 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.
If an invalid or inactive user ID is set as the sender, an error will occur when
NotificationService.send()
is called with thisNotificationParameters
.- Parameters:
senderId
- the sender's user ID- Returns:
- the current
NotificationParameters
-
setReplyToByUserId
Sets the User (user__sys
) record id who will receive notification responses.Setting the replyTo ID is not required to send a notification, but if the replyTo ID is not specified or set to null, Vault delivers any replies to the from address.
If both setReplyToByUserId and setReplyToByPersonId are set, Vault throws an exception when
NotificationService.send()
is called with thisNotificationParameters
.- Parameters:
replyToId
- the replyTo user recipient ID- Returns:
- the current
NotificationParameters
-
setReplyToByPersonId
Sets the Person (person__sys
) record ID who will receive notification responses.Setting the replyTo ID is not required to send a notification, but if the replyTo ID is not specified or set to null, Vault delivers any replies to the from address.
If both setReplyToByUserId and setReplyToByPersonId are set, Vault throws an exception when
NotificationService.send()
is called with thisNotificationParameters
.- Parameters:
replyToPersonId
- the replyTo person recipient ID- Returns:
- the current
NotificationParameters
-
setNotifyByEmailOnly
Deprecated.as of 22R3.4, replaced bysetNotificationMode(com.veeva.vault.sdk.api.notification.NotificationMode...)
Choose if this notification sends to user's email only. By default, notifications are both sent as an email and displayed as an in-app notification in the Vault UI.- Parameters:
emailOnly
- true if email only; false for both email and in-app notification (default)- Returns:
- the current
NotificationParameters
-
setNotificationMode
Choose where the user will receive this notification. By default, notifications are both sent as an email and displayed as an in-app notification in the Vault UI.- Parameters:
notificationModes
- where to send the notification. Cannot be null.- Returns:
- the current
NotificationParameters
-
setNotificationMode(com.veeva.vault.sdk.api.notification.NotificationMode...)