Interface NotificationParameters


public interface NotificationParameters
Set the recipients, sender, and other notification options.
  • Method Details

    • setRecipientsByUserIds

      NotificationParameters setRecipientsByUserIds(Set<String> recipientIds)
      Sets the User (user__sys) record ids who will receive the notification. Additive to the recipient Groups, RecordRoles, and person IDs.

      If any invalid User IDs are set as recipients, an error will occur when NotificationService.send() is called with this NotificationParameters.

      If any inactive User IDs are set as recipients, they are ignored when NotificationService.send() is called with this NotificationParameters.

      Parameters:
      recipientIds - Set of notification recipients' User IDs
      Returns:
      The current NotificationParameters
    • setRecipientsByGroups

      NotificationParameters setRecipientsByGroups(List<Group> recipientGroups)
      Sets the List of Groups who will receive the notification. Additive to the recipient User IDs, RecordRoles, and person IDs.

      If any Group in the List is null, an error will occur when NotificationService.send() is called with this NotificationParameters.

      If any Group contains inactive User IDs, those users are ignored when NotificationService.send() is called with this NotificationParameters.

      Parameters:
      recipientGroups - List of Groups to receive the notification
      Returns:
      the current NotificationParameters
    • setRecipientsByRecordRoles

      NotificationParameters setRecipientsByRecordRoles(List<RecordRole> recipientRecordRoles)
      Sets the List of RecordRoles who will receive the notification. Additive to the recipient User IDs, Groups, and person IDs.

      If any RecordRole in the List is null, an error will occur when NotificationService.send() is called with this NotificationParameters.

      If any RecordRole contains inactive User IDs, those users are ignored when NotificationService.send() is called with this NotificationParameters.

      Parameters:
      recipientRecordRoles - List of RecordRoles to receive the notification
      Returns:
      the current NotificationParameters
    • setRecipientsByPersonIds

      NotificationParameters setRecipientsByPersonIds(Set<String> recipientPersonIds)
      Sets the Person (person__sys) record IDs who will receive the notification. Additive to the recipient User IDs, Groups, and RecordRoles.

      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 using setRecipientsByUserIds.

      If any invalid Person IDs are set as recipients, an error will occur when NotificationService.send() is called with this NotificationParameters.

      If any inactive Person IDs are set as recipients, they are ignored when NotificationService.send() is called with this NotificationParameters.

      If any Person IDs without an email address are set as recipients, they are ignored when NotificationService.send() is called with this NotificationParameters.

      Parameters:
      recipientPersonIds - Set of Person (person__sys) record IDs to receive the notification.
      Returns:
      the current NotificationParameters
    • setSenderId

      NotificationParameters setSenderId(String senderId)
      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 this NotificationParameters.

      Parameters:
      senderId - the sender's user ID
      Returns:
      the current NotificationParameters
    • setReplyToByUserId

      NotificationParameters setReplyToByUserId(String replyToId)
      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 this NotificationParameters.

      Parameters:
      replyToId - the replyTo user recipient ID
      Returns:
      the current NotificationParameters
    • setReplyToByPersonId

      NotificationParameters setReplyToByPersonId(String replyToPersonId)
      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 this NotificationParameters.

      Parameters:
      replyToPersonId - the replyTo person recipient ID
      Returns:
      the current NotificationParameters
    • setNotifyByEmailOnly

      @Deprecated NotificationParameters setNotifyByEmailOnly(boolean emailOnly)
      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

      NotificationParameters setNotificationMode(NotificationMode... notificationModes)
      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